]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
git-issue: get "fixed" status for version having a "issue-fixed" commit issue-tracking
authorMartin Willi <martin@revosec.ch>
Sat, 11 May 2013 07:58:51 +0000 (09:58 +0200)
committerMartin Willi <martin@revosec.ch>
Sat, 11 May 2013 08:21:05 +0000 (10:21 +0200)
scripts/git-issue

index 25dc7095c6f6b4b9b0c5a250d77fe65189a6f3f2..e23e02c49486ff21a00b6b4d19efc296ac817f51 100644 (file)
@@ -85,9 +85,31 @@ get_revstatus ()
 {
        local stat
        local aff
+       local fixed
        local issue=$1
        local rev=$2
+
+       # check for issue-fixed: keyword first
+       for update in $(git rev-list -n1 --all-match $rev \
+                                       --grep "^issue-id: $issue" --grep "^issue-fixed: ")
+       do
+               issue="$update"
+       done
+
+       fixed=$(git show -s --format=format:%b $issue | grep "^issue-fixed: ")
+       for fix in ${fixed:13}
+       do
+               # it has been fixed, check if that fix is in target revision
+               fix=$(git rev-list "$rev" | grep "^$fix")
+               if [ -n "$fix" ]
+               then
+                       revstatus="fixed"
+                       return
+               fi
+       done
+
        # check if opened at given revision
+       issue=$1
        local revs=$(git rev-list "$rev" | grep "^$issue")
        if [ -n "$revs" ]
        then