|
From: | Paul Eggert |
Subject: | Re: git pre-commit hook for merges (WAS: master has switched from Automake to GNU Make) |
Date: | Wed, 12 Apr 2017 11:26:22 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 04/11/2017 09:25 AM, Noam Postavsky wrote:
Perhaps we should change the hook so that it doesn't complain about problems from merges?
Something like that might make sense, yes, for people in Alan's situation. When I do a merge, though, I'd rather see problems from the other side (so that I can fix them). How about an environment variable that captures the user's preference?
+# If we're merging, don't flag problems that came from the other side +# of the merge. +head=HEAD +if [ -f "$GIT_DIR"/MERGE_HEAD ] ; then + head=$(cat "$GIT_DIR"/MERGE_HEAD) +fi
This won't work if MERGE_HEAD file contains more than one entry, which can happen when doing a 3- or more-way merge. How about the attached (untested) patch instead? It behaves the way that you suggested, when doing a 2-way merge and when the GIT_MERGE_BLINDLY environment variable is set to 'true'. Offhand I don't see a way of supporting 3- or more-way merges easily, so this patch punts and ignores GIT_MERGE_BLINDLY when doing fancier merges.
0001-Allow-bypassing-of-some-checks-when-merging.patch
Description: Source code patch
[Prev in Thread] | Current Thread | [Next in Thread] |