From: Junio C Hamano Date: Tue, 21 Oct 2014 20:28:37 +0000 (-0700) Subject: Merge branch 'da/mergetool-tool-help' X-Git-Tag: v2.2.0-rc0~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e96e98b3399ae4c638466f84068fe94d4712c5a3;p=git Merge branch 'da/mergetool-tool-help' Allow "git mergetool --help" to run outside a Git repository. * da/mergetool-tool-help: difftool: don't assume that default sh is sane mergetool: don't require a work tree for --tool-help git-sh-setup: move GIT_DIR initialization into a function mergetool: use more conservative temporary filenames test-lib-functions: adjust style to match CodingGuidelines t7610-mergetool: prefer test_config over git config --- e96e98b3399ae4c638466f84068fe94d4712c5a3 diff --cc git-mergetool.sh index 96a61ba6f4,821253e368..ec644d542d --- a/git-mergetool.sh +++ b/git-mergetool.sh @@@ -378,16 -381,12 +382,19 @@@ prompt_after_failed_merge () done } + git_dir_init + require_work_tree + if test -z "$merge_tool" then - merge_tool=$(get_merge_tool "$merge_tool") || exit + # Check if a merge tool has been configured + merge_tool=$(get_configured_merge_tool) + # Try to guess an appropriate merge tool if no tool has been set. + if test -z "$merge_tool" + then + merge_tool=$(guess_merge_tool) || exit + guessed_merge_tool=true + fi fi merge_keep_backup="$(git config --bool mergetool.keepBackup || echo true)" merge_keep_temporaries="$(git config --bool mergetool.keepTemporaries || echo false)"