question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Killing the lint script causes unstaged changes to be lost

See original GitHub issue

Description

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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:32 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
tskimmettcommented, Mar 12, 2019

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.

0reactions
okonetcommented, Jan 19, 2020

🎉 This issue has been resolved in version 10.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitHub desktop Husky pre-commit hook does not
and git commit -m 'something' flow works fine: Husky's pre-commit hook and lint-staged commands are picked up successfully. However, the Github ...
Read more >
hg-51 - man pages section 1: User Commands
To undo an uncommitted merge, use hg merge --abort which will check out a clean copy of the original merge parent, losing all...
Read more >
Diff - scripts - fuchsia Git repositories
-No checking is performed for incremental changes. - -The sample command lines below can be used to build Modular and then push those...
Read more >
homebrew-core - Homebrew Formulae
a2ps 4.14 Any‑to‑PostScript filter aacgain 1.8 AAC‑supporting version of mp3gain aalib 1.4rc5 Portable ASCII art graphics library aamath 0.3 Renders mathematical expressions as ASCII art
Read more >
Sacha Chua's Emacs configuration
This opens another buffer in emacs-lisp-mode , so you can use M-x eval-buffer to load the changes. If you want to explore how...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found