]> git.ipfire.org Git - thirdparty/git.git/blame - mergetools/p4merge
Start the 2.46 cycle
[thirdparty/git.git] / mergetools / p4merge
CommitLineData
bc7a96a8 1diff_cmd () {
950b5680
DA
2 empty_file=
3
3facc600 4 # p4merge does not like /dev/null
3facc600
DA
5 if test "/dev/null" = "$LOCAL"
6 then
950b5680 7 LOCAL="$(create_empty_file)"
3facc600
DA
8 fi
9 if test "/dev/null" = "$REMOTE"
10 then
950b5680 11 REMOTE="$(create_empty_file)"
3facc600
DA
12 fi
13
bc7a96a8 14 "$merge_tool_path" "$LOCAL" "$REMOTE"
3facc600 15
950b5680 16 if test -n "$empty_file"
3facc600 17 then
950b5680 18 rm -f "$empty_file"
3facc600 19 fi
bc7a96a8
DA
20}
21
980145f7
FR
22diff_cmd_help () {
23 echo "Use HelixCore P4Merge (requires a graphical session)"
24}
25
bc7a96a8 26merge_cmd () {
4549162e
KB
27 if ! $base_present
28 then
29 cp -- "$LOCAL" "$BASE"
30 create_virtual_base "$BASE" "$REMOTE"
31 fi
c699a7cc 32 "$merge_tool_path" "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
bc7a96a8 33}
950b5680
DA
34
35create_empty_file () {
36 empty_file="${TMPDIR:-/tmp}/git-difftool-p4merge-empty-file.$$"
37 >"$empty_file"
38
d272c849 39 printf "%s" "$empty_file"
950b5680 40}
980145f7
FR
41
42merge_cmd_help () {
43 echo "Use HelixCore P4Merge (requires a graphical session)"
44}