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 /git-dch | |
parent | e54b7bf1daca28504463b0b0bb924bd56d45e66b (diff) |
Add body regex filter
Closes: #544238
Diffstat (limited to 'git-dch')
-rwxr-xr-x | git-dch | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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: |