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

Re: [problem with name-rev]

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 20, 2019, 18:21 UTC
Message-ID
<xmqqh86bvgsz.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<87pnkzkivn.fsf_-_@mat.ucm.es>
Uwe Brauer <oub@mat.ucm.es> writes:
Show 29 quoted lines
> Gives
> *   changeset: ae68dbe:master
> |\  user:      Uwe Brauer
> | | date:      Tue Aug 20 16:25:53 2019 +0200
> | | summary:   1.2.1/1.1
> | |
> | * changeset: c00bb5d:master^2
> | | user:      Uwe Brauer
> | | date:      Tue Aug 20 16:25:53 2019 +0200
> | | summary:   1.2.1
> | |
> | * changeset: 54c9230:master^2~1
> | | user:      Uwe Brauer
> | | date:      Tue Aug 20 16:25:53 2019 +0200
> | | summary:   1.2
> | |
> * | changeset: da0712f:master~1
> |/  user:      Uwe Brauer
> |   date:      Tue Aug 20 16:25:53 2019 +0200
> |   summary:   1.1
> |
> * changeset: 8eb999d:master~2
>   user:      Uwe Brauer
>   date:      Tue Aug 20 16:25:53 2019 +0200
>   summary:   1
>
> That looks odd.
>
> Any comments?

When you make a merge like the ae68dbe, merging a topic with two commits 54c9230 and c00bb5d into the then-current tip of the master branch da0712f, _all_ direct parents are recorded in the resulting merge commit, so the first parent of it is denoted as ae68dbe~1 (which is da0712f) and the second parent of it ae68dbe^2 (which is c00bb5d).

There is no linear ordering between these two commits, so c00bb5d will *never* be named as master~<some-number>. As a commit on a side branch, its description from the tip of 'master' will always involve some ^2 (the second parent of some merge commit) somewhere in its name-rev result.

If you are saying that the $commit^$nth_parent notation "looks odd", then you are shooting the messenger with your title. The problem is not with name-rev; the problem is with the way the world works.

Previous: Rafael AscensãoNext: Uwe Brauer
Message 9 of 13 in “git log --graph with a sort of local revision number”
  1. Uwe BrauerAug 15, 2019
  2. Rafael AscensãoAug 18, 2019
  3. Uwe BrauerAug 18, 2019
  4. Uwe BrauerAug 18, 2019
  5. [SOLVED] (was: git log --graph with a sort of local revision number)Uwe Brauer, Aug 18, 2019
  6. [problem with name-rev] (was: git log --graph with a sort of local revision number)Uwe Brauer, Aug 20, 2019
  7. SZEDER GáborAug 20, 2019
  8. Rafael AscensãoAug 20, 2019
  9. Junio C HamanoAug 20, 2019
  10. Uwe BrauerAug 20, 2019
  11. Phil HordAug 20, 2019
  12. Uwe BrauerAug 21, 2019
  13. Uwe BrauerAug 21, 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.