[git-buildpackage] [PATCH master] gbp-dch: allow bug number format to be overridden
Jonathan Toppins
jtoppins at cumulusnetworks.com
Wed Aug 26 17:14:04 CEST 2015
On 08/26/2015 03:31 AM, Guido Günther wrote:
> Hi,
>
> Thanks for the patch.
>
> On Mon, Aug 24, 2015 at 10:35:52AM -0400, Jonathan Toppins wrote:
>> Some derivatives and non Debian exclusive projects don't use just
>> numbers for their bug numbers. gbp-dch should still be able to parse
>> these bug numbers and generate useful changelog entries. This doesn't
>> solve dpkg-parsechangelog but is a start.
>>
>> Examples of non-Debian bug numbers are:
>> example change header
>>
>> Example: EX-12345
>>
>> Should produce the following change log:
>> * example change header (Example: EX-12345)
>>
>> This also helps in pulling CVE numbers simply by letting the user
>> modify the regex to something like 'cve-\d+-\d+'.
>
> This is basically fine but
> * --meta-bugnumfmt is a strange name, we don't usually have a "fmt" at
> the end (e.g. --meta-closes instead of --meta-closes-fmt. What about
> --meta-closes-bugnum ? It's a but long but is builds a relation to the
> --meta-closes tag ?
Completely agree, the bugnumfmt was just the first thing that came to
mind. Will change to "--meta-closes-bugnum" if that is preferred.
> * Please add some tests. This is getting complex enough to warrant
> e.g. some doctests in a separate file.
Willing to write some tests, I must confess I have not read all
documentation, is there a readme that explains how to run the tests? Is
there an example test that I can borrow from for writing my tests? My
current testing so far has been with a personal repository that has
various bug number formats in it and I have been running over that.
>
> Some minor nits inline below
>
>>
>> Signed-off-by: Jonathan Toppins <jtoppins at cumulusnetworks.com>
>> ---
>> Note: please keep me on the CC list as I am not subscribed to the mailing list.
>>
>> debian/git-buildpackage.zsh-completion | 2 ++
>> docs/manpages/gbp-dch.sgml | 13 +++++++++++++
>> gbp.conf | 2 ++
>> gbp/config.py | 3 +++
>> gbp/dch.py | 7 ++-----
>> gbp/scripts/dch.py | 1 +
>> 6 files changed, 23 insertions(+), 5 deletions(-)
>>
>> diff --git a/docs/manpages/gbp-dch.sgml b/docs/manpages/gbp-dch.sgml
>> index 888d987..8e02c50 100644
>> --- a/docs/manpages/gbp-dch.sgml
>> +++ b/docs/manpages/gbp-dch.sgml
>> @@ -46,6 +46,7 @@
>> <arg><option>--[no-]full</option></arg>
>> <arg><option>--[no-]meta</option></arg>
>> <arg><option>--meta-closes=bug-close-tags</option></arg>
>> + <arg><option>--meta-bugnumfmt=bug-number-format</option></arg>
>> <arg><option>--snapshot-number=</option><replaceable>expression</replaceable></arg>
>> <arg><option>--id-length=</option><replaceable>number</replaceable></arg>
>> <arg><option>--git-log=</option><replaceable>git-log-options</replaceable></arg>
>> @@ -183,6 +184,18 @@
>> </listitem>
>> </varlistentry>
>> <varlistentry>
>> + <term><option>--meta-bugnumfmt=</option><replaceable>bug-number-format</replaceable>
>> + </term>
>> + <listitem>
>> + <para>
>> + What regular expression should be used for parse out the bug number.
>
> s/for/to/
Ack
>
>> + The default is '(?:bug|issue)?\#?\s?\d+'. Note: the regex should
>> + suppress all portions of the bug number that are not wanted using
>> + "(?:)", see pyhton regex manual for details.
>
> Please give an example here.
Ack
Thanks for the feedback.
-Jon
More information about the git-buildpackage
mailing list