From: Martin Willi Date: Fri, 10 May 2013 16:30:23 +0000 (+0200) Subject: git-issue: fix and speed up issue type lookup X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81ef51d69cab1d09a82b10ddecf03d8ead5ace27;p=thirdparty%2Fstrongswan.git git-issue: fix and speed up issue type lookup --- diff --git a/scripts/git-issue b/scripts/git-issue index 774c904297..a984f1b703 100644 --- a/scripts/git-issue +++ b/scripts/git-issue @@ -116,19 +116,22 @@ get_revstatus () issuetype= get_issuetype () { - issue=$1 - issuetype=`git show -s --format=format:%b "$issue" | \ - grep "^issue-type: " | awk '{print \$2}'` - for commit in `git rev-list --all --all-match \ - --grep "^issue-id: $issue " --grep "^issue-status: " $rev` + local issue=$1 + + # use status of last type update, if any + for update in `git rev-list -n1 --all --all-match \ + --grep "^issue-id: $issue " --grep "^issue-type: "` do - issuetype=`git show -s --format=format:%b $commit | \ - grep "^issue-status: " | awk '{print \$2}'` + issue="$update" done - if [ -z "$issuetype" ] + type=`git show -s --format=format:%b $issue | grep "^issue-type: "` + + if [ -n "$type" ] then - revstatus="unknown" + issuetype=${type:12} + else + issuetype="unknown" fi }