mergetools: add description to all diff/merge tools

The output of `git mergetool --tool-help` and `git difftool --tool-help`
only showed the `alias` of each available merge/diff tool.

It is not always obvious what tool these `aliases` end up using (ex:
`opendiff` runs `FileMerge` and `bc` runs `Beyond Compare`).

This commit adds a short description to each of them to help the user
identify the `alias` they want.

Signed-off-by: Fernando Ramos <greenfoo@u92.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Fernando Ramos 2022-03-30 21:19:09 +02:00 committed by Junio C Hamano
parent 7b5cf8be18
commit 980145f747
20 changed files with 160 additions and 0 deletions

View File

@ -2,6 +2,10 @@ diff_cmd () {
"$merge_tool_path" -wait -2 "$LOCAL" "$REMOTE" >/dev/null 2>&1 "$merge_tool_path" -wait -2 "$LOCAL" "$REMOTE" >/dev/null 2>&1
} }
diff_cmd_help () {
echo "Use Araxis Merge (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
if $base_present if $base_present
then then
@ -13,6 +17,10 @@ merge_cmd () {
fi fi
} }
merge_cmd_help () {
echo "Use Araxis Merge (requires a graphical session)"
}
translate_merge_tool_path() { translate_merge_tool_path() {
echo compare echo compare
} }

View File

@ -2,6 +2,10 @@ diff_cmd () {
"$merge_tool_path" "$LOCAL" "$REMOTE" "$merge_tool_path" "$LOCAL" "$REMOTE"
} }
diff_cmd_help () {
echo "Use Beyond Compare (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
if $base_present if $base_present
then then
@ -13,6 +17,10 @@ merge_cmd () {
fi fi
} }
merge_cmd_help () {
echo "Use Beyond Compare (requires a graphical session)"
}
translate_merge_tool_path() { translate_merge_tool_path() {
if type bcomp >/dev/null 2>/dev/null if type bcomp >/dev/null 2>/dev/null
then then

View File

@ -2,6 +2,10 @@ diff_cmd () {
"$merge_tool_path" "$LOCAL" "$REMOTE" "$merge_tool_path" "$LOCAL" "$REMOTE"
} }
diff_cmd_help () {
echo "Use Code Compare (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
if $base_present if $base_present
then then
@ -13,6 +17,10 @@ merge_cmd () {
fi fi
} }
merge_cmd_help () {
echo "Use Code Compare (requires a graphical session)"
}
translate_merge_tool_path() { translate_merge_tool_path() {
if merge_mode if merge_mode
then then

View File

@ -2,6 +2,10 @@ diff_cmd () {
"$merge_tool_path" "$LOCAL" "$REMOTE" >/dev/null 2>&1 "$merge_tool_path" "$LOCAL" "$REMOTE" >/dev/null 2>&1
} }
diff_cmd_help () {
echo "Use DeltaWalker (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
# Adding $(pwd)/ in front of $MERGED should not be necessary. # Adding $(pwd)/ in front of $MERGED should not be necessary.
# However without it, DeltaWalker (at least v1.9.8 on Windows) # However without it, DeltaWalker (at least v1.9.8 on Windows)
@ -16,6 +20,10 @@ merge_cmd () {
fi >/dev/null 2>&1 fi >/dev/null 2>&1
} }
merge_cmd_help () {
echo "Use DeltaWalker (requires a graphical session)"
}
translate_merge_tool_path () { translate_merge_tool_path () {
echo DeltaWalker echo DeltaWalker
} }

View File

@ -2,6 +2,10 @@ diff_cmd () {
"$merge_tool_path" "$LOCAL" "$REMOTE" >/dev/null 2>&1 "$merge_tool_path" "$LOCAL" "$REMOTE" >/dev/null 2>&1
} }
diff_cmd_help () {
echo "Use DiffMerge (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
if $base_present if $base_present
then then
@ -13,6 +17,10 @@ merge_cmd () {
fi fi
} }
merge_cmd_help () {
echo "Use DiffMerge (requires a graphical session)"
}
exit_code_trustable () { exit_code_trustable () {
true true
} }

View File

@ -2,6 +2,10 @@ diff_cmd () {
"$merge_tool_path" "$LOCAL" "$REMOTE" | cat "$merge_tool_path" "$LOCAL" "$REMOTE" | cat
} }
diff_cmd_help () {
echo "Use Diffuse (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
if $base_present if $base_present
then then
@ -13,3 +17,7 @@ merge_cmd () {
"$LOCAL" "$MERGED" "$REMOTE" | cat "$LOCAL" "$MERGED" "$REMOTE" | cat
fi fi
} }
merge_cmd_help () {
echo "Use Diffuse (requires a graphical session)"
}

View File

@ -2,6 +2,10 @@ diff_cmd () {
"$merge_tool_path" --default --mode=diff2 "$LOCAL" "$REMOTE" "$merge_tool_path" --default --mode=diff2 "$LOCAL" "$REMOTE"
} }
diff_cmd_help () {
echo "Use ECMerge (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
if $base_present if $base_present
then then
@ -12,3 +16,7 @@ merge_cmd () {
--default --mode=merge2 --to="$MERGED" --default --mode=merge2 --to="$MERGED"
fi fi
} }
merge_cmd_help () {
echo "Use ECMerge (requires a graphical session)"
}

View File

@ -2,6 +2,10 @@ diff_cmd () {
"$merge_tool_path" -f emerge-files-command "$LOCAL" "$REMOTE" "$merge_tool_path" -f emerge-files-command "$LOCAL" "$REMOTE"
} }
diff_cmd_help () {
echo "Use Emacs' Emerge"
}
merge_cmd () { merge_cmd () {
if $base_present if $base_present
then then
@ -17,6 +21,10 @@ merge_cmd () {
fi fi
} }
merge_cmd_help () {
echo "Use Emacs' Emerge"
}
translate_merge_tool_path() { translate_merge_tool_path() {
echo emacs echo emacs
} }

View File

@ -2,6 +2,10 @@ diff_cmd () {
"$merge_tool_path" "$LOCAL" "$REMOTE" -nh "$merge_tool_path" "$LOCAL" "$REMOTE" -nh
} }
diff_cmd_help () {
echo "Use ExamDiff Pro (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
if $base_present if $base_present
then then
@ -11,6 +15,10 @@ merge_cmd () {
fi fi
} }
merge_cmd_help () {
echo "Use ExamDiff Pro (requires a graphical session)"
}
translate_merge_tool_path() { translate_merge_tool_path() {
mergetool_find_win32_cmd "ExamDiff.com" "ExamDiff Pro" mergetool_find_win32_cmd "ExamDiff.com" "ExamDiff Pro"
} }

View File

@ -2,6 +2,10 @@ diff_cmd () {
"$merge_tool_path" "$LOCAL" "$REMOTE" "$merge_tool_path" "$LOCAL" "$REMOTE"
} }
diff_cmd_help () {
echo "Use Guiffy's Diff Tool (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
if $base_present if $base_present
then then
@ -13,6 +17,10 @@ merge_cmd () {
fi fi
} }
merge_cmd_help () {
echo "Use Guiffy's Diff Tool (requires a graphical session)"
}
exit_code_trustable () { exit_code_trustable () {
true true
} }

View File

@ -4,6 +4,10 @@ diff_cmd () {
"$LOCAL" "$REMOTE" >/dev/null 2>&1 "$LOCAL" "$REMOTE" >/dev/null 2>&1
} }
diff_cmd_help () {
echo "Use KDiff3 (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
if $base_present if $base_present
then then
@ -22,6 +26,10 @@ merge_cmd () {
fi fi
} }
merge_cmd_help () {
echo "Use KDiff3 (requires a graphical session)"
}
exit_code_trustable () { exit_code_trustable () {
true true
} }

View File

@ -2,10 +2,18 @@ can_merge () {
return 1 return 1
} }
diff_cmd_help () {
echo "Use Kompare (requires a graphical session)"
}
diff_cmd () { diff_cmd () {
"$merge_tool_path" "$LOCAL" "$REMOTE" "$merge_tool_path" "$LOCAL" "$REMOTE"
} }
merge_cmd_help () {
echo "Use Kompare (requires a graphical session)"
}
exit_code_trustable () { exit_code_trustable () {
true true
} }

View File

@ -2,6 +2,10 @@ diff_cmd () {
"$merge_tool_path" "$LOCAL" "$REMOTE" "$merge_tool_path" "$LOCAL" "$REMOTE"
} }
diff_cmd_help () {
echo "Use Meld (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
check_meld_for_features check_meld_for_features
@ -20,6 +24,10 @@ merge_cmd () {
fi fi
} }
merge_cmd_help () {
echo "Use Meld (requires a graphical session) with optional \`auto merge\` (see \`git help mergetool\`'s \`CONFIGURATION\` section)"
}
# Get meld help message # Get meld help message
init_meld_help_msg () { init_meld_help_msg () {
if test -z "$meld_help_msg" if test -z "$meld_help_msg"

View File

@ -2,6 +2,10 @@ diff_cmd () {
"$merge_tool_path" "$LOCAL" "$REMOTE" | cat "$merge_tool_path" "$LOCAL" "$REMOTE" | cat
} }
diff_cmd_help () {
echo "Use FileMerge (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
if $base_present if $base_present
then then
@ -12,3 +16,7 @@ merge_cmd () {
-merge "$MERGED" | cat -merge "$MERGED" | cat
fi fi
} }
merge_cmd_help () {
echo "Use FileMerge (requires a graphical session)"
}

View File

@ -19,6 +19,10 @@ diff_cmd () {
fi fi
} }
diff_cmd_help () {
echo "Use HelixCore P4Merge (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
if ! $base_present if ! $base_present
then then
@ -34,3 +38,7 @@ create_empty_file () {
printf "%s" "$empty_file" printf "%s" "$empty_file"
} }
merge_cmd_help () {
echo "Use HelixCore P4Merge (requires a graphical session)"
}

View File

@ -2,6 +2,10 @@ diff_cmd () {
"$merge_tool_path" mergetool "$LOCAL" "$REMOTE" -o "$MERGED" "$merge_tool_path" mergetool "$LOCAL" "$REMOTE" -o "$MERGED"
} }
diff_cmd_help () {
echo "Use Sublime Merge (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
if $base_present if $base_present
then then
@ -10,3 +14,7 @@ merge_cmd () {
"$merge_tool_path" mergetool "$LOCAL" "$REMOTE" -o "$MERGED" "$merge_tool_path" mergetool "$LOCAL" "$REMOTE" -o "$MERGED"
fi fi
} }
merge_cmd_help () {
echo "Use Sublime Merge (requires a graphical session)"
}

View File

@ -2,6 +2,10 @@ diff_cmd () {
"$merge_tool_path" "$LOCAL" "$REMOTE" "$merge_tool_path" "$LOCAL" "$REMOTE"
} }
diff_cmd_help () {
echo "Use TkDiff (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
if $base_present if $base_present
then then
@ -14,3 +18,7 @@ merge_cmd () {
exit_code_trustable () { exit_code_trustable () {
true true
} }
merge_cmd_help () {
echo "Use TkDiff (requires a graphical session)"
}

View File

@ -2,6 +2,10 @@ can_diff () {
return 1 return 1
} }
diff_cmd_help () {
echo "Use TortoiseMerge (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
if $base_present if $base_present
then then
@ -30,3 +34,7 @@ translate_merge_tool_path() {
echo tortoisemerge echo tortoisemerge
fi fi
} }
merge_cmd_help () {
echo "Use TortoiseMerge (requires a graphical session)"
}

View File

@ -3,6 +3,10 @@ diff_cmd () {
return 0 return 0
} }
diff_cmd_help () {
echo "Use WinMerge (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
# mergetool.winmerge.trustExitCode is implicitly false. # mergetool.winmerge.trustExitCode is implicitly false.
# touch $BACKUP so that we can check_unchanged. # touch $BACKUP so that we can check_unchanged.
@ -13,3 +17,7 @@ merge_cmd () {
translate_merge_tool_path() { translate_merge_tool_path() {
mergetool_find_win32_cmd "WinMergeU.exe" "WinMerge" mergetool_find_win32_cmd "WinMergeU.exe" "WinMerge"
} }
merge_cmd_help () {
echo "Use WinMerge (requires a graphical session)"
}

View File

@ -12,6 +12,10 @@ diff_cmd () {
fi fi
} }
diff_cmd_help () {
echo "Use xxdiff (requires a graphical session)"
}
merge_cmd () { merge_cmd () {
if $base_present if $base_present
then then
@ -28,3 +32,7 @@ merge_cmd () {
--merged-file "$MERGED" "$LOCAL" "$REMOTE" --merged-file "$MERGED" "$LOCAL" "$REMOTE"
fi fi
} }
merge_cmd_help () {
echo "Use xxdiff (requires a graphical session)"
}