diff options
author | Guido Günther <agx@sigxcpu.org> | 2009-12-23 16:37:12 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2009-12-23 20:26:10 +0100 |
commit | d4366123fef2903f2ce4367edae10a1895a5662b (patch) | |
tree | 62b68468cee3ea4a1c8598f57bd0487fe600d7a5 | |
parent | e54b7bf1daca28504463b0b0bb924bd56d45e66b (diff) |
Add body regex filter
Closes: #544238
-rw-r--r-- | docs/manpages/git-dch.sgml | 9 | ||||
-rw-r--r-- | gbp.conf | 2 | ||||
-rw-r--r-- | gbp/config.py | 1 | ||||
-rwxr-xr-x | git-dch | 11 |
4 files changed, 22 insertions, 1 deletions
diff --git a/docs/manpages/git-dch.sgml b/docs/manpages/git-dch.sgml index 4c4a6f7d..c45b5acc 100644 --- a/docs/manpages/git-dch.sgml +++ b/docs/manpages/git-dch.sgml @@ -180,6 +180,15 @@ </listitem> </varlistentry> <varlistentry> + <term><option>--ignore-regex=</option><replaceable>regex</replaceable> + </term> + <listitem> + <para>Ignore commit lines matching <replaceable>regex</replaceable> + when generating the changelog. + </para> + </listitem> + </varlistentry> + <varlistentry> <term><option>--git-author</option> </term> <listitem> @@ -60,4 +60,6 @@ # what tags to look for to generate bug-closing changelog entries #meta-closes = Closes|LP #full = False +#Ignore Signed-off-by: lines: +#ignore-regex=(Signed-off|Acked)-by: diff --git a/gbp/config.py b/gbp/config.py index 8df9d353..fee3665b 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -52,6 +52,7 @@ class GbpOptionParser(OptionParser): 'full' : 'False', 'id-length' : '0', 'git-author' : 'False', + 'ignore-regex' : '', } help = { 'debian-branch': @@ -202,6 +202,11 @@ def parse_commit(repo, commitid, options): bugs = {} bts_closes = re.compile(r'(?P<bts>%s):\s+%s' % (options.meta_closes, bug_r), re.I) + if options.ignore_regex: # Ignore r'' since it matches everything + ignore_re = re.compile(options.ignore_regex) + else: + ignore_re = None + commit = repo.show(commitid) author, email = get_author(commit) if not author: @@ -223,7 +228,9 @@ def parse_commit(repo, commitid, options): else: # normal commit message if msg and not options.full: continue - elif line.strip(): # don't add all whitespace lines + if ignore_re and ignore_re.match(line): + continue + if line.strip(): # don't add all whitespace lines msg += line # start of diff output: elif line.startswith('diff '): @@ -312,6 +319,8 @@ def main(argv): commit_group.add_config_file_option(option_name="id-length", dest="idlen", help="include N digits of the commit id in the changelog entry, default is '%(id-length)s'", type="int", metavar="N") + commit_group.add_config_file_option(option_name="ignore-regex", dest="ignore_regex", + help="Ignore commit lines matching regex, default is '%(ignore-regex)s'") (options, args) = parser.parse_args(argv[1:]) if options.snapshot and options.release: |