Thread (1 message) 1 message, 1 author, 2018-11-12

Re: [PATCH] checkout: disambiguate dwim tracking branches and local files

From: Junio C Hamano <hidden>
Date: 2018-11-12 19:44:11

Duy Nguyen [off-list ref] writes:
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help