We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7564654 commit 9d4625aCopy full SHA for 9d4625a
src/tools/git-external-diff
@@ -0,0 +1,22 @@
1
+#!/bin/bash
2
+
3
+# Parameters:
4
+# $1 $2 $3 $4 $5 $6 $7
5
+# path old-file old-hash old-mode new-file new-hash new-mode
6
+# 'path' is the git-tree-relative path of the file being diff'ed
7
8
+old_hash="$3"
9
+new_hash=$(git hash-object "$5")
10
11
+# no change?
12
+[ "$old_hash" = "$new_hash" ] && exit 0
13
14
+[ "$DIFF_OPTS" = "" ] && DIFF_OPTS='-pcd'
15
16
+echo "diff --git a/$1 b/$1"
17
+echo "new file mode $7"
18
+echo "index ${old_hash:0:7}..${new_hash:0:7}"
19
20
+diff --label a/"$1" --label b/"$1" $DIFF_OPTS "$2" "$5"
21
22
+exit 0
0 commit comments