From: Junio C Hamano <gitster@pobox.com>
To: Pierre Habouzit <madcoder@debian.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] git-checkout: improve error messages, detect ambiguities.
Date: Wed, 23 Jul 2008 16:04:08 -0700 [thread overview]
Message-ID: <7v7ibc9p93.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1216808133-31919-3-git-send-email-madcoder@debian.org> (Pierre Habouzit's message of "Wed, 23 Jul 2008 12:15:33 +0200")
Pierre Habouzit <madcoder@debian.org> writes:
> 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).
next prev parent reply other threads:[~2008-07-23 23:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-23 1:02 [PATCH] git-checkout: fix argument parsing to detect ambiguous arguments Pierre Habouzit
2008-07-23 1:13 ` Pierre Habouzit
2008-07-23 1:17 ` Johannes Schindelin
2008-07-23 1:32 ` Pierre Habouzit
2008-07-23 1:27 ` [RESEND PATCH] " Pierre Habouzit
2008-07-23 1:39 ` Pierre Habouzit
2008-07-23 10:10 ` Johannes Schindelin
2008-07-23 10:15 ` Resubmit after a night of sleep Pierre Habouzit
2008-07-23 10:15 ` [PATCH 1/2] git-checkout: fix command line parsing Pierre Habouzit
2008-07-23 10:15 ` [PATCH 2/2] git-checkout: improve error messages, detect ambiguities Pierre Habouzit
2008-07-23 23:04 ` Junio C Hamano [this message]
2008-07-24 2:07 ` Junio C Hamano
2008-07-24 8:33 ` Pierre Habouzit
2008-07-23 11:49 ` [PATCH] checkout: mention '--' in the docs SZEDER Gábor
2008-07-23 11:49 ` [PATCH] bash: offer only paths after '--' for 'git checkout' SZEDER Gábor
2008-07-25 20:34 ` Shawn O. Pearce
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=7v7ibc9p93.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=madcoder@debian.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.