Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH 2/2] git-checkout: improve error messages, detect ambiguities.

From: Pierre Habouzit <hidden>
Date: 2016-06-15 22:45:00

On Wed, Jul 23, 2008 at 11:04:08PM +0000, Junio C Hamano wrote:
Pierre Habouzit [off-list ref] writes:
quoted
The patch is twofold: it moves the option consistency checks just under
the parse_options call so that it doesn't get in the way of the tree
reference vs. pathspecs desambiguation.
I think this goes a bit too far.

Even if you have a file called 'master' tracked in your project, when you
say:

    $ git checkout master

that's almost always branch switching.  Forcing "git checkout master --"
disambiguation for such a common case is simply a wrong thing to do from
the usability point of view.

So how about (obviously we are interested only in the case without
disambiguating '--' here):

    (3-1) if there is only one token left and if it is a rev, that's the
          branch to check out or commit to detach to.

    (3-2) otherwise the user might have mistyped one of the paths, so help
          avoiding by making sure the first token is unambiguously either
          a rev or a path (but not both).
  It sounds really reasonable, and your patch seems really fine.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help