From 016318eef3c5deeba622de82465fcd5eb7a9fc3f Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sat, 15 Aug 2009 19:13:44 +0200 Subject: use the last commit in which debian/changelog was touched as starting point if no snapshot header was found. This can still be overriden by using --since. Based on a patch by Felipe Sateler. Closes: #511269 --- git-dch | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'git-dch') diff --git a/git-dch b/git-dch index e8fd8a55..36acd18b 100755 --- a/git-dch +++ b/git-dch @@ -244,12 +244,15 @@ def shortlog_to_dch(repo, commits, options): add_changelog_entry(msg, author, email) -def guess_snapshot_commit(cp): +def guess_snapshot_commit(cp, repo): """guess the last commit documented in the changelog from the snapshot banner""" sr = re.search(snapshot_re, cp['Changes']) if sr: return sr.group('commit') - + last = repo.commits(paths="debian/changelog", options=["-1"]) + if last: + print "Changelog last touched at %s" % last + return last[0] def main(argv): @@ -325,7 +328,7 @@ def main(argv): else: since = '' if options.auto: - since = guess_snapshot_commit(cp) + since = guess_snapshot_commit(cp, repo) if since: print "Continuing from commit '%s'" % since found_snapshot_header = True -- cgit v1.2.3