With Cogito (you can think of it either as alternate Git UI, or as SCM
built on top of Git) you would use
$ cg clone http://server/repo#branch
for example
$ cg clone git://git.kernel.org/pub/scm/git/git.git#next
to clone _single_ branch (in bzr terminology, "heavy checkout" of branch).
But you can also clone _whole_ repository, _all_ published branches with
$ cg clone git://git.kernel.org/pub/scm/git/git.git
With core Git it is the same, but we don't have the above shortcut
for checking only one branch; branches to checkout are in separate
arguments to git-clone.
In bzr it seems that you cannot distinguish (at least not only
from URL) where repository ends and branch begins.
*Sidenote:* In current version of gitweb you can get file
in given repository in given branch using the following
notation:
http://path/to/gitweb.cgi/repo/sitory/branch/name:file/name
gitweb can detect where branch name ends and repository name
begins; usually (by convention) "bare" git repositories uses
<project>.git name, "clothed" git repositories uses
<project>/.git
See also below.
Oh, that explained yet another difference between Bazaar-NG (and other
SCM which uses similar model) and Git.
In Git branch is just a pointer to head (top) commit (hence they are stored
under .git/refs/heads/) in given line of development. Git also stores
information (in .git/HEAD) about which branch we are currently on, which
means on which branch git puts new commits. Nothing more (well, there
can be log of changes to head in .git/logs/refs/heads/ but that is optional
and purely local information). In Bazaar-NG you have to store (if I
understand it correctly) mapping from revnos to revisions.
By default (it means for example default behavior of git-clone, if we don't
use --bare option) git repository is _embedded_ in working area. We have
.git/
.git/HEAD
...
.git/refs/heads/
...
<working area files, e.g.>
So repo/branch wouldn't work, because 'branch' would conflict with working
area files. GIT doesn't follow the CVS model of separate storage area
(CVSROOT) and having only pointer to said area (files in CVS/
subdirectories) in working directory.
In GIT to work on some repository you don't (like from what I understand
in Bazaar-NG) "checkout" some branch (which would automatically copy some
data in case of "heavy checkout" or just save some pointer to repository
in "lightweight checkout" case). You clone whole repository; well you can
select which branches to clone. "Checkout" in GIT terminology means to
populate working area with given version (and change in repository which
branch is current, usually).
How checked out working area looks like in Bazaar-NG?
[...]
Yes, but using Git that way has serious disadvantages. For example
there is only one current branch pointer and only one index (dircache)
per git repository.
So it is way better to use one repository per project, and use alternates
mechanism to save space.
But I agree that saving "old fork" info as separate branch doesn't lead
to that much inefficiency as might be thought.
But after saving "old fork" as a branch revno based revision identifiers
change from http://old.host/old/repo:127 to http://host/repo/old.fork:127
That is maybe minimal change, but this is change!
P.S. In two separate git repositories, even if they exchange information
with each other, the branch names can be different.
--
Jakub Narebski
Poland
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html