[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
What is HEAD?
From: |
Ming Kin Lai |
Subject: |
What is HEAD? |
Date: |
Sat, 10 Sep 2005 23:55:26 -0700 |
Appendix A-5 of the 1.12.12 version cederqvist says "HEAD refers to the most
recent version available in the repository" when it describes "-r tag".
This is the only place in cerderqvist that has a formal definition of HEAD.
Q1: Are there some versions in the repository that are not available?
Actually I think the use of the word "version" here violates the convention
stipulated in Section 4.2: "To avoid confusion, the word version is almost
never used in this document." (That's not true at all, there are many uses
of the word 'version'.) If I replace the word version with revision, then
the definition will become "HEAD refers to the most recent revision
available in the repository" - well, once a change is committed as a
revision, then it is always available, isn't it? If you are talking about
uncomitted "version", then it will not be in the repository, so the word
'available' seems to be redundant and misleading, does it?
Q2: What does it mean by "the most recent"? In terms of the time the
revision is committed?Suppose I committed revision 1.2 today, and revision
1.1.2.1 on a branch yesterday, so 1.2 is the most recent version and is thus
HEAD?
Q3: Is HEAD dependent on where my working copy is? That is, is it true that
if my working copy is on the trunk (i.e. it is based on a revision on the
trunk), then HEAD refers to the most recent revision the trunk, but if my
working copy is on a branch (i.e. it is based on a revision on the branch),
then HEAD refers to the most recent revision on the branch? See also
questions below.
Appendix A-8 describes "annotate" and says "For each file in files, print
the head revision of the trunk, ..."
Q4: is this "head revision of the trunk" the same as HEAD? So, is there a
"head revision" of each branch? And I assume that "annotate" will not print
the head revision of a branch by default even if my working copy is based on
that branch.
Appendix A-15 sort of defines "the head revision" as "the latest revision on
the trunk". It implies that there is one and only one "head revision" -
that's why it speaks of _the_ head revision. Well, but A-8 implies there
can be many head revisions - one is of the trunk, and also one for each
branch!
Q5: If there are many head revisions, then does HEAD depend on where my
working copy is?
Appendix A-17 appears to suggest that HEAD depends on where my working copy
is, beacuse it speaks of "the current revisions".
Q6: Specifically, suppose I tag revision 1.2 as Root-of-mybranch:
cvs tag Root-of-mybranch
before creating a branch:
cvs tag -b mybranch
And then I make changes and commit them as revision 1.3 (on the trunk).
Now I switch to the branch:
cvs update -r mybranch
and now I am on revision 1.2. OK, but does this "update -r mybranch"
effectively switch me to a branch?
If it does, and assumed that HEAD depends on where my working copy is, that
is, HEAD now should be 1.2, then
cvs diff -r HEAD -r 1.2 file
should output nothing.
If it does not, that is, I am still on the trunk, then HEAD should be 1.3,
and
cvs diff -r HEAD -r 1.2 file
should output the difference between 1.2 and 1.3.
According to my experiment, it output the difference between 1.2 and 1.3.
So, does or does not
cvs update -r mybranch
put me on the branch?
Now, given that I am already on the branch (I think), if I make changes and
commit, the new revision will be 1.2.2.1.
If now I
cvs diff -r HEAD -r 1.2.2.1 file
does CVS output nothing as HEAD now is just 1.2.2.1 or outout the difference
between 1.3 and 1.2.2.1?
Would the situation be any difference if
cvs checkout -r mybranch
?
Incidentally, can anyone be kind enough to clarify A.19.1 of the manual
about "update -r tag[:date]"? The way it is written suggests that there are
two ways to supply valid argumnets to tag and date:
1. give only the value of tag and that value is a revision, e.g. 1.2
2. give both tag and date where tag is a branch tag such as "mybranch".
What happens if I give only tag and tag is a branch tag? (same problem with
the documnetation about checkout)
(By the way, is a Table of Contents deliberately omitted from cederqvist?)
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Re: How to go back to the branch after mistakenly switching to the trunk, Ming Kin Lai, 2005/09/12
Re: How to go back to the branch after mistakenly switching to the trunk, Ming Kin Lai, 2005/09/12
What is HEAD?,
Ming Kin Lai <=
Re: What is HEAD?, Ming Kin Lai, 2005/09/11
Re: What is HEAD?, Ming Kin Lai, 2005/09/11
Re: What is HEAD?, Ming Kin Lai, 2005/09/11