Diffs from CVS keyword expansion

9 messages, 6 authors, 2016-08-11 · open the first message on its own page

Diffs from CVS keyword expansion

From: Jon Smirl <hidden>
Date: 2016-08-11 20:19:10

Anyone have a nice script for suppressing diffs caused by CVS keyword
expansion when someone checked the kernel sources into CVS?

I have 200,000 lines of various forms of this mixed in with real changes

It is unclear who checked it into CVS, Microcross or Arch Linux. If it
is Arch Linux finding the source for their 2.6.11.4-1 release would
help a lot. I looked on their web site and couldn't locate it.

I'm starting understand why the support for MX21 on a CSB535FS has
never been added to the mainline.
diff --git a/drivers/char/ftape/lowlevel/ftape-ctl.c
b/drivers/char/ftape/lowlevel/ftape-ctl.c
index 32e0439..ff10633 100644
--- a/drivers/char/ftape/lowlevel/ftape-ctl.c
+++ b/drivers/char/ftape/lowlevel/ftape-ctl.c
@@ -17,9 +17,9 @@
  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

  *
- * $Source: /homes/cvs/ftape-stacked/ftape/lowlevel/ftape-ctl.c,v $
- * $Revision: 1.4 $
- * $Date: 1997/11/11 14:37:44 $
+ * $Source: /home/arch-linux/{cvs}/linux--dev--2.6/drivers/char/ftape/lowlevel/ftape-ctl.c,v
$
+ * $Revision: 1.1.1.1 $
+ * $Date: 2005/03/24 06:16:39 $
  *
  *      This file contains the non-read/write ftape functions for the
  *      QIC-40/80/3010/3020 floppy-tape driver "ftape" for Linux.
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c
b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 63c8168..54d9a10 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -29,7 +29,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  *
- * $Id: ipoib_main.c 1377 2004-12-23 19:57:12Z roland $
+ * $Id: ipoib_main.c,v 1.1.1.1 2005/03/24 06:16:41 arch-linux Exp $
  */

 #include "ipoib.h"
-- 
Jon Smirl

Re: Diffs from CVS keyword expansion

From: Randal L. Schwartz <hidden>
Date: 2016-08-11 19:43:05

quoted
quoted
quoted
quoted
"Uwe" == Uwe Kleine-Koenig [off-list ref] writes:
Uwe> One thing I don't like about both scripts is, that the timestamp of
Uwe> a file changes with that, even if there are no changes.  Anyone knows
Uwe> another predefined variable/trick that doesn't hurt performance (and
Uwe> readability) too much?

You have to do two passes, or a pass-and-a-half, and do the rename/rewrite
based on whether anything changed.

"Just a few more lines of code." :)  If it's really important, I can
be coaxed to dig it up.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[off-list ref] <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.

Re: Diffs from CVS keyword expansion

From: Jon Smirl <hidden>
Date: 2016-08-11 19:51:55

On 12/1/06, Linus Torvalds [off-list ref] wrote:

On Fri, 1 Dec 2006, Juergen Ruehle wrote:
quoted
Jon Smirl writes:
 > Anyone have a nice script for suppressing diffs caused by CVS keyword
 > expansion when someone checked the kernel sources into CVS?

I usually just say (with GNU diff)

  diff -I $$ ...

which is crude, but should be enough to get rid of the hunks listed by
you.

You might also want -x CVS if you have the metadata files.
I don't have the original CVS, just a tarball snapshot with the
keywords expanded.

I'm working with the Freescale iMX21 and the Linux port for it has
never be added to the mainline kernel. I am extracting bits and pieces
of it from various vendor tarballs.

Also, if you are actually _using_ CVS to check it out, use

        cvs co -ko

I think, to not check out with keyword expansion at all.

(Also usable with "cvs diff -ko", I think)

                Linus

PS. Clueless user alert: I have happily not used CVS in years and years,
and I might remember that all wrong.

-- 
Jon Smirl

Re: Diffs from CVS keyword expansion

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-08-11 20:04:01


On Fri, 1 Dec 2006, Juergen Ruehle wrote:
Jon Smirl writes:
 > Anyone have a nice script for suppressing diffs caused by CVS keyword
 > expansion when someone checked the kernel sources into CVS?

I usually just say (with GNU diff)

  diff -I $$ ...

which is crude, but should be enough to get rid of the hunks listed by
you.

You might also want -x CVS if you have the metadata files.
Also, if you are actually _using_ CVS to check it out, use

	cvs co -ko

I think, to not check out with keyword expansion at all.

(Also usable with "cvs diff -ko", I think)

		Linus

PS. Clueless user alert: I have happily not used CVS in years and years, 

Re: Diffs from CVS keyword expansion

From: Uwe Kleine-Koenig <hidden>
Date: 2016-08-11 20:13:37

Hi,

Johannes Schindelin wrote:
On Tue, 5 Dec 2006, Randal L. Schwartz wrote:
quoted
quoted
quoted
quoted
quoted
quoted
"Uwe" == Uwe Kleine-Koenig [off-list ref] writes:
Uwe> 	#! /bin/sh
Uwe> 	exec perl -i -p -e 's/\$(Id|Revision):.*?\$/\$$1: \$/' "$@";

Ow.  My eyes hurt from that.  How about we rewrite that as a native Perl
script:
I don't like that either, just because it's Perl :-)
quoted
    #!/usr/bin/perl
    $^I = ""; # this is -i
    while (<>) {
      s/\$(Id|Revision):.*?\$/\$$1: \$/;
      print;
    }
Hey, that's better! All of a sudden, I understand everything!
I'm not fluent in Perl, and didn't know $^I.  Actually, that's better,
yes.  (And my script is already rewritten.)

One thing I don't like about both scripts is, that the timestamp of
a file changes with that, even if there are no changes.  Anyone knows
another predefined variable/trick that doesn't hurt performance (and
readability) too much?

timtowtdi
Uwe

-- 
Uwe Kleine-Koenig

Re: Diffs from CVS keyword expansion

From: Johannes Schindelin <hidden>
Date: 2016-08-11 20:19:49

Hi,

On Tue, 5 Dec 2006, Randal L. Schwartz wrote:
quoted
quoted
quoted
quoted
quoted
"Uwe" == Uwe Kleine-Koenig [off-list ref] writes:
Uwe> 	#! /bin/sh
Uwe> 	exec perl -i -p -e 's/\$(Id|Revision):.*?\$/\$$1: \$/' "$@";

Ow.  My eyes hurt from that.  How about we rewrite that as a native Perl
script:

    #!/usr/bin/perl
    $^I = ""; # this is -i
    while (<>) {
      s/\$(Id|Revision):.*?\$/\$$1: \$/;
      print;
    }
Hey, that's better! All of a sudden, I understand everything!

Not,
Dscho

Re: Diffs from CVS keyword expansion

From: Randal L. Schwartz <hidden>
Date: 2016-08-11 20:37:32

quoted
quoted
quoted
quoted
"Uwe" == Uwe Kleine-Koenig [off-list ref] writes:
Uwe> 	#! /bin/sh
Uwe> 	exec perl -i -p -e 's/\$(Id|Revision):.*?\$/\$$1: \$/' "$@";

Ow.  My eyes hurt from that.  How about we rewrite that as a native Perl
script:

    #!/usr/bin/perl
    $^I = ""; # this is -i
    while (<>) {
      s/\$(Id|Revision):.*?\$/\$$1: \$/;
      print;
    }

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[off-list ref] <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.

Re: Diffs from CVS keyword expansion

From: Uwe Kleine-Koenig <hidden>
Date: 2016-08-11 20:40:28

Hello Jon,

Jon Smirl wrote:
Anyone have a nice script for suppressing diffs caused by CVS keyword
expansion when someone checked the kernel sources into CVS?
I have a little script (called rmcvsid) in my private path, that just
wraps a Perl oneliner:

	#! /bin/sh
	exec perl -i -p -e 's/\$(Id|Revision):.*?\$/\$$1: \$/' "$@";

This edits inplace all cvs keywords to be not expanded.  If you call it
for all files *before* you throw them into git, you don't need to
suppress the diffs, because there are none.

You may have to add Source, Date and maybe others.

HTH
Uwe

-- 
Uwe Kleine-Koenig

Re: Diffs from CVS keyword expansion

From: Juergen Ruehle <hidden>
Date: 2016-08-11 20:40:55

Jon Smirl writes:
 > Anyone have a nice script for suppressing diffs caused by CVS keyword
 > expansion when someone checked the kernel sources into CVS?

I usually just say (with GNU diff)

  diff -I $$ ...

which is crude, but should be enough to get rid of the hunks listed by
you.

You might also want -x CVS if you have the metadata files.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help