From: Junio C Hamano <gitster@pobox.com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] Update :/abc ambiguity check
Date: Mon, 21 Jan 2013 11:27:45 -0800 [thread overview]
Message-ID: <7vsj5ufia6.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1358773249-24384-1-git-send-email-pclouds@gmail.com> ("Nguyễn Thái Ngọc Duy"'s message of "Mon, 21 Jan 2013 20:00:48 +0700")
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> :/abc may mean two things:
>
> - as a revision, it means the revision that has "abc" in commit
> message.
>
> - as a pathpec, it means "abc" from root.
>
> Currently we see ":/abc" as a rev (most of the time), but never see it
> as a pathspec even if "abc" exists and "git log :/abc" will gladly
> take ":/abc" as rev even it's ambiguous. This patch makes it:
>
> - ambiguous when "abc" exists on worktree
> - a rev if abc does not exist on worktree
> - a path if abc is not found in any commits (although better use
The "any commits" above sounds very scary. Are you really going to
check against all the commits?
> "--" to avoid ambiguation because searching through commit DAG is
> expensive)
>
> A plus from this patch is, because ":/" never matches anything as a
> rev, it is never considered a valid rev and because root directory
> always exists, ":/" is always unambiguously seen as a pathspec.
That is the primary plus in practice, I think, and it is a big one.
When naming a directory that belongs to a different subdirectory
hierarchy, typing ":/that/directory/name" is not any easier than
having your shell help you complete "../../that/directory/name"; I
suspect nobody uses the relative-to-root notation to name anything
but the root in real life.
next prev parent reply other threads:[~2013-01-21 19:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-21 13:00 [PATCH 1/2] Update :/abc ambiguity check Nguyễn Thái Ngọc Duy
2013-01-21 13:00 ` [PATCH 2/2] grep: avoid accepting ambiguous revision Nguyễn Thái Ngọc Duy
2013-01-21 19:27 ` Junio C Hamano [this message]
2013-01-22 2:46 ` [PATCH 1/2] Update :/abc ambiguity check Duy Nguyen
2013-01-22 4:10 ` 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=7vsj5ufia6.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).