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

Andy Whitcroft apw at canonical.com
Sun May 3 23:02:26 UTC 2009


On Sat, May 02, 2009 at 05:25:17PM -0700, Brad Figg wrote:
> 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;
> +       }

Why do we suddenly need this this if?

>         $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";

This looks to have some debug in it.

> +                               $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";

and ...

>                                 }
> +                               print "end\n";

and ...
>                         } else {
>                                 $author = $kernel_auth;
>                                 $ignore = 1 if $desc =~ /Merge /;
> -- 

-apw




More information about the kernel-team mailing list