git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC] get_oid: new extended SHA-1 syntax to control resolution process

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 26, 2019, 18:51 UTC
Message-ID
<xmqqk1d8ch9g.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190626084139.30246-1-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
Show 6 quoted lines
> 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.
Previous: Nguyễn Thái Ngọc DuyNext: Duy Nguyen
Message 7 of 11 in “specifying revision - how to enforce matching a tag/branch-name or revision only”
  1. Boettger, HeikoJun 20, 2019
  2. Kyle MeyerJun 20, 2019
  3. Junio C HamanoJun 21, 2019
  4. Duy NguyenJun 25, 2019
  5. AW: specifying revision - how to enforce matching a tag/branch-name or revision onlyBoettger, Heiko, Jun 25, 2019
  6. get_oid: new extended SHA-1 syntax to control resolution processNguyễn Thái Ngọc Duy, Jun 26, 2019
  7. Junio C HamanoJun 26, 2019
  8. Duy NguyenJun 27, 2019
  9. Junio C HamanoJun 27, 2019
  10. Jakub NarebskiJun 30, 2019
  11. Duy NguyenJul 1, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.