[kernel-team] 42/47: Add --bug option to add bug URLs to the patch header

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Mon Dec 21 00:30:52 UTC 2015


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch master
in repository kernel-team.

commit 251042e65d6116c95b59563931c1141d2a4811c1
Author: Ben Hutchings <benh at debian.org>
Date:   Sun May 17 18:53:53 2015 +0000

    Add --bug option to add bug URLs to the patch header
    
    svn path=/people/benh/; revision=22654
---
 scripts/benh/git-format-patch-for-debian | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/scripts/benh/git-format-patch-for-debian b/scripts/benh/git-format-patch-for-debian
index 9e69fba..2272c7f 100755
--- a/scripts/benh/git-format-patch-for-debian
+++ b/scripts/benh/git-format-patch-for-debian
@@ -19,6 +19,7 @@
 set -e
 
 unset GIT_URL_BASE
+export BUG_URL_LIST=
 
 while [ $# -ge 1 ]; do
     case "$1" in
@@ -51,6 +52,22 @@ while [ $# -ge 1 ]; do
 	    export GIT_URL_BASE=
 	    shift 1
 	    ;;
+	--bug)
+	    case "$2" in
+		http*://*)
+		    bug_url="$2"
+		    ;;
+		[0-9]*)
+		    bug_url="https://bugs.debian.org/$2"
+		    ;;
+		*)
+		    echo >&2 "E: Bug '$2' not recognised as URL or number"
+		    exit 2
+		    ;;
+	    esac
+	    BUG_URL_LIST="$BUG_URL_LIST $bug_url"
+	    shift 2
+	    ;;
 	*)
 	    break
 	    ;;
@@ -66,13 +83,21 @@ fi
 git format-patch --subject-prefix='' "$@" | while read name; do
     printf '%s\n' "$name"
     mv "$name" "$name".orig
-    awk 'FNR == 1 { hash = $2 }
+    awk 'BEGIN { split(ENVIRON["BUG_URL_LIST"], bug_urls) }
+FNR == 1 { hash = $2 }
 /^$/ && hash != "" {
     if (ENVIRON["GIT_URL_BASE"] != "") {
         print "Origin: " ENVIRON["GIT_URL_BASE"] hash
     } else {
         print "Forwarded: no"
     }
+    for (i in bug_urls) {
+       if (match(bug_urls[i], "^https?://bugs\\.debian\\.org/")) {
+           print "Bug-Debian: " bug_urls[i]
+       } else {
+           print "Bug: " bug_urls[i]
+       }
+    }
     hash = ""
 }
 FNR > 1 { print }' \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/kernel-team.git



More information about the Kernel-svn-changes mailing list