public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Producing CVS diffs
@ 1998-03-19  9:48 Martin von Loewis
  1998-03-21 13:50 ` Raja R Harinath
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Martin von Loewis @ 1998-03-19  9:48 UTC (permalink / raw)
  To: egcs

How can I produce diffs against the CVS tree that work well with patch?
When I do 'cvs -z9 diff -u' in the gcc directory, I get headers that
look like

Index: cp/tree.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/tree.c,v
retrieving revision 1.25
diff -u -p -r1.25 tree.c
--- tree.c	1998/03/12 00:29:16	1.25
+++ tree.c	1998/03/17 20:57:57

Now, when applying those in the gcc directory with patch 2.5,
patch thinks this is against tree.c, not cp/tree.c, and fails.
How can I get it to accept this patch, or how can I produce a
patch that it will accept?

Martin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Producing CVS diffs
  1998-03-19  9:48 Producing CVS diffs Martin von Loewis
  1998-03-21 13:50 ` Raja R Harinath
  1998-03-21 13:50 ` Alexandre Oliva
@ 1998-03-21 13:50 ` Andi Kleen
  2 siblings, 0 replies; 5+ messages in thread
From: Andi Kleen @ 1998-03-21 13:50 UTC (permalink / raw)
  To: Martin von Loewis; +Cc: egcs

Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de> writes:

> How can I produce diffs against the CVS tree that work well with patch?
> When I do 'cvs -z9 diff -u' in the gcc directory, I get headers that
> look like
> 
> Index: cp/tree.c
> ===================================================================
> RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/tree.c,v
> retrieving revision 1.25
> diff -u -p -r1.25 tree.c
> --- tree.c	1998/03/12 00:29:16	1.25
> +++ tree.c	1998/03/17 20:57:57

I always use a short perl script for this. 

#!/usr/bin/perl -p

if (/^RCS.*cvsfiles\/(.*),v/) { $path=$1; }
if (/^\+\+\+/ || /^\-\-\-/) { s/(...) [^ ]+(.*)/$1 $path $2/; }
if (/^diff/) { s/ [^ ]+$/ $path\n/; }
if (/^\?/) { $_=""; }


-Andi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Producing CVS diffs
  1998-03-19  9:48 Producing CVS diffs Martin von Loewis
@ 1998-03-21 13:50 ` Raja R Harinath
  1998-03-21 13:50 ` Alexandre Oliva
  1998-03-21 13:50 ` Andi Kleen
  2 siblings, 0 replies; 5+ messages in thread
From: Raja R Harinath @ 1998-03-21 13:50 UTC (permalink / raw)
  To: egcs

Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de> writes:
> How can I produce diffs against the CVS tree that work well with patch?
> When I do 'cvs -z9 diff -u' in the gcc directory, I get headers that
> look like
> 
> Index: cp/tree.c
> ===================================================================
> RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/tree.c,v
> retrieving revision 1.25
> diff -u -p -r1.25 tree.c
> --- tree.c	1998/03/12 00:29:16	1.25
> +++ tree.c	1998/03/17 20:57:57
> 
> Now, when applying those in the gcc directory with patch 2.5,
> patch thinks this is against tree.c, not cp/tree.c, and fails.
> How can I get it to accept this patch, or how can I produce a
> patch that it will accept?

The patch(1) man page for patch 2.5 says that this patch should apply in
its POSIX compatible mode (i.e. 

	$ env POSIXLY_CORRECT=y patch < new.diff

Beta versions of `patch' also have the --posix option).

- Hari
-- 
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Producing CVS diffs
  1998-03-19  9:48 Producing CVS diffs Martin von Loewis
  1998-03-21 13:50 ` Raja R Harinath
@ 1998-03-21 13:50 ` Alexandre Oliva
  1998-03-23 16:39   ` Martin von Loewis
  1998-03-21 13:50 ` Andi Kleen
  2 siblings, 1 reply; 5+ messages in thread
From: Alexandre Oliva @ 1998-03-21 13:50 UTC (permalink / raw)
  To: Martin von Loewis; +Cc: egcs

Martin von Loewis writes:

> How can I produce diffs against the CVS tree that work well with patch?

AFAIK, you can't change this.  Instead, you must set the
POSIXLY_CORRECT environment variable when you call patch, so that it
does not disregard the `Index:' entry.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Producing CVS diffs
  1998-03-21 13:50 ` Alexandre Oliva
@ 1998-03-23 16:39   ` Martin von Loewis
  0 siblings, 0 replies; 5+ messages in thread
From: Martin von Loewis @ 1998-03-23 16:39 UTC (permalink / raw)
  To: oliva; +Cc: egcs

> > How can I produce diffs against the CVS tree that work well with patch?
> 
> AFAIK, you can't change this.  Instead, you must set the
> POSIXLY_CORRECT environment variable when you call patch, so that it
> does not disregard the `Index:' entry.

Unfortunately, this doesn't help. According to patch(1), patch builds
a triple (old, new, index), and choses the first matching if
POSIXLY_CORRECT is set, and the best matching otherwise. So, I get
the triple (tree.c, tree.c, cp/tree.c). When applied to the gcc directory,
it choses tree.c, which fails.

NB: This is for patch 2.5.

There is the -L option to CVS diff, but it doesn't quite have the
effect I want.

Regards,
Martin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1998-03-23 16:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-19  9:48 Producing CVS diffs Martin von Loewis
1998-03-21 13:50 ` Raja R Harinath
1998-03-21 13:50 ` Alexandre Oliva
1998-03-23 16:39   ` Martin von Loewis
1998-03-21 13:50 ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).