Killing the lint script causes unstaged changes to be lost
See original GitHub issueDescription
Using GitHub Desktop 1.0.13, I crafted a commit that had only some of the changed files staged, and also some hunk commits (i.e. just certain lines of a file staged, while other lines in the same file were not staged).
After clicking “commit”, the usual checking began. While the script was running (it always takes a few minutes for me), my machine froze due to lack of memory (I had too many things open at the same time). I hard-resetted the laptop by holding down the power button and then started again.
Actual behaviour: Opening the repo, I see that now the only changes left in the repository are the ones I had staged for that aborted commit. The unstaged changes are gone.
Expected behaviour: Even when the pre-commit script fails, no changes should be lost.
Steps to reproduce
Can’t provide right now
Debug Logs
Can’t provide right now
expand to view
COPY THE DEBUG LOGS HERE
Environment
- OS: Ubuntu 18.04
- Node.js: 8.10.0
lint-staged
: 8.0.4
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:32 (10 by maintainers)
Top GitHub Comments
For those experiencing this issue, your changes technically should be recoverable, as the tool persists the entire working tree before clearing unstaged changes. Unfortunately, nothing in the logs seems to tell you the hash for that tree for the purposes of recovery, so I guess you would have to check the folder timestamps in
.git/objects
.🎉 This issue has been resolved in version 10.0.0 🎉
The release is available on:
Your semantic-release bot 📦🚀