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

Re: can git-describe learn first-parent behavior?

From
JSJoshua Shrader <jshrader83@gmail.com>
Date
Sep 22, 2010, 17:45 UTC
Message-ID
<AANLkTimMggJtWNifuRCcVCEZ5NSjhdc9dEjftkOtjUOu@mail.gmail.com>
In-Reply-To
<4C99A7BB.50401@drmicha.warpmail.net>

Thanks for the response. Since my last message, I have been able to get a tag on the v1.0 branch (although not the original v1.0-stable tag) to appear in the git describe output when run on v1.1 head, and thus I do think a --first-parent option would be useful.

On Wed, Sep 22, 2010 at 2:52 AM, Michael J Gruber <git@drmicha.warpmail.net> wrote:

Show 36 quoted lines
> Joshua Shrader venit, vidit, dixit 21.09.2010 21:57:
>> I think I need to apologize to the list.  I did not actually observe
>> what I had stated in my original post.  Given the description (and my
>> possibly naive understanding) of git-describe, I hypothesized that
>> what I originally stated was possible. If git-describe is in fact
>> implemented with a first-parent-like behavior, as some people believe
>> to be true, then I believe it is working correctly - I've seen nothing
>> to the contrary.  However, I do believe that the documentation is
>> unclear if this is the case.  My interpretation of "depth," which I
>> believe to be consistent with the graph-theoretical definition, does
>> imply that what I stated could happen.
>
> Josh, no need to apologize. You simply tried to understand "git
> describe". The mere fact that a Git long time contributor (J6t) and an
> occasional contributor (I) are discussing "git describe"'s behaviour
> tells you that it can't be that easy ;)
>
> The man page says "most recent tag", and that is true, but with a
> definition of "most recent" that you wouldn't expect. The description
> there under "Search Strategy" is wrong, and has been at least since
> 80dbae03. I'll try to come up with a better explanation fit for the man
> page, possibly after writing some more tests.
>
> The intended behaviour is explained really well in Shawn's commit
> message for 80dbae03. And if you look at the algorithm you see that the
> order of the parents (as stored in a merge commit), in particular
> first-parent relationship plays no role at all. The algo takes all
> parents and inserts them in date order into a list to be looped over
> afterwards.
>
> The more I understand the algo the more I realize that --first-parent is
> useful and completely different, and that I can optimize more in my patch.
>
> Cheers
> Michael
>
Previous: Michael J Gruber
Message 12 of 12 in “can git-describe learn first-parent behavior?”
  1. Joshua ShraderSep 21, 2010
  2. Michael J GruberSep 21, 2010
  3. git-describe: introduce --first-parentMichael J Gruber, Sep 21, 2010
  4. Johannes SixtSep 21, 2010
  5. Michael J GruberSep 21, 2010
  6. Johannes SixtSep 21, 2010
  7. Michael J GruberSep 21, 2010
  8. Johannes SixtSep 21, 2010
  9. Michael J GruberSep 21, 2010
  10. Joshua ShraderSep 21, 2010
  11. Michael J GruberSep 22, 2010
  12. Joshua ShraderSep 22, 2010

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.