git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Jacob Keller <jacob.keller@gmail.com>
Cc: Ronny Borchert <mister_rs@web.de>,
	Git mailing list <git@vger.kernel.org>
Subject: Re: [BUG] --bare is ignored before command word
Date: Wed, 18 Nov 2015 22:29:20 +0100	[thread overview]
Message-ID: <vpqa8qbov2n.fsf@anie.imag.fr> (raw)
In-Reply-To: <CA+P7+xoD2-eDZQt29KBqZF2g4i+K7XhJG0mhUgqf5iDURBPntg@mail.gmail.com> (Jacob Keller's message of "Wed, 18 Nov 2015 12:08:37 -0800")

Jacob Keller <jacob.keller@gmail.com> writes:

> On Wed, Nov 18, 2015 at 9:20 AM, Ronny Borchert <mister_rs@web.de> wrote:
>> I was trying to clone a bare repository. Not sure why I did, maybe
>> description on website was wrong.
>> My try:
>>
>> git --bare clone https://github.....
>>
>> This was leading in creating a none bare repository! No error or warning
>> message here!
>> I guess this behavior is also for other --xxx commands.
>>
>
> This is how the git options work. Options before a command word are
> always ignored.

No, they are not ignored. For example

$ git --foobar init
Unknown option: --foobar

=> the option is processed, and rejected explicitly.

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".

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  reply	other threads:[~2015-11-18 21:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-18 17:20 [BUG] --bare is ignored before command word Ronny Borchert
2015-11-18 20:08 ` Jacob Keller
2015-11-18 21:29   ` Matthieu Moy [this message]
2015-11-19  4:46     ` Jeff King
2015-11-20 14:52       ` Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vpqa8qbov2n.fsf@anie.imag.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=jacob.keller@gmail.com \
    --cc=mister_rs@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).