1 |
On 2015-08-13 08:13, Rich Freeman wrote: |
2 |
> On Thu, Aug 13, 2015 at 7:19 AM, Ben de Groot <yngwin@g.o> wrote: |
3 |
> > I vote for a simple |
4 |
> > |
5 |
> > Bug: 333531 |
6 |
> > |
7 |
> > If it is going to be any longer than that, then you need to make sure |
8 |
> > it is part of the commit message template magic. Because I'm surely |
9 |
> > not the only one who is lazy and thus averse to typing anything longer |
10 |
> > for the most common use case: Gentoo bugs. |
11 |
> > |
12 |
> |
13 |
> ++ laziness |
14 |
> |
15 |
> I don't mind it being a URL, but stick the header in the template (way |
16 |
> easier to delete it than to type it), |
17 |
> |
18 |
> If it is a URL, please make it whatever is already in my browser |
19 |
> address bar. A nice shorthand URL looks pretty but it isn't so pretty |
20 |
> if I have to edit it instead of just hitting copy/paste. When I'm |
21 |
> fixing bugs I have the bug open in a browser already, since the next |
22 |
> step after committing the fix is going to be closing the bug. |
23 |
> |
24 |
> Otherwise, I really don't care. "Bug" gets the job done. I haven't |
25 |
> seen any recent proposals that include the "X-" but that is one thing |
26 |
> I'd definitely avoid per the RFC. |
27 |
> |
28 |
> -- |
29 |
> Rich |
30 |
> |
31 |
|
32 |
I'm for just a simple "Bug:" line with b.g.o URL being optional. |
33 |
|
34 |
- Implies b.g.o |
35 |
Bug: 123456 |
36 |
- Equivalent to multiple lines for implied b.g.o |
37 |
Bug: 123456,654321 |
38 |
- explicit b.g.o |
39 |
Bug: https://bugs.gentoo.org/123456 |
40 |
Bug: https://bugs.gentoo.org/show_bug.cgi?id=123456 |
41 |
- external bug reference |
42 |
Bug: https://bugs.debian.org/123456 |
43 |
|
44 |
There'd be no option to concatenate multiple external bug references on the |
45 |
same line. |
46 |
|
47 |
Really there's no difference between an explicit b.g.o bug reference and |
48 |
an external bug reference. |
49 |
|
50 |
Tools can easily parse the 3 different forms. If the string after "Bug: |
51 |
" starts with http:// or https://, it's a URL, else it's a list of |
52 |
Gentoo bug numbers separated by commas. |
53 |
|
54 |
if ($line =~ m|^Bug: (https?://.+)|i) { |
55 |
fetch $1 |
56 |
} elsif ($line =~ m|^Bug:|i) { |
57 |
$line =~ s/^Bug: //i; |
58 |
$line =~ s/\s+//g; |
59 |
my @nums = split /,/, $line; |
60 |
fetch_from_bgo $_ for @nums; |
61 |
} |
62 |
|
63 |
Yes, URLs may change, but what really matters is that the reference is |
64 |
valid when it's made. There are projects who have not only changed URLs, |
65 |
but bug tracking systems, and have just decided to restart on the bug |
66 |
count because they weren't able to or couldn't be bothered to make a |
67 |
proper transfer. In short: Bug numbers are as immutable as |
68 |
URLs. Fortunately, it's a rare occurrence that we shouldn't worry about. |
69 |
|
70 |
- Aaron |