From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Kevin Daudt <me@ikke.info>
Cc: Junio C Hamano <gitster@pobox.com>,
Git Mailing list <git@vger.kernel.org>
Subject: Re: [PATCH v2] gitcli: tweak "man gitcli" for clarity
Date: Wed, 22 Nov 2017 06:46:30 -0500 (EST) [thread overview]
Message-ID: <alpine.LFD.2.21.1711220645580.12052@DESKTOP-1GPMCEJ> (raw)
In-Reply-To: <20171122114133.GD16418@alpha.vpn.ikke.info>
On Wed, 22 Nov 2017, Kevin Daudt wrote:
> On Wed, Nov 22, 2017 at 06:19:23AM -0500, Robert P. J. Day wrote:
> > On Wed, 22 Nov 2017, Junio C Hamano wrote:
> >
> > > "Robert P. J. Day" <rpjday@crashcourse.ca> writes:
> > >
> > > > git repo with a file called "Gemfile", so i created a branch called
> > > > "Gemfile", and when i ran:
> > > >
> > > > $ git checkout Gemfile
> > > >
> > > > git switched to the branch. so even with the ambiguity, git
> > > > obviously has some sort of precedence order it checks. so what are
> > > > the rules here?
> > >
> > > 31b83f36 ("Merge branch 'nd/checkout-disambiguation'", 2016-09-26)
> > > should have made it clear that the "checkout" command has a
> > > convenience special case.
> >
> > ok, then i'm still curious about git examples that actually fail due
> > to an inability to disambiguate.
> >
> > rday
>
> Here is an example with git diff
>
> $ git init git-disambiguate
> $ cd git-disambiguate
> $ echo 1 >foo && git add foo && git commit -m foo
> $ git branch foo
> $ echo 2 >>foo && git add foo && git commit -m foo2
> $ echo 3 >>foo
>
> $ git diff foo
> fatal: ambiguous argument 'foo': both revision and filename
> Use '--' to separate paths from revisions, like this:
> 'git <command> [<revision>...] -- [<file>...]'
>
> $ git diff HEAD foo
> fatal: ambiguous argument 'foo': both revision and filename
> Use '--' to separate paths from revisions, like this:
> 'git <command> [<revision>...] -- [<file>...]'
>
> $ git diff HEAD -- foo
> diff --git a/foo b/foo
> index 1191247..01e79c3 100644
> --- a/foo
> +++ b/foo
> @@ -1,2 +1,3 @@
> 1
> 2
> +3
>
> $ git diff HEAD foo --
> diff --git a/foo b/foo
> index 1191247..d00491f 100644
> --- a/foo
> +++ b/foo
> @@ -1,2 +1 @@
> 1
> -2
fair enough, i'll go back and reword to refer to actual
disambiguation errors.
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
next prev parent reply other threads:[~2017-11-22 11:47 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-21 21:27 [PATCH v2] gitcli: tweak "man gitcli" for clarity Robert P. J. Day
2017-11-21 21:45 ` Kevin Daudt
2017-11-21 21:47 ` Robert P. J. Day
2017-11-21 22:04 ` Kevin Daudt
2017-11-21 22:12 ` Robert P. J. Day
2017-11-22 9:55 ` Robert P. J. Day
2017-11-22 10:34 ` Junio C Hamano
2017-11-22 11:19 ` Robert P. J. Day
2017-11-22 11:41 ` Kevin Daudt
2017-11-22 11:46 ` Robert P. J. Day [this message]
2017-11-23 0:03 ` Jeff King
2017-11-23 2:22 ` Junio C Hamano
2017-11-23 7:45 ` Robert P. J. Day
2017-11-23 13:51 ` Jeff King
2017-11-23 20:55 ` Kevin Daudt
2017-11-24 1:01 ` Junio C Hamano
2017-11-24 18:16 ` Jeff King
2017-11-24 18:12 ` Jeff King
2017-11-25 3:02 ` Junio C Hamano
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=alpine.LFD.2.21.1711220645580.12052@DESKTOP-1GPMCEJ \
--to=rpjday@crashcourse.ca \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=me@ikke.info \
/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