[Top][All Lists]

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

Re: cvs diff and added files

From: Derek R. Price
Subject: Re: cvs diff and added files
Date: Thu, 08 Feb 2001 11:40:25 -0500

Karl Fogel wrote:

> "Derek R. Price" <derek.price@openavenue.com> writes:
> > Is there a good reason that 'cvs diff' (with at least unified format) of
> > a repository containing added files creates a file that when run through
> > patch creates the new files at the top level regardless of their
> > original location?
> I think maybe the fix is to invoke "patch -p0"?

Nope.  And in fact, it looks like any file in a subdir is handled

Hmm.  If I use _both_ -p0 and --posix, I can get the patch to apply properly
to files in subdirs, but then my patch won't create files anymore.

According to my patch man page, it appears CVS is relying on some POSIX
behavior which tells patch to read the filename on the 'Index:' line and not
the later 'diff', '---', and '+++' lines.  Unfortunately, my implementation
of patch appears to then ignore created files, though from the man page it
doesn't appear that it is supposed to.

I can correct the problem by editing the diff CVS creates by hand and
inserting the proper subdirs in front of filenames on the 'diff', '---', and
'+++' lines.

     $patch --version
     patch 2.5.4
     Copyright 1984-1988 Larry Wall
     Copyright 1989-1999 Free Software Foundation, Inc.

     This program comes with NO WARRANTY, to the extent permitted by
     You may redistribute copies of this program
     under the terms of the GNU General Public License.
     For more information about these matters, see the file named

     written by Larry Wall and Paul Eggert


Derek Price                      CVS Solutions Architect ( http://CVSHome.org )
mailto:dprice@openavenue.com     OpenAvenue ( http://OpenAvenue.com )
I used to think people were crazy to get tatoos.  Nowadays, I envy
them that clarity of thought.  There was at least one point in their lives
when they thought they knew what they were doing.  They could walk into a
tatoo parlor and say, "I want a big old pig, in red and black, with flames
shooting out of its nose!  And I want it right there!  That's who I am!"

reply via email to

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