Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File won't be committed if it was rejected by pre-commit #7

Closed
tpwo opened this issue Jan 3, 2022 · 0 comments
Closed

File won't be committed if it was rejected by pre-commit #7

tpwo opened this issue Jan 3, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@tpwo
Copy link
Owner

tpwo commented Jan 3, 2022

There is a check that stops committing a zettel if there is no output in git diff (i.e. there were no changes between the recent version). This is good when I just enter and exit (with pyzet edit) an already committed zettel without adding a thing.

But when pre-commit rejects committing a zettel, it is already staged. So, if I enter and exit the zettel with pyzet edit it won't be committed.

I see a solution in checking for git diff --staged if git diff is empty. This should also check for this edge case. Another solution is to unstage zettel when pre-commit rejects it, but it's probably harder to implement. IDK at this point, and will decide later.

@tpwo tpwo closed this as completed in 01ca5fd Jan 23, 2022
@tpwo tpwo added the bug Something isn't working label Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant