From 7469fe5db15a470ae91c5de460d8c9ec19fde315 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Sat, 11 May 2013 09:58:51 +0200 Subject: [PATCH] git-issue: get "fixed" status for version having a "issue-fixed" commit --- scripts/git-issue | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 -- 2.47.2