info-cvs
[Top][All Lists]
Advanced

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

RE: Diffing previous revision


From: Greg A. Woods
Subject: RE: Diffing previous revision
Date: Thu, 30 May 2002 12:43:05 -0400 (EDT)

[ On Thursday, May 30, 2002 at 09:17:05 (-0500), Vince Rice wrote: ]
> Subject: RE: Diffing previous revision
>
> > I would say "cvs status" is a much shorter and quicker way to find the
> > current revision number of a given file.
> 
> Yes, but it is the previous revision number I need, not the current.

I do the subtraction in my head, but an awk script would easily be able
to do some simple field splitting before it does the arithmetic to find
the previous revision number.

> Yes, I've thought about writing a perl script to do the log/diff (again, I
> need the previous revision, not the current one).  I guess that's what I'll
> do; I just thought I'd see if I was the only one that wants to do this on a
> regular basis.  And perhaps I am. :)

No need to invoke the bulk and overhead of perl for such a trivial bit
of string manipulation and arithmetic!  ;-)

        cvs diff -r $(cvs status file.c | awk '$1 == "Working" {print $3}') 
file.c

I'll leave the matter of doing the field splitting and arithmetic as an
"exercise for the reader"....  :-)

-- 
                                                                Greg A. Woods

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



reply via email to

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