[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gitlog-to-changelog and extra blurbs

From: Werner Koch
Subject: gitlog-to-changelog and extra blurbs
Date: Wed, 07 Dec 2011 18:23:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13)


I started to use gitlog-to-changelog for my projects.  However, there is
a little annoying thing: Every so often I like to add longer blurbs to
the git commit log which I don't want to see in a ChangeLog.  Examples
are quotes from discussions, benchmarks or a longer description.

I came up with this little patch which allows me to do this quite
easily.  The marker used are two dashes at the begin of a line (similar
to the mail sig line delimiter).  Given the rules for ChangeLogs, it is
very unlikely that this pattern will ever show up in a real ChangeLog.

Any opinions?

--- a/scripts/gitlog-to-changelog
+++ b/scripts/gitlog-to-changelog
@@ -281,6 +281,15 @@ sub parse_amend_file($)
       @line = grep !/^Signed-off-by: .*>$/, @line;
       @line = grep !/^Co-authored-by: /, @line;
+      # Remove everything after a line with 2 dashes at the beginning.
+      my @tmpline;
+      foreach (@line)
+       {
+         last if /^--\s*$/;
+          push @tmpline,$_;
+        }
+      @line = @tmpline;
       # Remove leading and trailing blank lines.
       if (@line)

I am not sure wether this is elegant perl code, though.



Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]