Re: [PATCH] Fix new-workdir (again) to work on bare repositories
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 22, 2007, 04:33 UTC
- Message-ID
- <7v3ayckx1m.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20070822033625.GN27913@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 17 quoted lines
>> You may have made the part to create the new directory and make >> bunch of symbolic links to work with your patch, but as far as I >> know, new-workdir is designed to share the .git/config file with >> the borrowed repository, which means the configuration would say >> "core.bare = yes" for a bare repository. So I suspect that the >> initial checkout after creating the new directory and populating >> its .git would barf, although I haven't tested it. > > Indeed. I have a driver script that sets up my bare repos, it > removes core.bare from their configs. So if you go into the bare > repo our auto-sensing bare thing gets activated and says "Hmm, it > ends in .git but isn't exactly .git so its bare!" (correct answer). > If you cd into a workdir created by git-new-workdir the auto-sensing > bare thing gets activated and says "Hmm, it is exactly .git so its > not-bare!" (correct answer). > > So removing that core.bare thing makes the magic work.
Ok, that is better than the response I sent (our messages crossed). In that case, perhaps you would want a warning or a suggestion at the end of new-workdir script, probably before checkout, to teach the user about that magic?