3 # Copyright (c) Josef "Jeff" Sipek, 2007-2011
7 if [ -z "$GUILT_VERSION" ]; then
8 echo "Invoking `basename $0` directly is no longer supported." >&2
20 bottom
=`git rev-parse refs/patches/$branch/$(head_n 1 < "$applied")`
21 base
=`git rev-parse $bottom^`
23 if [ -z "$patchname" ]; then
24 top
=`git rev-parse HEAD`
26 top
=`grep "^$patchname$" "$applied"`
27 if [ -z "$top" ]; then
28 die
"Cannot find patch '$patchname'. Is it applied?"
34 git diff-tree
-r "$1^" "$1" |
tr '\t' ' ' | cut
-d' ' -f6
37 cache
="$GUILT_DIR/$branch/.graphcache.$$"
39 trap "rm -rf \"$cache\"" 0
45 while [ "$current" != "$base" ]; do
46 pname
=`git show-ref | sed -n -e "
47 /^$current refs\/patches\/$branch/ {
48 s,^$current refs/patches/$branch/,,
52 [ -z "$pname" ] && pname
="?"
54 disp
"# checking rev $current"
55 disp
" \"$current\" [label=\"$pname\"]"
61 getfiles
$current |
while read f
; do
63 fh
=`echo "$f" | sha1 | cut -d' ' -f1`
64 if [ -e "$cache/$fh" ]; then
65 # ok, something already touched this file before us
66 cat "$cache/$fh" >> "$cache/dep"
68 echo "$current" > "$cache/$fh"
71 sort -u "$cache/dep" |
while read h
; do
72 disp
" \"$h\" -> \"$current\"; // ?"
75 current
=`git rev-parse $current^`