From: "Shawn O. Pearce" <spearce@spearce.org>
To: Alex Riesen <raa.lkml@gmail.com>, Bill Priest <priestwilliaml@yahoo.com>
Cc: git@vger.kernel.org
Subject: Re: How to have multiple working copy directories use the same repository?
Date: Thu, 11 Oct 2007 23:52:19 -0400 [thread overview]
Message-ID: <20071012035219.GB27899@spearce.org> (raw)
In-Reply-To: <20071011190025.GC2804@steel.home>
Alex Riesen <raa.lkml@gmail.com> wrote:
> Bill Priest, Thu, Oct 11, 2007 20:10:50 +0200:
> > I've looked at the "git for CVS users" section in
> > the docs and this appears to create two repositories.
> > Is there a way to have two working directories that
> > utilize the same repository?
>
> Look for "alternates" in git's documentation. But read all the
> warnings regarding git-gc and git-prune. Make a note of ".keep" files.
Really I think Bill wants the contrib/workdir/git-new-workdir script.
Its downside is that it makes heavy use of symlinks under the
.git directory for the secondary working directories, and you do
have to watch out for committing changes to a branch when more
than one working directory has that branch as its current branch.
But otherwise it works very well for this use case.
Also you may get a few warnings from your HEAD reflog saying objects
no longer exist when you do a git-gc within a working directory.
This can happen for example if you use `git rebase -i` in a working
directory a few times and then later run git-gc from a different
working directory. But since its just intermediate rebase state
its probably not that big of a deal to have it go missing.
You shouldn't run `git gc --prune` if any of the working directories
has staged but uncommitted changes in them. Such changes are held
in the working directory's index, which will not be considered
as reachable (as it isn't visible to git-gc) and the objects will
be pruned. That would not too be pleasant to debug.
Heh. As you can see it has some "issues" with its use. Its a very
powerful tool, but it does give you more than enough room to shoot
yourself in the foot. Using it is like tieing a gun to your ankle,
keeping it aimed at your big toe at all times, with a string tied
to your wrist and the gun's trigger. Reach too far and *bam*.
Which is why its still in contrib status.
--
Shawn.
next prev parent reply other threads:[~2007-10-12 3:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-11 18:10 How to have multiple working copy directories use the same repository? Bill Priest
2007-10-11 19:00 ` Alex Riesen
2007-10-12 3:52 ` Shawn O. Pearce [this message]
2007-10-11 19:21 ` Sergio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071012035219.GB27899@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=priestwilliaml@yahoo.com \
--cc=raa.lkml@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox