Skip to content

Commit

Permalink
Recursive delete function to get rid of whole thread
Browse files Browse the repository at this point in the history
  • Loading branch information
singpolyma committed Jul 24, 2009
1 parent 3cf7658 commit df55356
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
12 changes: 10 additions & 2 deletions bin/git-ticket-close
Expand Up @@ -70,8 +70,16 @@ git add "$TICKET"
if [ "$COMMIT" -eq 1 ]; then if [ "$COMMIT" -eq 1 ]; then
git commit -em"Closes: $*" git commit -em"Closes: $*"
if [ "$DELETE" -eq 1 ]; then if [ "$DELETE" -eq 1 ]; then
git rm "$TICKET" rm_thread() {
T="`git rm "$TICKET"-* 2>&1`" IFS="
"
for LINE in `git ticket list comments "$1"`; do
rm_thread "$LINE"
done
IFS=" "
git rm "$1"
}
rm_thread "$TICKET"
cd .. cd ..
git commit -m"Remove closed ticket $*" git commit -m"Remove closed ticket $*"
fi fi
Expand Down
17 changes: 16 additions & 1 deletion bin/git-ticket-list
Expand Up @@ -10,5 +10,20 @@ fi


if [ -d .tickets ]; then if [ -d .tickets ]; then
cd .tickets cd .tickets
grep -vil 'In-Reply-To' * | grep -v current
case "$1" in
comments)
shift
if [ -z "$*" -o ! -f "$*" ]; then
echo "You must specify a valid ticket or comment." 1>&2
exit 1
fi
MESSAGEID="`grep -i Message-Id < "$*" | cut -d':' -f2 | sed -e's/^ *//'`"
grep -il "^In-Reply-To: $MESSAGEID$" *
;;
*)
grep -vil '^In-Reply-To:' * | grep -v current
;;
esac

fi fi

0 comments on commit df55356

Please sign in to comment.