Re: [PATCH] checkout: disambiguate dwim tracking branches and local files
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 12, 2018, 19:44 UTC
- Message-ID
- <xmqq36s613p8.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <CACsJy8DZy2hozNypxizF=LmJn8gw9z5HGhV0paiMuM9+gxYVvg@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 5 quoted lines
> Is it that different between an exact path name and a pathspec? > Suppose it is a pathspec (with wildcards) that matches some paths, and > we happen to have the remote branch origin/<that-pathspec>, then it is > still ambiguous whether we should go create branch > "<that-pathspec>" or go check out the paths matched by the pathspec.
: A huge difference between these two
$ echo Hello >'n??t' && git add 'n??t' $ git branch 'n??t'
is that the former is taken and the latter is rejected, even though neither of them is particularly a sane or a likely thing.
Isn't that a good enough reason why
$ git checkout 'n??t'
cannot mean checking 'n??t' branch out, be it either an existing local one or auto-vivified one out of a remote-tracking branch?
> I think you see 'n??t' as a pathspec, but I'm thinking about a user > who sees 'n??t' as a branch name, not pathspec and he would have a > different expectation.
See above for the reason why I think there is no room for different expectations to come in the picture in this case.