[PATCH] Remove duplicate filenames

From: Simon Josefsson <jas@extundo.com>
Date: Sun Feb 09 2003 - 11:06:13 GMT

Quick'n'dirty patch that replaces entries such as:

        * reference/: libidn-docs.sgml, libidn-docs.sgml:

        Reorder.

with

       * reference/: libidn-docs.sgml:

        Reorder.

Hm, now that I see the entry, I see that it doesn't handle reverting
back to "reference/libidn-docs.sgml" when there is only one filename:

       * reference/libidn-docs.sgml:

        Reorder.

Argh. But when there are more than one file, or if it is in the top
directory, it works. Maybe the second version isn't as bad.

OTOH it would be nice to be able to disable the common_dir stuff, the
colon in the line confuses Emacs' font-lock which makes it highlight
badly. Indeed, this was the reason I chosed to use --separate-header
which is non-standard thing too. OK, I added --no-common-dir (second
patch below) and with it it all looks quite nice even without
--separate-header.

Is cvs2cl a GNU package? Perhaps the defaults should be set up to
generate ChangeLog's according to the FSF Coding Standard. I.e., make
--no-times --no-common-dir the default.

Index: cvs2cl.pl
===================================================================
RCS file: /usr/local/cvs/cvs2cl/cvs2cl.pl,v
retrieving revision 2.46
diff -u -p -u -w -r2.46 cvs2cl.pl
--- cvs2cl.pl 18 Jan 2003 13:14:52 -0000 2.46
+++ cvs2cl.pl 9 Feb 2003 10:51:27 -0000
@@ -1232,9 +1232,13 @@ sub pretty_file_list ()
   # Okay; any qunks that were done according to branch are taken care
   # of, and marked as printed. Now print everyone else.
 
+ my (%dupechecker) = ();
   foreach my $qunkref (@qunkrefs)
   {
     next if (defined ($$qunkref{'printed'})); # skip if already printed
+
+ next if $dupechecker{$$qunkref{'filename'}};
+ $dupechecker{$$qunkref{'filename'}} = 1;
 
     if ($fbegun) {
       $beauty .= ", ";

Index: cvs2cl.pl
===================================================================
RCS file: /usr/local/cvs/cvs2cl/cvs2cl.pl,v
retrieving revision 2.46
diff -u -p -u -w -r2.46 cvs2cl.pl
--- cvs2cl.pl 18 Jan 2003 13:14:52 -0000 2.46
+++ cvs2cl.pl 9 Feb 2003 11:02:56 -0000
@@ -178,6 +178,9 @@ my $Input_From_Stdin = 0;
 # Don't show filenames in output.
 my $Hide_Filenames = 0;
 
+# Don't shorten directory names from filenames.
+my $Common_Dir = 1;
+
 # Max checkin duration. CVS checkin is not atomic, so we may have checkin
 # times that span a range of time. We assume that checkins will last no
 # longer than $Max_Checkin_Duration seconds, and that similarly, no
@@ -1042,7 +1045,7 @@ sub pretty_file_list ()
     # Keep track of whether all the files in this commit were in the
     # same directory, and memorize it if so. We can make the output a
     # little more compact by mentioning the directory only once.
- if ((scalar (@qunkrefs)) > 1)
+ if ($Common_Dir && (scalar (@qunkrefs)) > 1)
     {
       if (! (defined ($common_dir)))
       {
@@ -1731,6 +1738,9 @@ sub parse_options ()
       $Hide_Filenames = 1;
       $After_Header = "";
     }
+ elsif ($arg =~ /^--no-common-dir$/) {
+ $Common_Dir = 0;
+ }
     elsif ($arg =~ /^--ignore-tag$/ ) {
       die "$arg needs argument.\n"
         unless @ARGV;
@@ -1880,6 +1890,7 @@ Options/Arguments:
   --xml Output XML instead of ChangeLog format
   --xml-encoding ENCODING Insert encoding clause in XML header
   --hide-filenames Don't show filenames (ignored for XML output)
+ --no-common-dir Don't shorten directory names from filenames.
   -P, --prune Don't show empty log messages
   -g OPTS, --global-opts OPTS Invoke like this "cvs OPTS log ..."
   -l OPTS, --log-opts OPTS Invoke like this "cvs ... log OPTS"
Received on Sun Feb 9 15:11:00 2003

This archive was generated by hypermail 2.1.8 : Wed Jan 21 2004 - 16:25:34 GMT