git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org, kyle@kyleam.com, Heiko.Boettger@karlstorz.com
Subject: Re: [PATCH/RFC] get_oid: new extended SHA-1 syntax to control resolution process
Date: Wed, 26 Jun 2019 11:51:07 -0700	[thread overview]
Message-ID: <xmqqk1d8ch9g.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20190626084139.30246-1-pclouds@gmail.com> ("Nguyễn Thái Ngọc Duy"'s message of "Wed, 26 Jun 2019 15:41:39 +0700")

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> The problem is we try every possible way to resolve a rev. Let's have
> some annotation to express that we only want to resolve a rev in a
> certain way:
>
> - <hash>@{hash} only accepts a full hash or a short hash. If it's a
>   short hash, it cannot be ambiguous.

This is to defeat something like refs/heads/deadbeef (the branch
whose name is "deadbeef") interfering an object whose name begins
with that hexadecimal substring.  Makes sense.

> - <ref>@{literal} only accepts full ref. No turning "master" into
>   "refs/heads/master".

This is already doable by saying "refs/heads/master", isn't it?  Any
ambiguous ones like a branch or a tag whose name is 'refs/heads/master'
(i.e. refs/heads/refs/heads/master and refs/tags/refs/heads/master
respectively) won't interfere once you use the explicit prefix refs/
like so.  I'd rather not to see this one added.

> - <output>@{describe} interprets <output> as git-describe output
>   only, not an object name or a reference.

Again this is to defeat refs/heads/v2.22.0-221-gdeadbeef branch
interferring with the object "deadbeef" thusly described.  Makes
sense.

In the above, my two "Makes sense" only refer to the capability the
syntax allows us to have, not the suggested syntax itself (which I
am not convinced is a good use of @{<token>} yet).

Thanks.


  reply	other threads:[~2019-06-26 18:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20 14:32 specifying revision - how to enforce matching a tag/branch-name or revision only Boettger, Heiko
2019-06-20 22:54 ` Kyle Meyer
2019-06-21 15:16   ` Junio C Hamano
2019-06-25 11:43     ` Duy Nguyen
2019-06-25 14:35       ` AW: " Boettger, Heiko
2019-06-26  8:41 ` [PATCH/RFC] get_oid: new extended SHA-1 syntax to control resolution process Nguyễn Thái Ngọc Duy
2019-06-26 18:51   ` Junio C Hamano [this message]
2019-06-27  2:52     ` Duy Nguyen
2019-06-27 16:47       ` Junio C Hamano
2019-06-30  9:30   ` Jakub Narebski
2019-07-01  0:30     ` Duy Nguyen

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqk1d8ch9g.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=Heiko.Boettger@karlstorz.com \
    --cc=git@vger.kernel.org \
    --cc=kyle@kyleam.com \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).