On 2015-08-13 08:13, Rich Freeman wrote:
> On Thu, Aug 13, 2015 at 7:19 AM, Ben de Groot <yng...@gentoo.org> wrote:
> > I vote for a simple
> >
> > Bug: 333531
> >
> > If it is going to be any longer than that, then you need to make sure
> > it is part of the commit message template magic. Because I'm surely
> > not the only one who is lazy and thus averse to typing anything longer
> > for the most common use case: Gentoo bugs.
> >
> 
> ++ laziness
> 
> I don't mind it being a URL, but stick the header in the template (way
> easier to delete it than to type it),
> 
> If it is a URL, please make it whatever is already in my browser
> address bar.  A nice shorthand URL looks pretty but it isn't so pretty
> if I have to edit it instead of just hitting copy/paste.  When I'm
> fixing bugs I have the bug open in a browser already, since the next
> step after committing the fix is going to be closing the bug.
> 
> Otherwise, I really don't care.  "Bug" gets the job done.  I haven't
> seen any recent proposals that include the "X-" but that is one thing
> I'd definitely avoid per the RFC.
> 
> -- 
> Rich
> 

I'm for just a simple "Bug:" line with b.g.o URL being optional.

 - Implies b.g.o
     Bug: 123456
 - Equivalent to multiple lines for implied b.g.o
     Bug: 123456,654321
 - explicit b.g.o
     Bug: https://bugs.gentoo.org/123456
     Bug: https://bugs.gentoo.org/show_bug.cgi?id=123456
 - external bug reference
     Bug: https://bugs.debian.org/123456

There'd be no option to concatenate multiple external bug references on the
same line.

Really there's no difference between an explicit b.g.o bug reference and
an external bug reference.

Tools can easily parse the 3 different forms. If the string after "Bug:
" starts with http:// or https://, it's a URL, else it's a list of
Gentoo bug numbers separated by commas.

    if ($line =~ m|^Bug: (https?://.+)|i) {
        fetch $1
    } elsif ($line =~ m|^Bug:|i) {
        $line =~ s/^Bug: //i;
        $line =~ s/\s+//g;
        my @nums = split /,/, $line;
        fetch_from_bgo $_ for @nums;
    }

Yes, URLs may change, but what really matters is that the reference is
valid when it's made. There are projects who have not only changed URLs,
but bug tracking systems, and have just decided to restart on the bug
count because they weren't able to or couldn't be bothered to make a
proper transfer. In short: Bug numbers are as immutable as
URLs. Fortunately, it's a rare occurrence that we shouldn't worry about.

- Aaron

Attachment: signature.asc
Description: Digital signature

Reply via email to