2 # Copyright (C) 2005 Junio C Hamano
4 # This script is designed to emulate what the built-in diff driver
5 # does when set as GIT_EXTERNAL_SCRIPT.
9 echo "* Unmerged path $1"
12 name1
="$1" tmp1
="$2" hex1
="$3" mode1
="$4" tmp2
="$5" hex2
="$6" mode2
="$7"
17 name2
="$8" xfrm_msg
="$9" ;;
22 name_
="$1" tmp_
="$2" hex_
="$3" mode_
="$4"
23 echo "diff --git a/$name_ b/$name_"
24 echo "new file mode $mode_"
25 diff ${GIT_DIFF_OPTS-'-pu'} -L /dev
/null
-L "b/$name_" /dev
/null
"$tmp_"
29 name_
="$1" tmp_
="$2" hex_
="$3" mode_
="$4"
30 echo "diff --git a/$name_ b/$name_"
31 echo "deleted file mode $mode_"
32 diff ${GIT_DIFF_OPTS-'-pu'} -L "a/$name_" -L /dev
/null
"$tmp_" /dev
/null
38 .
) show_create
"$name2" "$tmp2" "$hex2" "$mode2"
44 .
) show_delete
"$name1" "$tmp1" "$hex1" "$mode1"
48 if test "$type1" != "$type2"
50 show_delete
"$name1" "$tmp1" "$hex1" "$mode1"
51 show_create
"$name2" "$tmp2" "$hex2" "$mode2"
55 echo diff --git "a/$name1" "b/$name2"
56 if test "$mode1" != "$mode2"
58 echo "old mode $mode1"
59 echo "new mode $mode2"
60 if test "$xfrm_msg" != ""
65 diff ${GIT_DIFF_OPTS-'-pu'} -L "a/$name1" -L "b/$name2" "$tmp1" "$tmp2"