]> granicus.if.org Git - postgresql/blob - src/tools/git-external-diff
Small improvements in comments in async.c.
[postgresql] / src / tools / git-external-diff
1 #!/bin/bash
2
3 # This script is used to produce git context diffs
4
5 # Supplied parameters:
6 # $1   $2       $3       $4       $5       $6       $7
7 # path old-file old-hash old-mode new-file new-hash new-mode
8 # 'path' is the git-tree-relative path of the file being diff'ed
9
10 old_hash="$3"
11 new_hash=$(git hash-object "$5")
12
13 # no change?
14 [ "$old_hash" = "$new_hash" ] && exit 0
15
16 [ "$DIFF_OPTS" = "" ] && DIFF_OPTS='-pcd'
17
18 echo "diff --git a/$1 b/$1"
19 echo "new file mode $7"
20 echo "index ${old_hash:0:7}..${new_hash:0:7}"
21
22 diff --label a/"$1" --label b/"$1" $DIFF_OPTS "$2" "$5"
23
24 exit 0