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

Re: [PATCH 1/2] git-describe: introduce --first-parent

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 11, 2012, 16:41 UTC
Message-ID
<7voblcikap.fsf@alter.siamese.dyndns.org>
In-Reply-To
<b5a771de4f84b6f6ae82b736c834d105aa98f87f.1347370970.git.git@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
> so that git-describe searches first-parent history only when looking for

Please make sure your first paragraph of the log message start with a full sentence, not an incomplete tail part of a sentence as if the title of the commit were repeated in front of it.

> a named commit. This is useful for describing commits by tags on their
> "main" (first-parent) branch; for example, on git.git:

This is useful only when the history does not have fast-forward merges from a sideline; otherwise it will produce unexpected results, no?

Show 5 quoted lines
> git describe 22ffc39
> v1.7.2.3-223-g22ffc39
>
> git describe --first-parent 22ffc39
> v1.7.2-104-g22ffc39

The output is wrong in that 22ffc39 is v1.7.2-336-g22ffc39, not 104. Putting an arbitrary number that can change depending on how the traversal went will close the door to possible follow-up work on the recent sha1-name-more series (0958a24^2, most importantly aa1dec9e) to prolong the shelf-life of describe output by filtering candidate commits with reachability from the tag and the number of commits from the tag.

In any case, it is not clear to me if this is a useful example to help readers of this commit to understand why this new feature is useful. 22ffc39 was created to mark that the work done for 1.7.2.x maintenance track back then were all contained in the 'master' by merging 'maint' when it was pointing at v1.7.2.3. Saying the commit is newer than v1.7.2.3 gives more information than it is newer than v1.7.2, as by convention v1.7.2 must be older than v1.7.2.3, no?

Previous: Michael J GruberNext: Michael J Gruber
Message 3 of 6 in “git describe --first-parent”
  1. 0/2 git describe --first-parentMichael J Gruber, Sep 11, 2012
  2. 1/2 git-describe: introduce --first-parentMichael J Gruber, Sep 11, 2012
  3. Junio C HamanoSep 11, 2012
  4. 2/2 describe: document and test --first-parentMichael J Gruber, Sep 11, 2012
  5. Junio C HamanoSep 11, 2012
  6. Junio C HamanoSep 11, 2012

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.