If I have a staged file, then git stash --keep-index is run by precious. This stash appears to trigger the post-checkout hook.
precious tidy --staged
💍 Tidying files staged for a git commit
[precious::precious][ERROR] Failed to run precious: Got unexpected stderr output from `git stash --keep-index`:
foo
If you like, I can happily look into fixing this, but I wanted to check with you first.
Given the following
post-checkout
script:If I have a staged file, then
git stash --keep-index
is run byprecious
. Thisstash
appears to trigger thepost-checkout
hook.I think the checkout might be happening here, but it's mostly a guess: https://github.com/git/git/blob/master/builtin/stash.c#L1621-L1622
As to why the hook output is sent to
STDERR
rather thanSTDOUT
, I think this is likely the explanation: https://github.com/git/git/commit/e258eb4800e30da2adbdb2df8d8d8c19d9b443e4If I have all of this correct, then maybe the logic which runs
git stash --keep-index
should be checking an exit code rather thanSTDERR
?