git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jona Christopher Sahnwaldt <jc@sahnwaldt.de>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: David Aguilar <davvid@gmail.com>, Git Mailing List <git@vger.kernel.org>
Subject: Re: "git checkout foo" is getting confused by folder named "foo"
Date: Thu, 26 Sep 2013 23:25:09 +0200	[thread overview]
Message-ID: <CAEQewpp9tCAB_N8jzyeUC05fhHNBsgPyLyTqsRaDFMsq5JdqUg@mail.gmail.com> (raw)
In-Reply-To: <vpqzjr0oemb.fsf@anie.imag.fr>

On 25 September 2013 22:01, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
> Jona Christopher Sahnwaldt <jc@sahnwaldt.de> writes:
>
>> Yes, I think the rules for the "short form" (the guessing when there's
>> no --) should be made simpler, or maybe the guessing should be dropped
>> altogether. I don't know. I don't know git well enough to be able to
>> be more specific. I just find the current behavior very confusing.
>
> It can hardly be "simpler" (in the sense "behavior that can be described
> with fewer words"), but it could be tightened to be safer.
>
> When a remote branch $foo exists, a local branch $foo does not, and a
> file $foo does, then
>
>   git checkout $foo
>
> rather likely means "I want to use git checkout's DWIM and create local
> branch $foo", but it currently means to Git "checkout file foo from the
> index". It would make sense to die here, and require the use of --.

That sounds good. A rule like "when A is true, B is false, and C is
true, then X" is probably too complex to be useful. It's probably
better to give up and say "sorry, I DKWYM (don't know what you mean)".
:-)

There are a few more ideas, opinions, discussions about all this at
http://stackoverflow.com/questions/18833617/why-does-git-checkout-remote-branchname-not-create-new-tracking-branch
especially in the comments.

Cheers,
JC
>
> No time to write a patch for this. Any volunteer?
>
> --
> Matthieu Moy
> http://www-verimag.imag.fr/~moy/

      reply	other threads:[~2013-09-26 21:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-24 21:07 "git checkout foo" is getting confused by folder named "foo" Jona Christopher Sahnwaldt
2013-09-25  2:51 ` David Aguilar
2013-09-25  3:13   ` Keshav Kini
2013-09-25  3:33     ` Duy Nguyen
2013-09-25  8:58   ` Jona Christopher Sahnwaldt
2013-09-25 13:09     ` Matthieu Moy
2013-09-25 16:24       ` Jona Christopher Sahnwaldt
2013-09-25 19:12         ` Matthieu Moy
2013-09-25 19:36           ` Jona Christopher Sahnwaldt
2013-09-25 20:01             ` Matthieu Moy
2013-09-26 21:25               ` Jona Christopher Sahnwaldt [this message]

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=CAEQewpp9tCAB_N8jzyeUC05fhHNBsgPyLyTqsRaDFMsq5JdqUg@mail.gmail.com \
    --to=jc@sahnwaldt.de \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    /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).