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

Re: [BUG] --bare is ignored before command word

From
Jeff King <peff@peff.net>
Date
Nov 19, 2015, 04:46 UTC
Message-ID
<20151119044646.GA8059@sigill.intra.peff.net>
In-Reply-To
<vpqa8qbov2n.fsf@anie.imag.fr>
On Wed, Nov 18, 2015 at 10:29:20PM +0100, Matthieu Moy wrote:
Show 10 quoted lines
> But as you say, options before the command word apply to "git", not to
> the particular command. The case of --bare is a bit unfortunate: both
> "git" and "git clone" accept a --bare option, with a different meaning
> (read "man git" to find what the first does).
> 
> So, I wouldn't call the current behavior a really good one, but it's the
> documented behavior.
> 
> It would be nice to warn in this case though: I don't see any use for
> "git --bare clone".

We have a similar situation for "git init". Once upon a time there was just "git --bare init", and then 74d3b23 (git-init: accept --bare option, 2008-05-28) let us do it either way.

I'm tempted to say that "git --bare clone" should work the same way. Both init and clone are special in that they are always about creating a new repository, not working in an existing one. That's technically a non-compatible behavior change, but AFAICT with the current code the option is silently ignored, which just seems buggy.

But perhaps I am missing some useful effect it does have.

I'd also be OK with simply flagging it as useless and issuing a warning or error.

-Peff
Previous: Matthieu MoyNext: Matthieu Moy
Message 4 of 5 in “[BUG] --bare is ignored before command word”
  1. Ronny BorchertNov 18, 2015
  2. Jacob KellerNov 18, 2015
  3. Matthieu MoyNov 18, 2015
  4. Jeff KingNov 19, 2015
  5. Matthieu MoyNov 20, 2015

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.