Closes: #561346
Thanks: Matthijs Kooijman
---
 docs/chapters/releases.sgml |   18 ++++++++++++++++++
 docs/manpages/git-dch.sgml  |    4 ++--
 git-dch                     |   12 ++++++++++--
 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):
-- 
1.6.5.4




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to