]> git.ipfire.org Git - thirdparty/git.git/commit - git-mergetool--lib.sh
mergetool: honor mergetool.$tool.trustExitCode for built-in tools
authorDavid Aguilar <davvid@gmail.com>
Tue, 29 Nov 2016 09:38:07 +0000 (01:38 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 29 Nov 2016 18:54:03 +0000 (10:54 -0800)
commit7c10605d2ccf499af6136e993cf248892be39168
treefd2c42ea696c365423d767225278d8cd8c49b516
parentac84098b7e32406a982ac01cc76a663d5605224b
mergetool: honor mergetool.$tool.trustExitCode for built-in tools

Built-in merge tools contain a hard-coded assumption about
whether or not a tool's exit code can be trusted to determine
the success or failure of a merge.  Tools whose exit codes are
not trusted contain calls to check_unchanged() in their
merge_cmd() functions.

A problem with this is that the trustExitCode configuration is
not honored for built-in tools.

Teach built-in tools to honor the trustExitCode configuration.
Extend run_merge_cmd() so that it is responsible for calling
check_unchanged() when a tool's exit code cannot be trusted.
Remove check_unchanged() calls from scriptlets since they are no
longer responsible for calling it.

When no configuration is present, exit_code_trustable() is
checked to see whether the exit code should be trusted.
The default implementation returns false.

Tools whose exit codes can be trusted override
exit_code_trustable() to true.

Reported-by: Dun Peal <dunpealer@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 files changed:
git-mergetool--lib.sh
mergetools/araxis
mergetools/bc
mergetools/codecompare
mergetools/deltawalker
mergetools/diffmerge
mergetools/diffuse
mergetools/ecmerge
mergetools/emerge
mergetools/examdiff
mergetools/kdiff3
mergetools/kompare
mergetools/meld
mergetools/opendiff
mergetools/p4merge
mergetools/tkdiff
mergetools/tortoisemerge
mergetools/vimdiff
mergetools/winmerge
mergetools/xxdiff