diff options
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: |