Re: [BUG] --bare is ignored before command word
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Nov 20, 2015, 14:52 UTC
- Message-ID
- <vpqfv00hge7.fsf@anie.imag.fr>
- In-Reply-To
- <20151119044646.GA8059@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 22 quoted lines
> On Wed, Nov 18, 2015 at 10:29:20PM +0100, Matthieu Moy wrote: > >> 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.
I agree with this. I can't see a real use-case "git --bare clone" so it could imply "git clone --bare".
-- Matthieu Moy http://www-verimag.imag.fr/~moy/