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
}
diff_cmd_help () {
echo "Use Araxis Merge (requires a graphical session)"
}
merge_cmd () {
if $base_present
then
@ -13,6 +17,10 @@ merge_cmd () {
fi
}
merge_cmd_help () {
echo "Use Araxis Merge (requires a graphical session)"
}
translate_merge_tool_path() {
echo compare
}

View File

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

View File

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

View File

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

View File

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

View File

@ -2,6 +2,10 @@ diff_cmd () {
"$merge_tool_path" "$LOCAL" "$REMOTE" | cat
}
diff_cmd_help () {
echo "Use Diffuse (requires a graphical session)"
}
merge_cmd () {
if $base_present
then
@ -13,3 +17,7 @@ merge_cmd () {
"$LOCAL" "$MERGED" "$REMOTE" | cat
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"
}
diff_cmd_help () {
echo "Use ECMerge (requires a graphical session)"
}
merge_cmd () {
if $base_present
then
@ -12,3 +16,7 @@ merge_cmd () {
--default --mode=merge2 --to="$MERGED"
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"
}
diff_cmd_help () {
echo "Use Emacs' Emerge"
}
merge_cmd () {
if $base_present
then
@ -17,6 +21,10 @@ merge_cmd () {
fi
}
merge_cmd_help () {
echo "Use Emacs' Emerge"
}
translate_merge_tool_path() {
echo emacs
}

View File

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

View File

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

View File

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

View File

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

View File

@ -2,6 +2,10 @@ diff_cmd () {
"$merge_tool_path" "$LOCAL" "$REMOTE"
}
diff_cmd_help () {
echo "Use Meld (requires a graphical session)"
}
merge_cmd () {
check_meld_for_features
@ -20,6 +24,10 @@ merge_cmd () {
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
init_meld_help_msg () {
if test -z "$meld_help_msg"

View File

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

View File

@ -19,6 +19,10 @@ diff_cmd () {
fi
}
diff_cmd_help () {
echo "Use HelixCore P4Merge (requires a graphical session)"
}
merge_cmd () {
if ! $base_present
then
@ -34,3 +38,7 @@ create_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"
}
diff_cmd_help () {
echo "Use Sublime Merge (requires a graphical session)"
}
merge_cmd () {
if $base_present
then
@ -10,3 +14,7 @@ merge_cmd () {
"$merge_tool_path" mergetool "$LOCAL" "$REMOTE" -o "$MERGED"
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"
}
diff_cmd_help () {
echo "Use TkDiff (requires a graphical session)"
}
merge_cmd () {
if $base_present
then
@ -14,3 +18,7 @@ merge_cmd () {
exit_code_trustable () {
true
}
merge_cmd_help () {
echo "Use TkDiff (requires a graphical session)"
}

View File

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

View File

@ -3,6 +3,10 @@ diff_cmd () {
return 0
}
diff_cmd_help () {
echo "Use WinMerge (requires a graphical session)"
}
merge_cmd () {
# mergetool.winmerge.trustExitCode is implicitly false.
# touch $BACKUP so that we can check_unchanged.
@ -13,3 +17,7 @@ merge_cmd () {
translate_merge_tool_path() {
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
}
diff_cmd_help () {
echo "Use xxdiff (requires a graphical session)"
}
merge_cmd () {
if $base_present
then
@ -28,3 +32,7 @@ merge_cmd () {
--merged-file "$MERGED" "$LOCAL" "$REMOTE"
fi
}
merge_cmd_help () {
echo "Use xxdiff (requires a graphical session)"
}