Michael Richardson wrote:

> I was reading your patch to try and understand why .trunk is needed... 
>>>>> "Stephen" == Stephen Cameron [EMAIL PROTECTED] writes:
    [..].
    Stephen> + 
    Stephen> + CAUTION: the special tag `HEAD' is interpreted by
    Stephen> + the `cvs diff' command in a different way than it
    [...portion of patch deleted...]

Actually, the latest version of my patch 
(which you can get here 
http://www.geocities.com/dotslashstar/branch_patch.html )
reads a bit differently in that area now:

+ 
+ 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.  You should use either
+ `.trunk' or the branch tag name rather than `HEAD'.  
+ (The `.trunk' tag acts as a branch tag name for the trunk.)
+ 

(And I verified just now that that is in fact how "cvs diff"
behaves.  I don't know why it's so hard for me to remember
these precise nature of the weirdness with HEAD. )

>  This seems very strange behaviour for diff, and I now understand why 
> you might want to diff against .trunk. But why does diff work that way?

Beats me.  But there are some strange test cases in sanity.sh with
some bewildering comments involving "cvs diff -r HEAD"...

Like this:
-------------
         # With a branch sticky tag, HEAD is the head of the trunk.
          dotest head-br1-setup "${testcvs} -q update -r br1" "[UP] file1"
          dotest head-br1-update "${testcvs} -q update -r HEAD -p file1" \
"imported contents
add a line on trunk
add a line on trunk after trunktag"
          # But diff thinks that HEAD is "br1".  Case (b) from cvs.texinfo.
          # Probably people are relying on it.
          dotest head-br1-diff "${testcvs} -q diff -c -r HEAD -r br1" ""

          # With a nonbranch sticky tag on a branch,
          # HEAD is the head of the trunk
          dotest head-brtag-setup "${testcvs} -q update -r brtag" "[UP]
file1"
          dotest head-brtag-update "${testcvs} -q update -r HEAD -p file1" \
"imported contents
add a line on trunk
add a line on trunk after trunktag"

          # CVS 1.9 and older thought that HEAD is "brtag" (this was
          # noted as "strange, maybe accidental").  But "br1" makes a
          # whole lot more sense
-------


Reply via email to