From: Martin Willi Date: Sat, 11 May 2013 07:58:51 +0000 (+0200) Subject: git-issue: get "fixed" status for version having a "issue-fixed" commit X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Fissue-tracking;p=thirdparty%2Fstrongswan.git git-issue: get "fixed" status for version having a "issue-fixed" commit --- diff --git a/scripts/git-issue b/scripts/git-issue index 25dc7095c6..e23e02c494 100644 --- a/scripts/git-issue +++ b/scripts/git-issue @@ -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