aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Guenther <agx@sigxcpu.org>2008-05-16 14:19:42 +0200
committerGuido Guenther <agx@sigxcpu.org>2008-05-16 14:22:43 +0200
commitce152d4078c0fc93845865cadda816c7c9ebabe4 (patch)
tree958e646c75fdb5ec284ee39542b303dc6b9ba45b
parent6886317f1b81e9a20ae4d57b8942bec65c4233e7 (diff)
include the commit id in the changelog entry
-rw-r--r--docs/chapters/releases.sgml11
-rw-r--r--docs/manpages/git-dch.sgml9
-rw-r--r--gbp.conf2
-rw-r--r--gbp/config.py1
-rwxr-xr-xgit-dch5
5 files changed, 26 insertions, 2 deletions
diff --git a/docs/chapters/releases.sgml b/docs/chapters/releases.sgml
index 4e1874b4..1130d1d3 100644
--- a/docs/chapters/releases.sgml
+++ b/docs/chapters/releases.sgml
@@ -93,9 +93,18 @@ Thanks: cool upstream
</screen>
would result in a changelog entry
<screen>
- * New upstream version (Closes: #1000) - thanks to cool upstream
+ * New upstream version (Closes: #1000) - thanks to cool upstream
</screen>
You can use multiple <option>Closes:</option> tags.
+</para><para>
+Often changelog entries correspond to a single &git; commit. In this case it's
+convenient to include the commit id in the chagenlog entry. This can be done
+via the <option>--id-length</option> option. Using
+<option>--id-length</option>=<replaceable>7</replaceable> would change the above example to:
+<screen>
+ * [571bfd4] New upstream version (Closes: #1000) - thanks to cool upstream
+</screen>
+This makes it much easier to see which commit actually fixed bug #1000.
</para>
</sect1>
</chapter>
diff --git a/docs/manpages/git-dch.sgml b/docs/manpages/git-dch.sgml
index acc2e5c8..727eabf2 100644
--- a/docs/manpages/git-dch.sgml
+++ b/docs/manpages/git-dch.sgml
@@ -144,6 +144,15 @@
<para>options passed on verbatim to git-log(1)</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--id-length=</option><replaceable>N</replaceable>
+ </term>
+ <listitem>
+ <para>include <replaceable>N</replaceable> digits of the commit id in
+ the changelog enty. Default is to not include any commit ids at
+ all.</para>
+ </listitem>
+ </varlistentry>
</variablelist>
</refsect1>
<refsect1>
diff --git a/gbp.conf b/gbp.conf
index 9acdc4d7..29561a2c 100644
--- a/gbp.conf
+++ b/gbp.conf
@@ -44,4 +44,4 @@
[git-dch]
#git-log = --no-merges
#snapshot-number = snapshot + 1
-
+#id-length = 0
diff --git a/gbp/config.py b/gbp/config.py
index 2cc98b1e..8f672e92 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -41,6 +41,7 @@ class GbpOptionParser(OptionParser):
'tarball-dir' : '',
'ignore-new' : 'False',
'meta' : 'False',
+ 'id-length' : '0',
}
config_files = [ '/etc/git-buildpackage/gbp.conf',
os.path.expanduser('~/.gbp.conf'),
diff --git a/git-dch b/git-dch
index a46805a3..147c9b36 100755
--- a/git-dch
+++ b/git-dch
@@ -182,6 +182,8 @@ def parse_commit(repo, commitid, options):
if thanks:
thanks = ' - thanks to %s' % thanks
msg += closes + thanks
+ if options.idlen:
+ msg = "[%s] " % commitid[0:options.idlen] + msg
return msg, (author, email)
@@ -231,6 +233,9 @@ def main(argv):
help="parse meta tags in commit messages, default is '%(meta)s'", action="store_true")
parser.add_option("--full", action="store_false", dest="short", default=True,
help="include the full commit message")
+ parser.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")
(options, args) = parser.parse_args(argv[1:])
if options.snapshot and options.release: