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
I accidentally committed before I was ready and hit Ctrl-c while overcommit was running. When it exited, by tree was reset back to HEAD. I just upgraded to 0.17, but the changelog doesn't mention anything about this kind of issue
Your changes are likely in your stash. Run git stash list and you should see a stash from Overcommit.
Unfortunately, there's no way Overcommit can handle every single case when you forcefully interrupt it. The one situation I'm aware of where this occurs is when you are running a watcher which can generate files in response to inotify events. If it generates a file in your working tree after Overcommit stashes your changes, when Overcommit attempts to re-apply that stash it will fail since there are files it wasn't expecting in the working tree.
You should always be able to restore your changes by manually reapplying the stash. Hope this helps.
No, I'm not aware of any condition where the stash is lost entirely. It's possible no stash was made in the first place (e.g. you were amending a commit without adding any changes, like updating the commit message), but that wouldn't result in a lost commit.
Should this happen again, please include the output of the last few commands you ran (as well as what you see when you hit Ctrl-C). There might be some nuanced aspect to your workflow that hasn't been considered.
Activity
sds commentedon Sep 16, 2014
Hey @michaeldiscala,
Your changes are likely in your stash. Run
git stash listand you should see a stash from Overcommit.Unfortunately, there's no way Overcommit can handle every single case when you forcefully interrupt it. The one situation I'm aware of where this occurs is when you are running a watcher which can generate files in response to
inotifyevents. If it generates a file in your working tree after Overcommit stashes your changes, when Overcommit attempts to re-apply that stash it will fail since there are files it wasn't expecting in the working tree.You should always be able to restore your changes by manually reapplying the stash. Hope this helps.
michaeldiscala commentedon Sep 16, 2014
Hey @sds,
Thanks for the reply! I did check in the stash but didn't see anything there. Are there any known ways that might happen?
sds commentedon Sep 16, 2014
No, I'm not aware of any condition where the stash is lost entirely. It's possible no stash was made in the first place (e.g. you were amending a commit without adding any changes, like updating the commit message), but that wouldn't result in a lost commit.
sds commentedon Sep 16, 2014
Should this happen again, please include the output of the last few commands you ran (as well as what you see when you hit Ctrl-C). There might be some nuanced aspect to your workflow that hasn't been considered.
Thanks!
Support hook side effects without stashing repository changes (#939)