Closed OddBloke closed 10 years ago
This requires some thought...
Yeah, irritating isn't it.
I suspect the solution for this lies in not doing the stash at all.
If I recall, the reason for the stash was so the checks are only performed on the files to be committed.
Potentially there's another way of getting the correct diff to be committed.
I think flake8 do it by creating a temporary copy of the files from the git index; not sure how much I like that solution though...
I'm working on this in branch 36_dont_stash
I've taken the copy-file-to-be-committed approach using git show :filename
.
Only issue at the moment is that we get output which isn't exactly perfect:
===============================================================================
Checking flake8
===============================================================================
/var/folders/6b/ql76gbpn0wz53q4hl2bxg6lw0000gn/T/tmpp22eB8/captainhook/checkers/utils.py:58:1: E303 too many blank lines (3)
/var/folders/6b/ql76gbpn0wz53q4hl2bxg6lw0000gn/T/tmpp22eB8/captainhook/checkers/utils.py:91:1: E303 too many blank lines (3)
===============================================================================
Rejecting commit
===============================================================================
insert lolz for mac temp directories
I'm thinking that a better approach might be to:
I'm hitting problems when I edit a hunk during an
add -p
; the stash that captainhook stores will fail to apply on pop (because it refers to a tree which won't exist after the commit happens).This stops the commit from happening and it screws up my carefully crafted commit (I just spent a minute using very salty language; appropriate for captainhook) by causing a merge conflict.
I think we should output the
stash pop
error, but still commit if that's the only problem we have.