bug-gnulib
[Top][All Lists]
Advanced

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

Re: [Feature request] gitlog-to-changelog: don't cluster multiple Change


From: Joel E. Denny
Subject: Re: [Feature request] gitlog-to-changelog: don't cluster multiple ChangeLog entries under the same "date line"
Date: Tue, 17 Jan 2012 16:33:20 -0500 (EST)
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)

Hi Jim,

On Mon, 26 Dec 2011, Jim Meyering wrote:

> I think the result is an improvement, but it is still not as readable as I
> would like, or maybe it's just not as readable as I am used to ("git log"
> output).  Why? ...  Because when some clumped entries are adjacent to a
> multi-paragraph one, the style dichotomy makes it a little harder to see
> that each of the clumped entries does indeed correspond to its own commit.
> 
> What I guess I'm saying is that I see your point of view.
> If you ever write the patch you want, with some new option,
> I'll probably apply it here.

Below is a patch that adds a --no-cluster option, which I believe does 
what Stefano wants.  I want it too.  OK to push?

>From 46ea4e0437ab93956d06d414eaeb73ccf81b5b90 Mon Sep 17 00:00:00 2001
From: Joel E. Denny <address@hidden>
Date: Tue, 17 Jan 2012 16:23:30 -0500
Subject: [PATCH] gitlog-to-changelog: new option --no-cluster

* build-aux/gitlog-to-changelog: New option --no-cluster, disables
clustering of adjacent commit messages.
---
 ChangeLog                     |    6 ++++++
 build-aux/gitlog-to-changelog |   11 +++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e79e2e0..b225cf1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-17  Joel E. Denny  <address@hidden>
+
+       gitlog-to-changelog: new option --no-cluster
+       * build-aux/gitlog-to-changelog: New option --no-cluster, disables
+       clustering of adjacent commit messages.
+
 2012-01-17  Jim Meyering  <address@hidden>
 
        maint: spell file systems with two words, not one
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index 0efedb0..f59627a 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -3,7 +3,7 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
     if 0;
 # Convert git log output to ChangeLog format.
 
-my $VERSION = '2012-01-06 07:14'; # UTC
+my $VERSION = '2012-01-17 21:21'; # UTC
 # The definition above must lie within the first 8 lines in order
 # for the Emacs time-stamp write hook (at end) to update it.
 # If you change this file with Emacs, please let the write hook
@@ -64,6 +64,10 @@ 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.
+   --no-cluster never cluster commit messages under the same date/author
+                  header; the default is to cluster adjacent commit messages
+                  if their headers are the same and neither commit message
+                  contains multiple paragraphs.
    --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;
@@ -190,6 +194,7 @@ sub parse_amend_file($)
   my $format_string = '%s%n%b%n';
   my $amend_file;
   my $append_dot = 0;
+  my $no_cluster = 0;
   GetOptions
     (
      help => sub { usage 0 },
@@ -198,6 +203,7 @@ sub parse_amend_file($)
      'format=s' => \$format_string,
      'amend=s' => \$amend_file,
      'append-dot' => \$append_dot,
+     'no-cluster' => \$no_cluster,
     ) or usage 1;
 
 
@@ -305,7 +311,8 @@ sub parse_amend_file($)
       # If this header would be different from the previous date/name/email/
       # coauthors header, or if this or the previous entry consists of two
       # or more paragraphs, then print the header.
-      if ($date_line ne $prev_date_line
+      if ($no_cluster
+          or $date_line ne $prev_date_line
           or "@coauthors" ne "@prev_coauthors"
           or $multi_paragraph
           or $prev_multi_paragraph)
-- 
1.7.0.4




reply via email to

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