Commit 1feedd0
committed
Remove stashing logic
Using stash was problematic in the sense that suppose you commit
a file and have another unstaged file to which you are making changes.
During the pre-commit hook, all unstaged files are stashed, which
means the unstaged file is reverted back to its original state. So,
if during pre-commit linting, you try and make changes to the
unstaged file, you will encounter a merge conflict once the stashed
changes are restored. Furthermore, I encountered a situation where
during the pre-commit hook, changes were stashed, but not restored.
This seems like a recipe for dev issues.
The problem certainly remains that I can try to commit a file, find
that it fails lint tests, update the file to no longer fail lint tests,
and fail to stage the most recent modifications. At which point, the
pre-commit hook will succeed, giving me a false positive indication
that everything is okay.
In practice, I've found such false positives rare, as, personally,
I do a decent job of staging any changes I make which are needed
to pass pre-commit and pre-push checks.1 parent 0622969 commit 1feedd0
1 file changed
+0
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | 71 | | |
75 | 72 | | |
76 | 73 | | |
77 | 74 | | |
78 | 75 | | |
79 | | - | |
80 | | - | |
81 | 76 | | |
82 | 77 | | |
83 | 78 | | |
| |||
0 commit comments