Re: git-rerere observations and feature suggestions
From: Peter Zijlstra <peterz@infradead.org>
Date: 2016-06-15 22:44:48
On Mon, 2008-06-23 at 16:20 +0200, Peter Zijlstra wrote:
On Mon, 2008-06-23 at 11:49 +0200, Ingo Molnar wrote:quoted
another git-rerere observation: occasionally it happens that i accidentally commit a merge marker into the source code. That's obviously stupid, and it normally gets found by testing quickly, but still it would be a really useful avoid-shoot-self-in-foot feature if git-commit could warn about such stupidities of mine. ( and if i could configure git-commit to outright reject a commit like that - i never want to commit lines with <<<<<< or >>>>> markers) Another merge conflict observation is that Git is much worse at figuring out the right merge resolution than our previous Quilt based workflow was. I eventually found it to be mainly due to the following detail: sometimes it's more useful to first apply the merged branch and then attempt to merge HEAD, as a patch. I've got a script for that which also combines it with the "rej" tool, and in about 70%-80% of the cases where Git is unable to resolve a merge automatically it figures things out. ('rej' is obviously a more relaxed merge utility, but it's fairly robust in my experience, with a very low false positive rate.) The ad-hoc "tip-mergetool" script we are using is attached below. It's really just for demonstration purposes - it doesnt work when there's a rename related conflict, etc. Peter Zijstra also wrote a git-mergetool extension for the 'rej' tool btw., he might want to post that patch. I've attached Chris Mason's rej tool too.This is what I run with. I added the cp to the 3-way merge tools because I think its stupid to see the messed up merge markers instead of the original file.
While we're on the subject, I only found one tool that 'digs' these merge markers and that is xxdiff --unmerge. One would think more tools understand these merge markers, but I couldn't find any.