[ 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;  <[EMAIL PROTECTED]>;  <[EMAIL PROTECTED]>;  <[EMAIL PROTECTED]>
Planix, Inc. <[EMAIL PROTECTED]>; VE3TCP; Secrets of the Weird <[EMAIL PROTECTED]>

_______________________________________________
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs

Reply via email to