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.
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.
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 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,
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
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
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.
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
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.