diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2009-12-17 12:54:23 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2009-12-17 15:44:11 +0100 |
commit | 725b9d34b81a1a415ac710458487a78d4f4f4e09 (patch) | |
tree | 65c207f50254f49a10de87723440d022deff343b /git-dch | |
parent | e339c701d5c8264df093a15d9db236b710da5f2b (diff) |
Add support for a Git-Dch: Ignore metaheader.
Closes: #561346
Thanks: Matthijs Kooijman
Diffstat (limited to 'git-dch')
-rwxr-xr-x | git-dch | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -198,6 +198,7 @@ def parse_commit(repo, commitid, options): msg = '' thanks = '' closes = '' + git_dch = '' bugs = {} bts_closes = re.compile(r'(?P<bts>%s):\s+%s' % (options.meta_closes, bug_r), re.I) @@ -217,6 +218,8 @@ def parse_commit(repo, commitid, options): bugs[m.group('bts')] = bug_nums elif line.startswith('Thanks: '): thanks = line.split(' ', 1)[1].strip() + elif line.startswith('Git-Dch: '): + git_dch = line.split(' ', 1)[1].strip() else: # normal commit message if msg and not options.full: continue @@ -226,6 +229,8 @@ def parse_commit(repo, commitid, options): elif line.startswith('diff '): break if options.meta: + if git_dch == 'Ignore': + return None for bts in bugs: closes += '(%s: %s) ' % (bts, ', '.join(bugs[bts])) if thanks: @@ -241,8 +246,11 @@ def shortlog_to_dch(repo, commits, options): author = 'Unknown' for commit in commits: - msg, (author, email) = parse_commit(repo, commit, options) - add_changelog_entry(msg, author, email) + parsed = parse_commit(repo, commit, options) + # Allow commits to be ignored. + if parsed: + msg, (author, email) = parsed + add_changelog_entry(msg, author, email) def guess_snapshot_commit(cp, repo, options): |