You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today I got pretty mad at overcommit when issuing a "Ctrl+C" during a pre-commit hook and I saw I've just lost all my work.... Just to understand 5 minutes later that it was stashed and I could recover it easily. See some explanations in #80
I think overcommit should issue an explicit message when doing frightening operations like this, maybe with some guidance to recover your work before you get as mad as I was.
Note that it's not something that happens only in rare cases when you change your mind when doing git commit. Overcommit has the (awesome!) ability to run rubocop only on modified lines, as long as other goodies, so I frequently have a second window running watch .git/hooks/pre-commit, and as soon as I "Ctrl+C" on that window to stop watching, I take the risk of such a git reset --hard or git stash if I understand the behavior correctly.
What do you think ? Happy to work on a PR if you think the idea is worth it.
The text was updated successfully, but these errors were encountered:
jbbarth
changed the title
Overcommit should emit a warning when issuing "git reset --hard"
Overcommit should emit a warning when issuing "git reset --hard" or "git stash"
Apr 1, 2020
OK, I just saw that it seems stashing is part of normal overcommit behavior if some changes are not staged. My overall comment still stands I think, but I definitely think I don't have enough insights about overcommit implementation, so I'd be more than happy if someone can clarify all this :-)
Thanks for the feedback! Added a quick note to remind users to check their stash. There are good reasons why we reset in this way but it's understandable that without the necessary context it seems wrong. See this explanation—hope it clarifies.
Today I got pretty mad at overcommit when issuing a "Ctrl+C" during a pre-commit hook and I saw I've just lost all my work.... Just to understand 5 minutes later that it was stashed and I could recover it easily. See some explanations in #80
I think overcommit should issue an explicit message when doing frightening operations like this, maybe with some guidance to recover your work before you get as mad as I was.
Note that it's not something that happens only in rare cases when you change your mind when doing
git commit
. Overcommit has the (awesome!) ability to run rubocop only on modified lines, as long as other goodies, so I frequently have a second window runningwatch .git/hooks/pre-commit
, and as soon as I "Ctrl+C" on that window to stop watching, I take the risk of such agit reset --hard
orgit stash
if I understand the behavior correctly.What do you think ? Happy to work on a PR if you think the idea is worth it.
The text was updated successfully, but these errors were encountered: