3 # Copyright (c) Josef "Jeff" Sipek, 2008
6 USAGE
="-n <num> | -a | --all"
17 [ "$2" -lt 0 ] && die
"Must specify a number of patches to commit"
18 [ "$2" -eq 0 ] && exit 0
21 pat_keep
="`expr "$2" + 1`,\$p"
28 # if nothing's applied, exit
29 [ `wc -l < "$applied"` -eq 0 ] && exit 0
31 # remove patch refs for what's being committed, and update series
32 sed -n -e "${pat_commit}" "$applied" |
while read pname
; do
33 series_remove_patch
"$pname"
34 echo "$pname" | remove_patch_refs
37 # update $applied to include only the patches we're keeping
38 sed -n -e "${pat_keep}" "$applied" > "$applied.tmp"
39 mv "$applied.tmp" "$applied"
41 # update references to top, bottom, and base