From d4366123fef2903f2ce4367edae10a1895a5662b Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Wed, 23 Dec 2009 16:37:12 +0100 Subject: Add body regex filter Closes: #544238 --- git-dch | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'git-dch') diff --git a/git-dch b/git-dch index 57b508a6..7f762428 100755 --- a/git-dch +++ b/git-dch @@ -202,6 +202,11 @@ def parse_commit(repo, commitid, options): bugs = {} bts_closes = re.compile(r'(?P%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: -- cgit v1.2.3