I think what you are seeing is related to the way that diff handles the meaning
of the tag HEAD.

Like someone mentioned already, diff sees HEAD as being the latest version on
the current branch.

I personally think it still lies.

Say I have file1 that has two revisions 1.1 and 1.2.
There is a branch (BRANCH1) based off of revision 1.1.
Say I check out BRANCH1.

This results in my getting revision 1.1 of file1.

Now I try diffing against HEAD.

cvs diff -r HEAD file1

As stated before, this should give me the difference between my current revision
on the branch (1.1) and the top revision on the branch (also 1.1).

But it doesn't

It actually gives me the diff between 1.2 and 1.1.

Now if I ran

cvs diff -r BRANCH1 file1

I get the correct result.

Seems like a bug to me.

Now back to your situation:

When you are on the TRUNK, you can only do the difference using the branch tag,
so everything works as expected.

When you are on the BRANCH1 some of the files actually have revisions commited
onto the branch, but some of them still only have revisions on the TRUNK.

When you diff against the HEAD tag, the files that don't have revisions on the
branch, the diff follows the TRUNK for those files.  The result is a hybrid diff
of things that have changed on the branch and things that have changed on the
TRUNK.

Hopefully everything made sense.

Shane

"Deever, Chris C." wrote:

> >When you're working on a branch, "HEAD" means the head of the branch,
> >not the head of the trunk, at least for diff.
>
> >-Larry Jones
>
> Please forgive me if I'm not yet on the same page, but I can't seem to fit
> that explanation into my scenario.
>
> The diff from the branch to HEAD *did* report some of the changes, except
> for two changes that happened to be in a file which there are in two
> different copies of the same file located in different parts of the project
> (a shared data structure between client and server).
>
>                     new branch
>                         |
> base line version -> rel tag -> a little more development -> current
>
> The above shows the tree.  When I am in "current" and diff against "new
> branch" I see all of the changes that I expect.  However, when I am in, "new
> branch" and I diff it against HEAD (which I am expecting it to be the latest
> changes comitted in the repository), I see only part of the changes.
>
> Either there is a bug or I'm not understanding something.  Branches do not
> automatically get changes from the trunk, do they?
>
> Regards,
>
> Chris

Reply via email to