Gentoo Archives: gentoo-portage-dev

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

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies