[PATCH 1/1] UBUNTU: SAUCE: Adopt the use of "BugLink:" lines in git commit messages.

Brad Figg brad.figg at canonical.com
Sun May 3 00:25:17 UTC 2009


Tim Gardner wrote:
> Andy Whitcroft wrote:
> 
>> I don't think we are trying to get the latter line into the
>> debian/changelog.  What I thought we were after was the extraction of
>> bug numbers from the git changelog from either of the following forms:
>>
>>     Bug: #123456
>> or
>>     BugLink: http:..../123456
>>
>> But outputing that as just this form for debian/changelog:
>>
>>     - LP: #123456
>>
>> -apw
>>
> 
> That is it in a nutshell. I wish I'd have stated it so clearly to begin 
> with.
> 
> rtg

I believe the attached patch is more in line with what we are after.

diff --git a/debian/scripts/misc/git-ubuntu-log b/debian/scripts/misc/git-ubuntu-log
index 860990c..69f8681 100755
--- a/debian/scripts/misc/git-ubuntu-log
+++ b/debian/scripts/misc/git-ubuntu-log
@@ -70,7 +70,9 @@ sub shortlog_entry($$$$$) {
         $desc =~ s# *UBUNTU: ##g;

         $entry->{'desc'} = $desc;
-       $entry->{'bugno'} = $bug;
+       if ($bug ne '') {
+               $entry->{'bugno'} = $bug;
+       }
         $entry->{'cve'} = $cve;
         $entry->{'commit'} = $commit;
         $entry->{'author'} = $name;
@@ -176,12 +178,25 @@ sub changelog_input {
                         $desc = $1;

                         if ($desc =~ /^ *(Revert "|)UBUNTU:/) {
+                               print "start\n";
+                               $bug = '';
                                 while (<STDIN>) {
-                                       $ignore = 1 if /^ *Ignore: yes/i;
-                                       $bug = $2 if /^ *Bug: *(#|)(.*)/;
-                                       $cve = $1 if /^ *(CVE-.*)/;
+                                       $ignore  =  1 if /^ *Ignore: yes/i;
+                                       if    (/^ *Bug: *(#|)(.*)/i) {
+                                               $bug .= ', ' if $bug ne '';  # 
Comma separates bug #'s
+                                               $bug .= $2;
+                                       }
+                                       elsif (/^ *BugLink: 
*http.*:\/\/.*\/([0-9]+)/i) {
+                                               $bug .= ', ' if $bug ne '';  # 
Comma separates bug #'s
+                                               $bug .= $1;
+                                       }
+                                       elsif (/^ *(CVE-.*)/) {
+                                               $cve = $1
+                                       }
                                         last if /^commit /;
+                                       print "    bug: '$bug'\n";
                                 }
+                               print "end\n";
                         } else {
                                 $author = $kernel_auth;
                                 $ignore = 1 if $desc =~ /Merge /;
-- 
1.6.2.4


-- 
Brad Figg brad.figg at canonical.com http://www.canonical.com




More information about the kernel-team mailing list