Skip to content

Ctrl-c lost working tree on 0.16 #80

Closed

Description

@michaeldiscala

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

Activity

  1. sds commented on Sep 16, 2014

    @sds
    Owner

    Hey @michaeldiscala,

    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.

  2. michaeldiscala commented on Sep 16, 2014

    @michaeldiscala
    Author

    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?

  3. sds commented on Sep 16, 2014

    @sds
    Owner

    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.

  4. sds commented on Sep 16, 2014

    @sds
    Owner

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions