Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

mark now uses git-config

  • Loading branch information...
commit 9fbdfb4ff502569631e1ad495df511a79c6a5e93 1 parent 2bb3025
Stephen Paul Weber authored
22 bin/git-ticket-close
View
@@ -38,16 +38,20 @@ fi
mkdir -p .tickets
cd .tickets
-if [ -z "$*" -a -f current ]; then
- IFS="
+if [ -z "$*" ]; then
+ BRANCH="`git status | grep 'On branch' | sed -e's/# On branch //'`"
+ CURRENT="`git config --get-all "tickets.$BRANCH.current"`"
+ if [ -n "$CURRENT" ]; then
+ IFS="
"
- for LINE in `cat current`; do
- if [ -n "$LINE" ]; then
- "$0" "$LINE"
- fi
- git ticket mark clear
- done
- exit
+ for LINE in $CURRENT; do
+ if [ -n "$LINE" ]; then
+ "$0" "$LINE"
+ fi
+ git ticket mark clear
+ done
+ exit
+ fi
fi
TICKET="`echo "$*" | sed -e's/\//-/'`"
21 bin/git-ticket-comment
View
@@ -17,15 +17,20 @@ fi
mkdir -p .tickets
cd .tickets
-if [ -z "$*" -a -f current ]; then
- IFS="
+if [ -z "$*" ]; then
+ BRANCH="`git status | grep 'On branch' | sed -e's/# On branch //'`"
+ CURRENT="`git config --get-all "tickets.$BRANCH.current"`"
+ if [ -n "$CURRENT" ]; then
+ IFS="
"
- for LINE in `cat current`; do
- if [ -n "$LINE" ]; then
- "$0" "$LINE"
- fi
- done
- exit
+ for LINE in $CURRENT; do
+ if [ -n "$LINE" ]; then
+ "$0" "$LINE"
+ fi
+ git ticket mark clear
+ done
+ exit
+ fi
fi
TICKET="`echo "$*" | sed -e's/\//-/'`"
2  bin/git-ticket-list
View
@@ -22,7 +22,7 @@ if [ -d .tickets ]; then
grep -il "^In-Reply-To: $MESSAGEID$" *
;;
*)
- grep -iL '^In-Reply-To:' * | grep -v current
+ grep -iL '^In-Reply-To:' *
;;
esac
20 bin/git-ticket-mark
View
@@ -1,7 +1,7 @@
#!/bin/sh
COMMAND="add"
-if [ "$1" = "rm" -o "$1" = "clear" ]; then
+if [ "$1" = "clear" ]; then
COMMAND="$1"
shift
fi
@@ -14,15 +14,13 @@ if ! cd_to_toplevel; then
exit 1
fi
-if [ -z "`grep .tickets/current .git/info/exclude`" ]; then
- echo ".tickets/current" >> .git/info/exclude
-fi
-
mkdir -p .tickets
cd .tickets
+BRANCH="`git status | grep 'On branch' | sed -e's/# On branch //'`"
+
if [ "$COMMAND" = "clear" ]; then
- rm current
+ git config --unset-all "tickets.$BRANCH.current"
echo "Marks cleared"
exit
fi
@@ -32,13 +30,7 @@ if [ -z "$1" -o ! -f "$1" ]; then
exit 1
fi
-if [ "$COMMAND" = "rm" ]; then
- touch current
- DATA="`sed -e"s/^$1$//" current`"
- echo "$DATA" > current
- echo "Mark removed"
- exit
-fi
+# XXX do we need an rm command?
-echo "$1" >> current
+git config --add "tickets.$BRANCH.current" "$*"
echo "Marked"
Please sign in to comment.
Something went wrong with that request. Please try again.