VCS comparison table
Johannes Schindelin
Johannes.Schindelin at gmx.de
Tue Oct 17 01:04:52 BST 2006
Hi,
On Tue, 17 Oct 2006, Jakub Narebski wrote:
> Linus Torvalds wrote:
> >>> About "checkouts", i.e. working directories with repository elsewhere:
> >>> you can use GIT_DIR environmental variable or "git --git-dir" option,
> >>> or symlinks, and if Nguyen Thai Ngoc D proposal to have .gitdir/.git
> >>> "symref"-like file to point to repository passes, we can use that.
> >>
> >> It sounds like the .gitdir/.git proposal would give Git "checkouts", by
> >> our meaning of the term.
> >
> > Well, in the git world, it's really just one shared repository that has
> > separate branch-namespaces, and separate working trees (aka "checkouts").
> > So yes, it probably matches what bazaar would call a checkout.
> >
> > Almost nobody seems to actually use it that way in git - it's mostly more
> > efficient to just have five different branches in the same working tree,
> > and switch between them. When you switch between branches in git, git only
> > rewrites the part of your working tree that actually changed, so switching
> > is extremely efficient even with a large repo.
>
> Unless you have branch(es) with totally different contents, like git.git
> 'todo' branch.
But I _do_ work with it! I just don't need to "checkout" it! Example:
git -p cat-file -p todo:TODO
(How about making git-cat be a short cuut to "git -p cat-file -p"?)
> > So there is seldom any real need or reason to actually have multiple
> > checkouts. But it certainly _works_.
>
> But without .git being either symlink, or .git/.gitdir "symref"-link,
> you have to remember what to ser GIT_DIR to, or parameter for --git-dir
> option.
You'd just use alternates for that.
But as Linus mentioned in another email, you mostly can use the _same_
working directory. If you want to work on another branch, which is not all
that different from the current branch (say, you have a bug fix branch on
top of an upstream branch), you just _switch_ to it. Git recognizes those
files which are changed, and updates only these. Therefore, if you have
something like a Makefile system to build the project, you actually save
(compile) time as compared to the multiple-checkout scenario.
I use this system a lot, since I maintain a few bugfixes for a few
projects until the bugfixes are applied upstream. BTW the
multiple-branches-in-one-working-directory workflow was propagated by Jeff
a long time ago, and it really changed my way of working. Thanks, Jeff!
Ciao,
Dscho
More information about the bazaar
mailing list