Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 53 lines (48 sloc) 839 Bytes
#!/bin/sh
#
# Copyright (c) Eric Lesh, 2007
#
USAGE="[ -n | --none | -s | --series | [--pop|--reapply] <guards...> ]"
. `dirname $0`/guilt
select_guards()
{
for x in "$@"; do
if [ $(printf %s "$x" | grep -e "^[+-]") ]; then
die "'$x' cannot begin with + or -."
fi
done
echo "$@" | sed -e 's/ /\n/g' | sort | uniq > "$guards_file"
}
if [ $# -eq 0 ]; then
if [ -s "$guards_file" ]; then
cat "$guards_file"
else
echo >&2 "No guards applied"
fi
exit 0
fi
case $1 in
-n|--none)
rm -f "$guards_file"
;;
--pop)
guilt-pop -a
shift
select_guards "$@"
;;
--reapply)
top=`get_top`
guilt-pop -a
shift
select_guards "$@"
guilt-push "$top"
;;
-s|--series)
(get_full_series | while read patch; do
get_guards "$patch"
done) | sed -e 's/ /\n/g' | sort | uniq
;;
*)
select_guards "$@"
;;
esac