diff options
author | Guido Günther <agx@sigxcpu.org> | 2009-08-15 19:13:44 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2009-08-15 19:15:36 +0200 |
commit | 016318eef3c5deeba622de82465fcd5eb7a9fc3f (patch) | |
tree | a8eaa4075d727881fdf4f65de4c16de91a075ef6 | |
parent | 080b1eb0f59091bf5a3ebd180b68839706615fb5 (diff) |
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
-rwxr-xr-x | git-dch | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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 |