@matheusbsbs / matheus-bagliano / commits / fb700cb067
Fork 0

mergetool: Don't repeat merge tool candidates

git mergetool listed some candidates for mergetools twice, depending on the environment. This slightly changes the behavior when both KDE_FULL_SESSION and GNOME_DESKTOP_SESSION_ID are set at the same time; in such a case meld is used in favor of kdiff3 (the old code favored kdiff3 in such a case), but it should not matter in practice. Signed-off-by: Johannes Gilger <heipei@hackvalue.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Gilger committed Jan 24, 2009 at 00:12 UTC fb700cb0679e22900f0d1435641e6cf7c652968b
1 file changed +8 -10
git-mergetool.sh
+8 -10
@@ -390,21 +390,19 @@ fi
390
391 if test -z "$merge_tool" ; then
392 if test -n "$DISPLAY"; then
393 - merge_tool_candidates="kdiff3 tkdiff xxdiff meld gvimdiff"
393 if test -n "$GNOME_DESKTOP_SESSION_ID" ; then
395 - merge_tool_candidates="meld $merge_tool_candidates"
396 - fi
397 - if test "$KDE_FULL_SESSION" = "true"; then
398 - merge_tool_candidates="kdiff3 $merge_tool_candidates"
394 + merge_tool_candidates="meld kdiff3 tkdiff xxdiff gvimdiff"
395 + else
396 + merge_tool_candidates="kdiff3 tkdiff xxdiff meld gvimdiff"
397 fi
398 fi
399 if echo "${VISUAL:-$EDITOR}" | grep 'emacs' > /dev/null 2>&1; then
402 - merge_tool_candidates="$merge_tool_candidates emerge"
403 - fi
404 - if echo "${VISUAL:-$EDITOR}" | grep 'vim' > /dev/null 2>&1; then
405 - merge_tool_candidates="$merge_tool_candidates vimdiff"
400 + merge_tool_candidates="$merge_tool_candidates emerge opendiff vimdiff"
401 + elif echo "${VISUAL:-$EDITOR}" | grep 'vim' > /dev/null 2>&1; then
402 + merge_tool_candidates="$merge_tool_candidates vimdiff opendiff emerge"
403 + else
404 + merge_tool_candidates="$merge_tool_candidates opendiff emerge vimdiff"
405 fi
407 - merge_tool_candidates="$merge_tool_candidates opendiff emerge vimdiff"
406 echo "merge tool candidates: $merge_tool_candidates"
407 for i in $merge_tool_candidates; do
408 init_merge_tool_path $i