threads / discuss / 23996

How do I ignore the changes made by CVS keyword substitution efficiently?

Subject: How do I ignore the changes made by CVS keyword substitution efficiently?

## tl;dr

4 messages between Jun 3, 2010 and Jun 4, 2010.

replies: 3people: 3as markdown or json

Lin Mac· Jun 3, 2010, 19:13 UTC · lore
Hi,

I'm merging kernel from others, and they used CVS to manage their code, and so do some part of linux kernel. Unfortunatly CVS would substitude the keywords in the source, result in unecessary changes in the code, like the one in the following diff. In fact, there are around 1174 of CVS keywords in the kernel source. I don't want those useless changes to get into my tree.

Currently I use the attached scripts to as a basic filter, which could filter out 1-line changes by CVS keyword in a patch. But I still have to handle other cases (multi-line changes, $Log, which would result in log of latest commit) myself.

Do you have better idea to get this task done?
diff --git a/kernels/linux-2.6.31.1-cavm1/Documentation/cris/README
b/kernels/linux-2.6.31.1-cavm1/Documentation/cris/README
index d9b0868..c7bb74b 100644
--- a/kernels/linux-2.6.31.1-cavm1/Documentation/cris/README
+++ b/kernels/linux-2.6.31.1-cavm1/Documentation/cris/README
@@ -1,6 +1,6 @@
 Linux 2.4 on the CRIS architecture
 ==================================
-$Id: README,v 1.7 2001/04/19 12:38:32 bjornw Exp $
+$Id: README,v 1.1 2010-05-14 09:47:54 XXXXXXXX Exp $

 This is a port of Linux 2.4 to Axis Communications ETRAX 100LX embedded
 network CPU. For more information about CRIS and ETRAX please see further
@@ -103,7 +103,7 @@ block: queued sectors max/low 9109kB/3036kB, 64
slots per queue
 ETRAX 100LX 10/100MBit ethernet v2.0 (c) 2000 Axis Communications AB
 eth0 initialized
 eth0: changed MAC to 00:40:8C:CD:00:00
-ETRAX 100LX serial-driver $Revision: 1.7 $, (c) 2000 Axis Communications AB
+ETRAX 100LX serial-driver $Revision: 1.1 $, (c) 2000 Axis Communications AB
 ttyS0 at 0xb0000060 is a builtin UART with DMA
 ttyS1 at 0xb0000068 is a builtin UART with DMA
 ttyS2 at 0xb0000070 is a builtin UART with DMA
@@ -133,7 +133,7 @@ Default gateway is 10.13.9.1
 Hostname is bbox1
 Telnetd starting, using port 23.
   using /bin/sash as shell.
-sftpd[15]: sftpd $Revision: 1.7 $ starting up
+sftpd[15]: sftpd $Revision: 1.1 $ starting up
Kyle McMartin· Jun 3, 2010, 19:35 UTC · re: Lin Mac · lore

Re: How do I ignore the changes made by CVS keyword substitution efficiently?

On Fri, Jun 04, 2010 at 03:13:29AM +0800, Lin Mac wrote:
Show 6 quoted lines
> I'm merging kernel from others, and they used CVS to manage their
> code, and so do some part of linux kernel. Unfortunatly CVS would
> substitude the keywords in the source, result in unecessary changes in
> the code, like the one in the following diff. In fact, there are
> around 1174 of CVS keywords in the kernel source. I don't want those
> useless changes to get into my tree.

You want the -ko option to cvs checkout/update which will use the original keywords from the import.

regards, Kyle
Lin Mac· Jun 3, 2010, 19:50 UTC · re: Kyle McMartin · lore

Re: How do I ignore the changes made by CVS keyword substitution efficiently?

2010/6/4 Kyle McMartin <kyle@mcmartin.ca>:
> You want the -ko option to cvs checkout/update which will use the
> original keywords from the import.

Yes, that could be done. But usually it would be faster if I could solve it myself than asking them to release again.

Best Regards, Mac Lin.

Steven Michalske· Jun 4, 2010, 07:13 UTC · re: Lin Mac · lore

Re: How do I ignore the changes made by CVS keyword substitution efficiently?

Look into the git attributes and filters, make a clean command that strips out the cvs/svn keywords.

On Jun 3, 2010, at 12:13 PM, Lin Mac wrote:
Show 50 quoted lines
> Hi,
>
> I'm merging kernel from others, and they used CVS to manage their
> code, and so do some part of linux kernel. Unfortunatly CVS would
> substitude the keywords in the source, result in unecessary changes in
> the code, like the one in the following diff. In fact, there are
> around 1174 of CVS keywords in the kernel source. I don't want those
> useless changes to get into my tree.
>
> Currently I use the attached scripts to as a basic filter, which could
> filter out 1-line changes by CVS keyword in a patch. But I still have
> to handle other cases (multi-line changes, $Log, which would result in
> log of latest commit) myself.
>
> Do you have better idea to get this task done?
>
> diff --git a/kernels/linux-2.6.31.1-cavm1/Documentation/cris/README
> b/kernels/linux-2.6.31.1-cavm1/Documentation/cris/README
> index d9b0868..c7bb74b 100644
> --- a/kernels/linux-2.6.31.1-cavm1/Documentation/cris/README
> +++ b/kernels/linux-2.6.31.1-cavm1/Documentation/cris/README
> @@ -1,6 +1,6 @@
> Linux 2.4 on the CRIS architecture
> ==================================
> -$Id: README,v 1.7 2001/04/19 12:38:32 bjornw Exp $
> +$Id: README,v 1.1 2010-05-14 09:47:54 XXXXXXXX Exp $
>
> This is a port of Linux 2.4 to Axis Communications ETRAX 100LX  
> embedded
> network CPU. For more information about CRIS and ETRAX please see  
> further
> @@ -103,7 +103,7 @@ block: queued sectors max/low 9109kB/3036kB, 64
> slots per queue
> ETRAX 100LX 10/100MBit ethernet v2.0 (c) 2000 Axis Communications AB
> eth0 initialized
> eth0: changed MAC to 00:40:8C:CD:00:00
> -ETRAX 100LX serial-driver $Revision: 1.7 $, (c) 2000 Axis  
> Communications AB
> +ETRAX 100LX serial-driver $Revision: 1.1 $, (c) 2000 Axis  
> Communications AB
> ttyS0 at 0xb0000060 is a builtin UART with DMA
> ttyS1 at 0xb0000068 is a builtin UART with DMA
> ttyS2 at 0xb0000070 is a builtin UART with DMA
> @@ -133,7 +133,7 @@ Default gateway is 10.13.9.1
> Hostname is bbox1
> Telnetd starting, using port 23.
>   using /bin/sash as shell.
> -sftpd[15]: sftpd $Revision: 1.7 $ starting up
> +sftpd[15]: sftpd $Revision: 1.1 $ starting up
> <undo-cvs-tag-one-line-chage.pl><refine.sh>

← back to recent threads