git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] init: disallow --separate-git-dir with bare repository

From
Jeff King <peff@peff.net>
Date
Aug 11, 2020, 09:02 UTC
Message-ID
<20200811090245.GA2050353@coredump.intra.peff.net>
In-Reply-To
<CAPig+cSMzEuMYNnHhMGwqGFgjWfX0+j1KoOSK8V7Wav97p+UVw@mail.gmail.com>
On Tue, Aug 11, 2020 at 01:44:00AM -0400, Eric Sunshine wrote:
Show 7 quoted lines
> > I agree that it seems like nonsense. I'm a little curious what it
> > happens to do today, just because I'd wonder if it could possibly be of
> > any use to somebody.
> 
> The current behavior does some goofy stuff which I can't imagine being
> useful to anyone. For instance:
> [...]

OK, that's sufficiently brain-dead that I agree nobody will be sad to see it go. Thanks for indulging me. :)

Show 16 quoted lines
> > I think we'd clean up that detritus with our atexit handler, but I like
> > the extra check here. It lets us give a slightly more specific message
> > when we can catch it early ("these two options are incompatible").
> 
> With only the latter (after-the-fact) check:
> 
>     % git init --bare --separate-git-dir bar.git foo.git
>     fatal: --separate-git-dir incompatible with bare repository
>     % ls -1
>     foo.git
>     % ls -A foo.git/
>     %
> 
> It leaves the directory "foo.git" around, though the directory is
> empty. With the earlier check in place, it avoids leaving that empty
> directory.

Ah, right. git-clone has some magic auto-cleanup for signals/atexit, but git-init does not. It might be worth adding that, but it's definitely outside the scope of your patch.

-Peff
Previous: Eric Sunshine
Message 4 of 4 in “init: disallow --separate-git-dir with bare repository”
  1. init: disallow --separate-git-dir with bare repositoryEric Sunshine, Aug 9, 2020
  2. Jeff KingAug 10, 2020
  3. Eric SunshineAug 11, 2020
  4. Jeff KingAug 11, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.