Re: [PATCH 3/5] Clean up work-tree handling
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jul 27, 2007, 19:32 UTC
- Message-ID
- <Pine.LNX.4.64.0707272029140.14781@racer.site>
- In-Reply-To
- <7v8x911wn6.fsf@assigned-by-dhcp.cox.net>
Hi,
On Fri, 27 Jul 2007, Junio C Hamano wrote:
Show 30 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > > > But there is a fundamental question I have to ask: Is there any reason why > > > > $ git --git-dir=/some/where/else.git bla > > > > should pretend that the repo is bare if core.bare == 1? I mean, we are > > implicitely setting the work tree to the cwd, no? > > I have two repositories at the primary k.org machine. > > - /home/junio/git.git --- this is with a worktree so that I can > build and test on a FC machine (my primary development > machine at home is a Debian). > > - /pub/scm/git/git.git/ --- this is a bare repository that is > mirrored out to git://git.kernel.org/ and friends. > > And I usually am in the former. From time to time, I do this: > > $ GIT_DIR=/pub/scm/git/git.git/ git fsck > $ GIT_DIR=/pub/scm/git/git.git/ git repack > > because I am old fashioned, but I would expect these to be > equivalent to the above: > > $ git --git-dir=/pub/scm/git/git.git/ fsck > $ git --git-dir=/pub/scm/git/git.git/ repack > > I do not think these imply that the repository is with worktree.
But in your use cases it does not matter, since neither fsck nor repack need a worktree.
Here is one of _my_ scenarios: I want to track a directory I have no write access to (or better put: I should have no write access to). So I created a bare repository, and when I add new files I use the "GIT_DIR=... git..." mantra.
But you're right, I could just set core.worktree=... and unset core.bare.
I can change that easily enough. Other comments on the series?
Ciao, Dscho