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

Re: [PATCH 1/3] name-rev: fix assumption about --name-only usage

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 7, 2013, 18:18 UTC
Message-ID
<7v61wm44k0.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1373200996-9753-2-git-send-email-artagnon@gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 14 quoted lines
> 236157 (Teach git-describe how to run name-rev, 2007-05-21) introduced
> `git name-rev --name-only`, with the intent of using it to implement
> `git describe --contains`.  According to the message, users wanted to
> use describe to figure out which tags contains a specific commit.
> name-rev already did this, but didn't print out in the same format as
> describe:
>
>   $ git describe v1.8.3~1
>   v1.8.3-rc3-8-g5e49f30
>
> ...  As a result, while
>
>   $ git describe --contains v1.8.3~1
>   v1.8.3~1
The above two look consistent, yes.
Show 7 quoted lines
>
> would get name-rev to print output in the same format as describe,
>
>   $ git describe --contains --all v1.8.3~1
>   tags/v1.8.3~1
>
> would not strip the leading "tags/".

If you _know_ v1.8.3 does not appear outside "tags/", this does look inconsistent, but I do not think the code checks it. Ahd if the code does not, I am not sure not stripping "tags/" is necessarily a bad thing, because "--all" allows names to come outside "tags/" hierarchy.

Also how should this interact with v1.8.3-1-g98c5c4a that changed the rule somewhat so that the common prefix is stripped when we know the result is not ambiguous?

Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 3 of 10 in “Iron output of describe --contains --all”
  1. 0/3 Iron output of describe --contains --allRamkumar Ramachandra, Jul 7, 2013
  2. 1/3 name-rev: fix assumption about --name-only usageRamkumar Ramachandra, Jul 7, 2013
  3. Junio C HamanoJul 7, 2013
  4. Ramkumar RamachandraJul 8, 2013
  5. 2/3 name-rev: strip trailing ^0 in when --name-onlyRamkumar Ramachandra, Jul 7, 2013
  6. Junio C HamanoJul 7, 2013
  7. Junio C HamanoJul 7, 2013
  8. Ramkumar RamachandraJul 8, 2013
  9. 3/3 name-rev doc: rewrite --stdin paragraphRamkumar Ramachandra, Jul 7, 2013
  10. Junio C HamanoJul 7, 2013

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.