From aa95fbee0a83f20112ffa88d168c7be24a7815f1 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 28 Oct 2006 20:23:11 +0200 Subject: [PATCH] further update-changelog fixes --- ChangeLog | 35 ++++++++++++++++++---------- buildscripts/git-update-changelog.py | 35 +++++++++++++++++++--------- 2 files changed, 47 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index b976014405..f3571a1ec1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,14 +1,26 @@ 2006-10-28 Han-Wen Nienhuys - git commit 122da86232bb745d50cddbd893e3cc48c3af6216 + git commit 64179afe25bf5723fe9bb5a6631799c050d12de2 + + * buildscripts/git-update-changelog.py: + ignore ChangeLog + + git commit 614460c52e72c96824da0a583297123e510f6fff * .gitignore: - new file. + update - git commit 914e47b38f98b87c2622a5bbd8237ca97f97da34 + git commit 6ca40e8913957dd9fa510855ae1c4efacde09603 - * stepmake/stepmake/generic-targets.make: - create .gitignore in outdir. + * ChangeLog: + * buildscripts/git-update-changelog.py: + script to update ChangeLog with Git messages. + + git commit ef70710d3cf52502900408aa1f55a2354ed4e8ab + + * lily/beam-engraver.cc: + * input/regression/rest-pitched-beam.ly: + don't set callback if staff-position set. Fixes #126. git commit 6dcaa230251aa4f95e4153bd4de021c65207b798 @@ -26,16 +38,15 @@ * lily/tie.cc: internal_get_property_data() using ly_symbol2scm() - git commit ef70710d3cf52502900408aa1f55a2354ed4e8ab + git commit 914e47b38f98b87c2622a5bbd8237ca97f97da34 - * lily/beam-engraver.cc: - * input/regression/rest-pitched-beam.ly: - don't set callback if staff-position set. Fixes #126. + * stepmake/stepmake/generic-targets.make: + create .gitignore in outdir. - git commit fb790ec731ff4c252248457dd5b438412f735577 + git commit 122da86232bb745d50cddbd893e3cc48c3af6216 - * ChangeLog: - nitpick. + * .gitignore: + new file. * stepmake/bin/add-html-footer.py (compose): remove setgcos diff --git a/buildscripts/git-update-changelog.py b/buildscripts/git-update-changelog.py index c24f13d381..a2c3e5356e 100644 --- a/buildscripts/git-update-changelog.py +++ b/buildscripts/git-update-changelog.py @@ -5,6 +5,10 @@ import os import re import optparse +def read_pipe (x): + print 'pipe', x + return os.popen (x).read () + class Commit: def __init__ (self, dict): for v in ('message', @@ -29,7 +33,7 @@ class Commit: files.append (x.group (1)) return '' - diff = os.popen ('git show %s' % self.committish).read () + diff = read_pipe ('git show %s' % self.committish) re.sub ('\n--- a/([^\n]+)\n', note_file, diff) re.sub('\n--- /dev/null\n\\+\\+\\+ b/([^\n]+)', @@ -38,6 +42,8 @@ class Commit: return files def parse_commit_log (log): + print log + committish = re.search ('^([^\n]+)', log).group (1) author = re.search ('\nAuthor:\s+([^\n]+)', log).group (1) date_match = re.search ('\nDate:\s+([^\n]+)', log) @@ -51,12 +57,17 @@ def parse_commit_log (log): return c def parse_add_changes (from_commit): - log = os.popen ('git log %(from_commit)s..' % locals ()).read () + + log = read_pipe ('git log %(from_commit)s..' % locals ()) log = log[len ('commit '):] - commits = map (parse_commit_log, re.split ('\ncommit ', log)) - commits.reverse () + log = log.strip () + if not log: + return [] + + commits = map (parse_commit_log, re.split ('\ncommit ', log)) + return commits @@ -75,10 +86,10 @@ def changelog_body (commit): return s def find_last_checked_in_commit (log): - m = re.search (r'^(\d+-\d+\d+)[^\n]+\n*\t\*git commit ([a-f0-9]+):', log) - + m = re.match ('^(\\d+-\\d+-\\d+)[^\n]+\n*\tgit commit ([a-f0-9]+)', log) + if m: - return (m.group (0), m.group (1)) + return (m.group (1), m.group (2)) return None @@ -98,17 +109,19 @@ def main (): log = open ('ChangeLog').read () if not options.start: - options.start = find_last_checked_in_commit (log) + (time, id) = find_last_checked_in_commit (log) + options.start = id + + print 'processing commits from ', id, options.start commits = parse_add_changes (options.start) if not commits: return - new_log = '' last_commit = None - first = header (commits[0]) + first = header (commits[0]) + '\n' if first == log[:len (first)]: log = log[len (first):] @@ -131,7 +144,7 @@ def main (): try: os.unlink ('ChangeLog~') except IOError: - passa + pass os.rename ('ChangeLog', 'ChangeLog~') open ('ChangeLog', 'w').write (log) -- 2.39.2