Skip to content

Provide guidance or helper function to recover stashed code after user interruption of git commit #1362

@lorenzwalthert

Description

@lorenzwalthert

I ran git commit and did not stage all files that were modified in the repo, so pre-commit stashed them to my systems pre-commit cache in $HOME/pre-commit for later restore. I then interrupted (my bad) the process and now I wonder how I can git stash apply ... and / or where I have to put the file patch49209 that is now in the cache back in .git/ without breaking my git repo. I know it's more a git than a pre-commit issue but I think it would be appropriate to provide guidance in the documentation and / or a helper function in pre-commit to get out of such a situation smoothly (if possible) because it is much more likely to occur when using pre-commit and there are checks that are non-instantaneous (because the user then has more time to make a mistake 😄).

I quickly googled and it does not seem very straight-forward. I think this can really cause a big headache otherwise, especially for non-git experts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions