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

Re: [PATCH 4/4] describe/name-rev: tell name-rev to peel the incoming object to commit first

From
Jeff King <peff@peff.net>
Date
Jul 9, 2013, 05:12 UTC
Message-ID
<20130709051252.GG27903@sigill.intra.peff.net>
In-Reply-To
<CALkWK0nMmQO=cML-s9rgku+_4fZnYwtGC+daYPOBPn6-RFZj=g@mail.gmail.com>
On Mon, Jul 08, 2013 at 06:38:32PM +0530, Ramkumar Ramachandra wrote:
Show 19 quoted lines
> Junio C Hamano wrote:
> > With this on top of the other patches in this series, you would get:
> >
> >     $ git describe --contains $(git rev-parse v1.8.3 v1.8.3^0)
> >     v1.8.3
> >     v1.8.3
> >
> > while you can still differentiate tags and the commits they point at
> > with:
> >
> >     $ git name-rev --refs=tags/\* --name-only $(git rev-parse v1.8.3 v1.8.3^0)
> >     v1.8.3
> >     v1.8.3^0
> >
> > The difference in these two behaviours is achieved by adding --peel-to-commit
> > option to "name-rev" and using it when "describe" internally calls it.
> 
> Essentially a revert of [2/4] for describe-purposes, achieved by
> adding an ugly command-line option to name-rev.
I don't think it is a revert. The two patches complement each other.

2/4 is basically "if we have a non-commit object which is pointed at directly by a tip, make sure we name it by that tip". But you can only get such an object by "name-rev --stdin", since name-rev peels its command-line arguments.

4/4 is "stop peeling command line objects, so we can find their exact tips". IOW, it lets the command line do the same thing that --stdin was able to do in 2/4.

Show 6 quoted lines
> Before we argue any further, let me ask: who uses name-rev (and
> depends strongly on its output)?!  Our very own testsuite does not
> exercise it.  There are exactly two users of describe/name-rev:
> 
> 1. prompt, obviously.
> 2. DAG-tests, for simplification.

Yeah, I'm not clear on who we are breaking with the change in default peeling behavior, nor why the "describe --contains" wrapper wants to keep it.

-Peff
Previous: Ramkumar RamachandraNext: Jeff King
Message 15 of 20 in “Make "git name-rev $(git rev-parse v1.8.3)" work”
  1. 0/4 Make "git name-rev $(git rev-parse v1.8.3)" workJunio C Hamano, Jul 7, 2013
  2. 1/4 name-ref: factor out name shortening logic from name_ref()Junio C Hamano, Jul 7, 2013
  3. Michael HaggertyJul 8, 2013
  4. Junio C HamanoJul 8, 2013
  5. 2/4 name-rev: allow converting the exact object name at the tip of a refJunio C Hamano, Jul 7, 2013
  6. Ramkumar RamachandraJul 8, 2013
  7. Junio C HamanoJul 8, 2013
  8. 3/4 describe: use argv-arrayJunio C Hamano, Jul 7, 2013
  9. Jeff KingJul 9, 2013
  10. Junio C HamanoJul 9, 2013
  11. Junio C HamanoJul 9, 2013
  12. Jeff KingJul 9, 2013
  13. 4/4 describe/name-rev: tell name-rev to peel the incoming object to commit firstJunio C Hamano, Jul 7, 2013
  14. Ramkumar RamachandraJul 8, 2013
  15. Jeff KingJul 9, 2013
  16. Jeff KingJul 9, 2013
  17. Junio C HamanoJul 9, 2013
  18. Jeff KingJul 9, 2013
  19. Junio C HamanoJul 9, 2013
  20. Ramkumar RamachandraJul 9, 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.