aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthijs Kooijman <matthijs@stdin.nl>2009-12-17 12:54:23 +0100
committerGuido G√ľnther <agx@sigxcpu.org>2009-12-17 15:44:11 +0100
commit725b9d34b81a1a415ac710458487a78d4f4f4e09 (patch)
tree65c207f50254f49a10de87723440d022deff343b
parente339c701d5c8264df093a15d9db236b710da5f2b (diff)
Add support for a Git-Dch: Ignore metaheader.
Closes: #561346 Thanks: Matthijs Kooijman
-rw-r--r--docs/chapters/releases.sgml18
-rw-r--r--docs/manpages/git-dch.sgml4
-rwxr-xr-xgit-dch12
3 files changed, 30 insertions, 4 deletions
diff --git a/docs/chapters/releases.sgml b/docs/chapters/releases.sgml
index 95c2335..00fb76f 100644
--- a/docs/chapters/releases.sgml
+++ b/docs/chapters/releases.sgml
@@ -115,5 +115,23 @@ via &git-dch;'s <option>--id-length</option> option. Using
</screen>
This makes it much easier to see which commit actually fixed bug #1000.
</para>
+<para>
+Finally, there is the <option>Git-Dch:</option> header that can
+currently only be set to <option>Ignore</option> (or omitted). When this
+header is set to <option>Ignore</option>, the commit message is
+completely ignored and will not be included in the changelog at all.
+This is useful for janitorial commits or other commits that really don't
+need to end up in the changelog.
+
+</para><para>
+For example, the following git commit message
+<screen>
+Set correct branchnames in debian/gbp.conf
+
+Git-Dch: Ignore
+</screen>
+will not show up in the generated changelog in any way.
+</para>
+
</sect1>
</chapter>
diff --git a/docs/manpages/git-dch.sgml b/docs/manpages/git-dch.sgml
index 890df67..4c4a6f7 100644
--- a/docs/manpages/git-dch.sgml
+++ b/docs/manpages/git-dch.sgml
@@ -107,8 +107,8 @@
<varlistentry>
<term><option>--[no-]meta</option></term>
<listitem>
- <para>Parse meta tags like <option>Closes:</option> and
- <option>Thanks:</option>. </para>
+ <para>Parse meta tags like <option>Closes:</option>,
+ <option>Thanks:</option> and <option>Git-Dch:</option>. </para>
</listitem>
</varlistentry>
<varlistentry>
diff --git a/git-dch b/git-dch
index 1051f82..b3ceb59 100755
--- a/git-dch
+++ b/git-dch
@@ -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):