refresh: Added --diffstat option
[guilt.git] / guilt-header
blobd07e2bea122c71e84bb13faabc063208fda798a6
1 #!/bin/sh
3 # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
6 USAGE="[<patchname>]"
7 . `dirname $0`/guilt
9 if [ $# -gt 1 ]; then
10 usage
13 patch="$1"
15 if [ -z "$patch" ]; then
16 # use the patch that's on the top of the stack
18 eidx=`wc -l < $applied`
19 if [ $eidx -eq 0 ]; then
20 die "Status file is empty"
22 else
23 # use the specified patch
25 eidx=`get_series | grep -ne "^$patch\$" | cut -d: -f1`
26 if [ $eidx -eq 0 ]; then
27 die "Patch $patch is not in the series"
31 idx=0
32 for p in `get_series`; do
33 idx=`expr $idx + 1`
34 [ $idx -lt $eidx ] && continue
35 [ $idx -gt $eidx ] && break
37 do_get_header $GUILT_DIR/$branch/$p
38 done