Closed mrenvoize closed 8 years ago
This looks extremely similar to: https://github.com/brigade/overcommit/issues/52 I wonder if the fix there can be used as a basis for a fix here?
On Wed May 11, 2016 at 03:23:14AM -0700, Martin Renvoize wrote:
Every time I have a merge with conflicts githook-perltidy "breaks" the merge commit message.
Thanks for reporting this. I must admit I had seen that error occasionally but hadn't gotten around to tracking down under which conditions it occurred.
This looks extremely similar to: https://github.com/brigade/overcommit/issues/52 I wonder if the fix there can be used as a basis for a fix here?
I have actually been thinking that using git-stash is the wrong way for githook-perltidy to do what it does. Apart from the merge issue it is also problematic if the tidied code and the stashed code conflict: applying the stash in the post-commit hook fails leaving the repo and working tree in a bad state.
I did a quick bit of research and I think a better option will be to rework githook-perltidy in terms of git-checkout-index and git-update-index/git-read-tree. Will take me a couple of weeks to get round to doing that though.
Mark Lawrence
Sounds interesting.. I've been wondering similar things though hadn't managed to get round to looking into the specifics.
Wish I wasn't so lacking in time at the minute else I'd have a stab myself.
Many thanks,
I have just uploaded MLAWREN/App-githook-perltidy-0.11.3_1.tar.gz which you can test if you like. It is basically a rewrite that does everything in a temporary work tree instead of the main one. Since it doesn't use git-stash at all it should not conflict with merges.
Once the cpantesters have given it a decent run I'll do a stable release.
Awesome! I'll have a play over the next couple of days.. many thanks for working on it :)
Closing this as version 0.11.4 is now on CPAN.
Every time I have a merge with conflicts githook-perltidy "breaks" the merge commit message. this is what appear after fixing the conflicts and trying to commit the merge:
and on closing the editor: