info-cvs
[Top][All Lists]
Advanced

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

Re: Applying diff's from one file to another, similar file?


From: Greg A. address@hidden (Greg A. Woods)
Subject: Re: Applying diff's from one file to another, similar file?
Date: Fri, 31 Aug 2001 15:04:31 -0400 (EDT)

[ On Friday, August 31, 2001 at 09:51:29 (-0700), Dennis Jones wrote: ]
> Subject: Applying diff's from one file to another, similar file?
>
> Is there a way to apply diff's from one file to a similar file in a
> different directory?

        cvs diff file1 | (cd ../otherdir; patch file2)

> For example, if I have a file that is duplicated in multiple directories
> with the exception of some minor differences, and I make a change to one of
> the files, those same changes need to be replicated on all of the other
> files.  Replicating the changes by hand is time-consuming and error-prone,
> and gets old after awhile.

You'd be FAR better off by storing just one common shared source file in
your CVS repository and some mechanism in your build system to manage
the variances between those files at build time.

Such a mechanism might be a preprocessor of sorts, such as 'cpp', 'm4',
'sed', 'awk', 'perl', 'python', 'ruby',, or even 'cobolscript' [;-) for
the latter!]

-- 
                                                        Greg A. Woods

+1 416 218-0098      VE3TCP      <address@hidden>     <address@hidden>
Planix, Inc. <address@hidden>;   Secrets of the Weird <address@hidden>



reply via email to

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