This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Producing CVS diffs
- To: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Subject: Re: Producing CVS diffs
- From: Andi Kleen <ak at muc dot de>
- Date: 21 Mar 1998 04:00:02 +0100
- Cc: egcs at cygnus dot com
- References: <199803190732.IAA02051@mira.isdn.cs.tu-berlin.de>
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