Package: git-buildpackage
Version: 0.4.41
Severity: wishlist
Tags: patch

When using git-dch, there is always an UNRELEASED "change" line. I think
it is not useful, so the following patch omits it.
Known issue: if the person using git-dch hasn't commited any changes,
then there will be an empty line added for him/her. Previous behavior
would have added an UNRELEASED instead of an empty one, so I don't
consider it a problem.


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages git-buildpackage depends on:
ii  devscripts                   2.10.40     scripts to make the life of a Debi
ii  git-core                     1:1.5.6.5-1 fast, scalable, distributed revisi
ii  python                       2.5.2-3     An interactive high-level object-o
ii  python-dateutil              1.4.1-2     powerful extensions to the standar
ii  python-support               0.8.7       automated rebuilding support for P

git-buildpackage recommends no packages.

Versions of packages git-buildpackage suggests:
pn  git-load-dirs                 <none>     (no description available)
ii  pristine-tar                  0.17       regenerate pristine tarballs

-- no debconf information
>From e670e93c7d985f6e36b682a14c55f1ff35f3b61b Mon Sep 17 00:00:00 2001
From: Felipe Sateler <[EMAIL PROTECTED]>
Date: Wed, 12 Nov 2008 00:04:13 -0300
Subject: [PATCH] Don't include first UNRELEASED line

---
 git-dch |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/git-dch b/git-dch
index f043166..e42162a 100755
--- a/git-dch
+++ b/git-dch
@@ -50,13 +50,18 @@ def add_changelog_entry(msg, author, email):
     system(cmd)
 
 
-def add_changelog_section(msg, distribution, newversion=None):
+def add_changelog_section(msg, distribution, newversion=None, author=None, 
email=None):
     "add a new changelog section"
     if newversion:
         versionopt = '--newversion=%s' % newversion
     else:
         versionopt = '-i'
-    cmd = "dch --no-auto-nmu --distribution=%s %s %s" % (distribution, 
versionopt, msg)
+
+    if author and email:
+        env = """DEBFULLNAME="%s" DEBEMAIL="%s" """ % (author, email)
+    else:
+        env = ""
+    cmd = "%s dch --no-auto-nmu --distribution=%s %s %s" % (env, distribution, 
versionopt, msg)
     system(cmd)
 
 
@@ -319,7 +324,15 @@ def main(argv):
             add_section = False
 
         if add_section:
-            add_changelog_section(distribution="UNRELEASED", msg="UNRELEASED", 
newversion=options.new_version)
+            if commits:
+                first_commit = commits[0]
+                commits = commits[1:]
+                commit_msg, (commit_author, commit_email) = parse_commit(repo, 
first_commit, options)
+            else:
+                commit_msg = "UNRELEASED"
+                commit_author = None
+                commit_email = None
+            add_changelog_section(distribution="UNRELEASED", msg=commit_msg, 
newversion=options.new_version, author=commit_author, email=commit_email)
 
         if commits:
             shortlog_to_dch(repo, commits, options)
-- 
1.5.6.5

Reply via email to