aboutsummaryrefslogtreecommitdiffhomepage
path: root/git-dch
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2009-08-15 19:13:44 +0200
committerGuido Günther <agx@sigxcpu.org>2009-08-15 19:15:36 +0200
commit016318eef3c5deeba622de82465fcd5eb7a9fc3f (patch)
treea8eaa4075d727881fdf4f65de4c16de91a075ef6 /git-dch
parent080b1eb0f59091bf5a3ebd180b68839706615fb5 (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
Diffstat (limited to 'git-dch')
-rwxr-xr-xgit-dch9
1 files changed, 6 insertions, 3 deletions
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