git/mergetools/p4merge
Fernando Ramos 980145f747 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>
2022-04-03 15:10:04 -07:00

45 lines
784 B
Plaintext

diff_cmd () {
empty_file=
# p4merge does not like /dev/null
if test "/dev/null" = "$LOCAL"
then
LOCAL="$(create_empty_file)"
fi
if test "/dev/null" = "$REMOTE"
then
REMOTE="$(create_empty_file)"
fi
"$merge_tool_path" "$LOCAL" "$REMOTE"
if test -n "$empty_file"
then
rm -f "$empty_file"
fi
}
diff_cmd_help () {
echo "Use HelixCore P4Merge (requires a graphical session)"
}
merge_cmd () {
if ! $base_present
then
cp -- "$LOCAL" "$BASE"
create_virtual_base "$BASE" "$REMOTE"
fi
"$merge_tool_path" "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
}
create_empty_file () {
empty_file="${TMPDIR:-/tmp}/git-difftool-p4merge-empty-file.$$"
>"$empty_file"
printf "%s" "$empty_file"
}
merge_cmd_help () {
echo "Use HelixCore P4Merge (requires a graphical session)"
}