bug-gnulib
[Top][All Lists]
Advanced

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

HOWTO: track '(tiny change)' in gitlog-to-changelog generated ChangeLog


From: Gary V . Vaughan
Subject: HOWTO: track '(tiny change)' in gitlog-to-changelog generated ChangeLog
Date: Thu, 17 Nov 2011 18:31:31 +0700

In future, I hope anyone searching for how to track '(tiny change)' commits in
GNU projects with gitlog-to-changelog will be able to find this post rather than
us collectively ending up with several home-grown incompatible solutions spread
throughout various projects.  If you arrived here from the future, then before
reading any further, please check that gnulib doesn't have equivalent 
functionality
already applied by then.  If it does, then please use that instead of patching.

Otherwise, in order to correctly keep track of '(tiny change)' annotations, you
can write 'Copyright-paper-work-exempt: Yes' on a line of its own in your git
commit log wherever that commit should generate a matching '(tiny change)'
annotation in the generated ChangeLog file.

But first you should add the following patch to your project as
`gl/build-aux/gitlog-to-changelog.diff' (or similar) and make sure you are
calling gnulib-tool with `--local-dir=gl' in it's arguments.

If you also want to add back any '(tiny change)'s that you lost when moving to
gitlog-to-changelog, once you have the patch below installed, you can use
the --amend=build-aux/git-log-fix option to add the git log annotations thus:

build-aux/git-log-fix:
    1ea9302bd1eadf25b466fcd7e8697e4bef111493
    # Add back missing annotation:          
    s,$,\nCopyright-paperwork-exempt: Yes,  

--- gnulib/build-aux/gitlog-to-changelog        2011-11-17 12:22:02.000000000 
+0700
+++ gl/build-aux/gitlog-to-changelog    2011-11-17 12:19:01.000000000 +0700
@@ -251,6 +251,11 @@
 
       my $date_line = sprintf "%s  $2\n", strftime ("%F", localtime ($1));
 
+      # Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog
+      # `(tiny change)' annotation.
+      my $tiny_change = grep /^Copyright-paperwork-exempt:\s+[Yy]es$/, @line;
+      $date_line =~ s/$/  (tiny change)/ if $tiny_change;
+
       # Format 'Co-authored-by: A U Thor <address@hidden>' lines in
       # standard multi-author ChangeLog format.
       my @coauthors = grep /^Co-authored-by:.*$/, @line;
@@ -277,9 +282,10 @@
       $prev_date_line = $date_line;
       @prev_coauthors = @coauthors;
 
-      # Omit "Co-authored-by..." and "Signed-off-by..." lines.
+      # Omit meta-data lines we've already interpreted.
       @line = grep !/^Signed-off-by: .*>$/, @line;
       @line = grep !/^Co-authored-by: /, @line;
+      @line = grep !/^Copyright-paperwork-exempt: /, @line;
 
       # Remove leading and trailing blank lines.
       if (@line)

If the patch above doesn't apply cleanly any more, then libtool maintains an
up-to-date copy in its own git repo, and that should still be available from 
here
(even if you are from the future, as long as it's not too far from now anyway):

  
http://git.savannah.gnu.org/cgit/libtool.git/plain/gl/build-aux/gitlog-to-changelog.diff

In the worst case, you might need to figure out what SHA1 revision of gnulib
libtool is using for its gnulib submodule, and use the same version.

HTH,
-- 
Gary V. Vaughan (gary AT gnu DOT org)


reply via email to

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