3 # Copyright (c) Josef "Jeff" Sipek, 2007-2011
7 if [ -z "$GUILT_VERSION" ]; then
8 echo "Invoking $GUILT 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 safebranch
=`echo "$branch"|sed 's%/%\\\\/%g'`
46 while [ "$current" != "$base" ]; do
47 pname
=`git show-ref | sed -n -e "
48 /^$current refs\/patches\/$safebranch/ {
49 s,^$current refs/patches/$branch/,,
53 [ -z "$pname" ] && pname
="?"
55 disp
"# checking rev $current"
56 disp
" \"$current\" [label=\"$pname\"]"
62 getfiles
$current |
while read f
; do
64 fh
=`echo "$f" | sha1 | cut -d' ' -f1`
65 if [ -e "$cache/$fh" ]; then
66 # ok, something already touched this file before us
67 cat "$cache/$fh" >> "$cache/dep"
69 echo "$current" > "$cache/$fh"
72 sort -u "$cache/dep" |
while read h
; do
73 disp
" \"$h\" -> \"$current\"; // ?"
76 current
=`git rev-parse $current^`