Merged guilt.lib into guilt
[guilt.git] / guilt-header
blob5e492d039353ac60c5873f98917d7e0fe3f9b8f9
1 #!/bin/bash
3 # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
6 source "`dirname $0`/guilt"
8 patch="$1"
10 if [ -z "$patch" ]; then
11 # use the patch that's on the top of the stack
13 eidx=`wc -l < $applied`
14 if [ $eidx -eq 0 ]; then
15 echo "Status file is empty"
16 exit 1
18 else
19 # use the specified patch
21 eidx=`get_series | grep -ne "^$patch\$" | cut -d: -f1`
22 if [ $eidx -eq 0 ]; then
23 echo "Patch $patch is not in the series"
24 exit 1
28 idx=0
29 for p in `get_series`; do
30 idx=`expr $idx + 1`
31 [ $idx -lt $eidx ] && continue
32 [ $idx -gt $eidx ] && break
34 do_get_header $GUILT_DIR/$branch/$p
35 done