Gentoo Archives: gentoo-portage-dev

From: Alec Warner <antarus@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] repoman commit: Support --bug (-b) and --closes (-c) for git footer
Date: Thu, 03 Aug 2017 16:26:39
Message-Id: CAAr7Pr8a5BUrYe_vUswoncRbFQiNFSsKCLa09eR3Zg4bAyqjBQ@mail.gmail.com
In Reply to: Re: [gentoo-portage-dev] [PATCH] repoman commit: Support --bug (-b) and --closes (-c) for git footer by "Michał Górny"
1 On Thu, Aug 3, 2017 at 12:15 PM, Michał Górny <mgorny@g.o> wrote:
2
3 > On czw, 2017-08-03 at 11:18 -0400, Alec Warner wrote:
4 > > On Thu, Aug 3, 2017 at 10:18 AM, Michał Górny <mgorny@g.o> wrote:
5 > >
6 > > > Support two new options: --bug (-b) and --closes (-c) to add a plain
7 > > > 'Bug' reference and a 'Closes' footer for a GitHub pull request. Both
8 > > > options can be specified multiple times, resulting in multiple footer
9 > > > tags being written.
10 > > >
11 > > > The --bug option accepts either a Gentoo Bugzilla bug number or an URL
12 > > > to any bug tracker. In the latter case, it performs two trivial
13 > > > transformations automatically: replaces long 'show_bug.cgi' Bugzilla
14 > > > URLs with the short 'https://bugs.gentoo.org/NNNNNN', and forces
15 > > > https:// for a few known services.
16 > > >
17 > > > The --closes option accepts either a GitHub Gentoo repository pull
18 > > > request number or an URL to any pull request (or bug) that uses
19 > > > the 'Closes' tag. In the latter case, https:// is forced for a few
20 > known
21 > > > services.
22 > > > ---
23 > > > repoman/pym/repoman/actions.py | 29 +++++++++++++++++++++++++++++
24 > > > repoman/pym/repoman/argparser.py | 16 +++++++++++++++-
25 > > > 2 files changed, 44 insertions(+), 1 deletion(-)
26 > > >
27 > > > diff --git a/repoman/pym/repoman/actions.py
28 > b/repoman/pym/repoman/actions.
29 > > > py
30 > > > index 00bb5b2ca..869ca7031 100644
31 > > > --- a/repoman/pym/repoman/actions.py
32 > > > +++ b/repoman/pym/repoman/actions.py
33 > > > @@ -324,6 +324,11 @@ class Actions(object):
34 > > > return (changes.new, changes.changed, changes.removed,
35 > > > changes.no_expansion,
36 > changes.expansion)
37 > > >
38 > > > + long_bugzilla_url_re = re.compile(
39 > > > + r'https?://bugs\.gentoo\.org/
40 > > > show_bug\.cgi\?id=(\d+(#.*)?)')
41 > > > + http_bugtracker_url_re = re.compile(
42 > > > + r'http://(bugs\.gentoo\.org|
43 > bitbucket\.org|git(hub|lab)\.
44 > > > com)/')
45 > > > +
46 > > >
47 > >
48 > > Would you consider using the urlparse module here, instead of regexp?
49 >
50 > Sure. Just for the second case, or for both?
51 >
52
53 I was actually more concerned about parsing the id query string than the
54 hostname; so I'd say both; but I leave it to your judgement.
55
56 -A
57
58
59 >
60 > --
61 > Best regards,
62 > Michał Górny
63 >