Update gitlog-to-changelog.
authorWerner Koch <wk@gnupg.org>
Tue, 10 Jan 2012 10:25:23 +0000 (11:25 +0100)
committerWerner Koch <wk@gnupg.org>
Tue, 10 Jan 2012 10:25:23 +0000 (11:25 +0100)
* scripts/gitlog-to-changelog: Update from gnupg master.
* Makefile.am (gen-ChangeLog): Add new options.
* scripts/autogen.sh: Fix typo in URL.  Reported by Gilles Espinasse.

Makefile.am
scripts/autogen.sh
scripts/gitlog-to-changelog

index 09ed58a..144c16a 100644 (file)
@@ -75,10 +75,10 @@ gen-ChangeLog:
        if test -d $(top_srcdir)/.git; then                             \
          (cd $(top_srcdir) &&                                          \
            ./scripts/gitlog-to-changelog                               \
+           --append-dot --tear-off                                     \
            --amend=scripts/git-log-fix                                 \
            --since=$(gen_start_date) ) > $(distdir)/cl-t;              \
           cat $(top_srcdir)/scripts/git-log-footer >> $(distdir)/cl-t;  \
          rm -f $(distdir)/ChangeLog;                                   \
          mv $(distdir)/cl-t $(distdir)/ChangeLog;                      \
        fi
-
index c58afbf..408f760 100755 (executable)
@@ -268,7 +268,7 @@ if [ -d .git ]; then
     cat <<EOF >&2
 *** Activating trailing whitespace git pre-commit hook. ***
     For more information see this thread:
-      http://mail.gnome.org/archives/desktop-devel-list/2009-May/msg00084html
+      http://mail.gnome.org/archives/desktop-devel-list/2009-May/msg00084.html
     To deactivate this pre-commit hook again move .git/hooks/pre-commit
     and .git/hooks/pre-commit.sample out of the way.
 EOF
index 40a8035..d9f594f 100755 (executable)
@@ -64,6 +64,7 @@ OPTIONS:
                   makes a change to SHA1's commit log text or metadata.
    --append-dot append a dot to the first line of each commit message if
                   there is no other punctuation or blank at the end.
+   --tear-off   tear off all commit log lines after a '--' line.
    --since=DATE convert only the logs since DATE;
                   the default is to convert all log entries.
    --format=FMT set format string for commit subject and body;
@@ -175,6 +176,7 @@ sub parse_amend_file($)
   my $format_string = '%s%n%b%n';
   my $amend_file;
   my $append_dot = 0;
+  my $tear_off = 0;
   GetOptions
     (
      help => sub { usage 0 },
@@ -183,6 +185,7 @@ sub parse_amend_file($)
      'format=s' => \$format_string,
      'amend=s' => \$amend_file,
      'append-dot' => \$append_dot,
+     'tear-off' => \$tear_off,
     ) or usage 1;
 
 
@@ -281,6 +284,18 @@ 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.
+      if ($tear_off)
+        {
+           my @tmpline;
+           foreach (@line)
+             {
+              last if /^--\s*$/;
+               push @tmpline,$_;
+             }
+           @line = @tmpline;
+        }
+
       # Remove leading and trailing blank lines.
       if (@line)
         {