[Top][All Lists]

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

RE: can't grok cvs diff

From: Cameron, Steve
Subject: RE: can't grok cvs diff
Date: Wed, 18 Jul 2001 09:22:45 -0500

address@hidden wrote:

> Hello.
> Can someone explain me, how can I get the diff between current branch
> and the HEAD.
> I've tried to use symbolic tags but it doesn't work. Why?
> $ cvs diff -r 1.83 -r lib/pc_int.lua|wc
>    417    1461    9793
> $ cvs diff -r HEAD -r REL-2_0-fixes lib/pc_int.lua|wc
>       0       0       0

"cvs diff" treats the "HEAD" pseudo-tag differently than every
other CVS command for some reason.

I documented this difference of "cvs diff" in my ".trunk + .origin"
CVS patch, and it's mentioned (and tested for) in as well.

+CAUTION: the special tag `HEAD' is interpreted by
+the `cvs diff' command in a different way than it
+is interpreted by any other cvs command.  `cvs diff'
+takes `-r HEAD' to mean the following, as nearly as
+I can tell:
+For `cvs diff', `HEAD' means the most recent revision
+on the `current branch' (taking into account whatever
+sticky tags are active in your working directory) unless
+a particular file has not had a revision committed to the
+branch, in which case the head revision of the trunk is
+taken.  This is clearly wrong in most cases.  You 
+should use either `.trunk' or the branch tag name rather 
+than `HEAD', unless you specifically want the strange
+behavior of `HEAD'.  (The `.trunk' tag acts as a branch tag 
+name for the trunk.)

The ".trunk" tag referred to above is a pseudo tag my patch
introduces which acts exactly like a branch tag, except
it means the trunk.

the patch can be found here, if you are interested:

With my patch you could do:

$ cvs diff -r .trunk -r REL-2_0-fixes lib/pc_int.lua|wc

and get what you want.  There may be another way without
the patch, provided you haven't ever manually changed 
revision numbers with "cvs commit -r", (or via RCS if
your repository was migrated from RCS)  I can't recall
the specifics but I think it might be:

cvs diff -r1 -r REL-2_0-fixes lib/pc_int.lua

I'm not sure about that though, there's some trick you
can do with the numbers, maybe someone else will be
kind enough to spell it out.

Hope it helps.

-- steve

reply via email to

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