aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2009-12-23 16:37:12 +0100
committerGuido Günther <agx@sigxcpu.org>2009-12-23 20:26:10 +0100
commitd4366123fef2903f2ce4367edae10a1895a5662b (patch)
tree62b68468cee3ea4a1c8598f57bd0487fe600d7a5
parente54b7bf1daca28504463b0b0bb924bd56d45e66b (diff)
Add body regex filter
Closes: #544238
-rw-r--r--docs/manpages/git-dch.sgml9
-rw-r--r--gbp.conf2
-rw-r--r--gbp/config.py1
-rwxr-xr-xgit-dch11
4 files changed, 22 insertions, 1 deletions
diff --git a/docs/manpages/git-dch.sgml b/docs/manpages/git-dch.sgml
index 4c4a6f7..c45b5ac 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>
diff --git a/gbp.conf b/gbp.conf
index f68b043..277348d 100644
--- a/gbp.conf
+++ b/gbp.conf
@@ -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 8df9d35..fee3665 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':
diff --git a/git-dch b/git-dch
index 57b508a..7f76242 100755
--- a/git-dch
+++ b/git-dch
@@ -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: