git-tickets

track tickets in a plain text format within a git repository
git clone https://git.ce9e.org/git-tickets.git

commit
f4a82b51451b67dc711a066cdbcf0ba7486a2f33
parent
93066189396738d1a1d3f8f0f9b6f0638b3b88f9
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2017-07-16 17:24
Fix state handling (fixes #2)

Diffstat

M git-tickets 16 ++++++++++++++--

1 files changed, 14 insertions, 2 deletions


diff --git a/git-tickets b/git-tickets

@@ -26,10 +26,22 @@ filter() {
   26    26 	fi
   27    27 }
   28    28 
   -1    29 filter_state() {
   -1    30 	default_status=false
   -1    31 	if ! [ "$1" = "all" ]; then
   -1    32 		if [ "$1" = "open" ]; then
   -1    33 			files=$(git grep -l "^State: $1$" $files; \
   -1    34 				git grep --files-without-match "^State: ")
   -1    35 		else
   -1    36 			filter "^State: $1$"
   -1    37 		fi
   -1    38 	fi
   -1    39 }
   -1    40 
   29    41 while getopts hs:A:a:p:l:q: flag; do
   30    42 	case "$flag" in
   31    43 		(h) help; exit 0;;
   32    -1 		(s) filter "^State: $OPTARG$"; default_status=false;;
   -1    44 		(s) filter_state "$OPTARG";;
   33    45 		(A) filter "^Author: $OPTARG$";;
   34    46 		(a) filter "^Assigneee: $OPTARG$";;
   35    47 		(p) filter "^From $OPTARG";;
@@ -40,7 +52,7 @@ done
   40    52 shift $(($OPTIND-1))
   41    53 
   42    54 if [ $default_status = true ]; then
   43    -1 	filter "^State: open$"
   -1    55 	filter_state "open"
   44    56 fi
   45    57 
   46    58 for query; do