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

Re: [GSoC RFC PATCH 0/1] graph: add indentation for commits preceded by a root

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
May 15, 2026, 09:33 UTC
Message-ID
<2e8b9b1b-6a69-4e94-95ea-7f587435bfce@gmail.com>
In-Reply-To
<CAN5EUNQCsKD0CJqDi43i2JVBQQChAZVt_THQ1wGpdeydNHHCFw@mail.gmail.com>
On 14/05/2026 18:45, Pablo Sabater wrote:
Show 49 quoted lines
> El jue, 14 may 2026 a las 17:15, Phillip Wood
> (<phillip.wood123@gmail.com>) escribió:
>> On 02/04/2026 22:17, Pablo Sabater wrote:
>>> When having a history with multiple root commits and drawing the history
>>> near the roots, the graphing engine renders the commit one below the other,
>>> seeming that they are related, which makes the graph confusing.
>>>
>>> This issue was reported by Junio at:
>>>     https://lore.kernel.org/git/xmqqikaawrpx.fsf@gitster.g/
>>>
>>> e.g.:
>>>
>>>     * root-B
>>>     * child-A2
>>>     * child-A1
>>>     * root-A
>>>
>>> [...]
>>   >
>>>     * root-B
>>>       * child-A2
>>>      /
>>>     * child-A1
>>>     * root-A
>>
>> I'm rather late to the party here, but personally I find the indentation
>> a bit confusing, it would be clearer to me if we had a blank line after
>> a root commit
> 
> Hi,
> 
>>
>>       * root-B
>>
>>       * child-A2
>>       * child-A1
>>       * root-A
>>
>> It takes the same amount of vertical space but keeps the children of
>> root-A together.
> 
> I have mixed feelings about which approach to choose.
> The idea of a blank line was thought at
> https://lore.kernel.org/git/xmqq8s8vvw9m.fsf@gitster.c.googlers.com/
> but Junio argued against it for having an extra row because the
> indentation he proposed didn't collapse, however I find indentation +
> no collapse the most confusing one.
> I'd say that I'm fine with both approaches, blank line or indentation
> + collapse.

I'm afraid I don't understand this - what does it mean for the indentation to collapse, or not collapse. Looking at the examples Junio gave they look quite nice to me, though I'd find it clearer if

  | | *  12345678 2021-01-14 merge xxxxx@xxxx into the history
  | | |\
  | | | \
  | | *  \  23456789 2021-01-12 merge citest into the main history
  | | |\  * 5505e019c2 2014-07-09 initial xxxxxx@xxxx
  | | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) 
Added defau
  | | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from 
f7daf088)
was rendered as
  | | *  12345678 2021-01-14 merge xxxxx@xxxx into the history
  | | |\
  | | | *  5505e019c2 2014-07-09 initial xxxxxx@xxxx
  | | *    23456789 2021-01-12 merge citest into the main history
  | | |\
  | | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) 
Added defau
  | | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from 
f7daf088)
Show 32 quoted lines
>>> without the patch:
>>>
>>>     * A root
>>>     * B root
>>>     * C root
>>>     * D1 child
>>>     * D root
>>>
>>> with the patch, the indentation cascades:
>>>
>>>     * A root
>>>       * B root
>>>         * C root
>>>           * D1 child
>>>        _ /
>>>       /
>>>      /
>>>     * D root
> 
>    * A root
> 
>    * B root
> 
>    * C root
> 
>    * D1 child
> 
>    * D root
> 
> Here I think a blank line looks worse, too much space for just 5
> commits and becomes one extra line which if this were like up to 7 or
> more parentless commits one after the other would be more noticeable.

But there shouldn't be a blank line between D and D1 so the two alternatives take up the same amount of vertical space, the main difference being whether D1 appears next to D

     * A root     * A root
                    * B root
     * B root         * C root
                        * D1 child
     * C root         _/
                    /
     * D1 child    /
     * D root     * D root

Of course if the indentation was smarter it would take up less room and look better than having blank lines

     * A root
       * B root
         * C root
     * D1 child
     * D root
Show 12 quoted lines
> But there are cases that blank line might be better:
> 
>    * 10_A2
>    * 10_A1
>    * 10_A
>      *   10_M
>     /|\
>    | | * 10_D
>    | * 10_C
>    * 10_B
> 
> Feels like a shower of commits instead of an indented merge.

Yes, that is a bit confusing. I think the thing I find confusing with this approach is that we're treating the commit rendered below the root commit specially, rather than treating the root commit itself specially. To me it is the root commit that's the odd one out because it does not have any parents, but we treat the commit that's rendered below as the odd one by indenting it relative to its parents.

Show 6 quoted lines
> Pro to the blank line, the parentless check is the same and it's just
> printing a '\n' at the right spot, while indent i'm mimicking like if
> there was a commit there.
> Anyways, I think in the majority of the cases the indentation +
> collapsing looks better.
> Sorry for the brief reply, I'm busy today.
No need to apologize, it seemed quite comprehensive to me
Thanks
Phillip
Show 69 quoted lines
> Regards,
> 
> --
> Pablo
> 
>>
>> Thanks
>>
>> Phillip
>>
>>> This is done by adding a is_placeholder flag to the columns, the root commit
>>> is actually there but marked as a placeholder
>>>
>>> e.g.:
>>>
>>>      * root-B
>>>     (B) * child-A2
>>>       /
>>>      * child-A1
>>>      * root-A
>>>
>>> (B) would be root-B column with the placeholder flag active.
>>>
>>> Then teaching the rendering function to print a padding ' ' when meeting a
>>> placeholder column outputs the second example.
>>>
>>> There could also be the case where there are multiple roots
>>>
>>> without the patch:
>>>
>>>     * A root
>>>     * B root
>>>     * C root
>>>     * D1 child
>>>     * D root
>>>
>>> with the patch, the indentation cascades:
>>>
>>>     * A root
>>>       * B root
>>>         * C root
>>>           * D1 child
>>>        _ /
>>>       /
>>>      /
>>>     * D root
>>>
>>> the _ / might look weird but that's how the collapsing rendering does it
>>> for big gaps, this case being from the 4th column to the 0th column.
>>> Another patch could change the collapsing rendering for placeholders ?
>>> I haven't done it to keep it minimal, but a follow up could make it
>>> to be straight '/'. This would make it bigger but easier for the eye to follow.
>>> IMO is not worth it, but opinions are welcome.
>>>
>>> The patch also adds tests for different cases like a root preceding multiple
>>> parents merges and the examples above.
>>>
>>> There could be some edge cases still so any testing is very welcome.
>>>
>>> Pablo Sabater (1):
>>>     graph: add indentation for commits preceded by a root
>>>
>>>    graph.c                      |  68 ++++++++++++++++--
>>>    t/t4215-log-skewed-merges.sh | 136 +++++++++++++++++++++++++++++++++++
>>>    2 files changed, 198 insertions(+), 6 deletions(-)
>>>
>>>
>>> base-commit: 256554692df0685b45e60778b08802b720880c50
>>
Previous: Pablo SabaterNext: Chandra Pratap
Message 112 of 119 in “graph: add indentation for commits preceded by a root”
  1. 0/1 graph: add indentation for commits preceded by a rootPablo Sabater, Apr 2, 2026
  2. 1/1 graph: add indentation for commits preceded by a rootPablo Sabater, Apr 2, 2026
  3. Junio C HamanoApr 3, 2026
  4. PabloApr 3, 2026
  5. Junio C HamanoApr 3, 2026
  6. PabloApr 3, 2026
  7. 0/1 graph: add indentation for commits preceded by a parentless commitPablo Sabater, Apr 4, 2026
  8. 1/1 graph: add indentation for commits preceded by a parentless commitPablo Sabater, Apr 4, 2026
  9. PabloApr 10, 2026
  10. Junio C HamanoApr 10, 2026
  11. 0/1 graph: add indentation for commits preceded by a parentless commitPablo Sabater, Apr 27, 2026
  12. 1/1 graph: add indentation for commits preceded by a parentless commitPablo Sabater, Apr 27, 2026
  13. Jeff KingMay 13, 2026
  14. Pablo SabaterMay 14, 2026
  15. PabloApr 27, 2026
  16. 0/2 graph: indent visual roots in graphPablo Sabater, Jun 12, 2026
  17. 1/2 lib-log-graph: move check_graph functionPablo Sabater, Jun 12, 2026
  18. 2/2 graph: indent visual root in graphPablo Sabater, Jun 12, 2026
  19. Junio C HamanoJun 13, 2026
  20. 0/2 graph: indent visual roots in graphPablo Sabater, Jun 13, 2026
  21. 1/2 lib-log-graph: move check_graph functionPablo Sabater, Jun 13, 2026
  22. 2/2 graph: indent visual root in graphPablo Sabater, Jun 13, 2026
  23. Junio C HamanoJun 14, 2026
  24. Pablo SabaterJun 14, 2026
  25. Junio C HamanoJun 15, 2026
  26. Pablo SabaterJun 16, 2026
  27. Junio C HamanoJun 16, 2026
  28. Jeff KingJun 17, 2026
  29. Pablo SabaterJun 18, 2026
  30. Junio C HamanoJun 18, 2026
  31. Jeff KingJun 18, 2026
  32. Jeff KingJun 18, 2026
  33. Kristofer KarlssonJun 19, 2026
  34. Jeff KingJun 21, 2026
  35. Kristofer KarlssonJun 22, 2026
  36. Chandra PratapJun 17, 2026
  37. 0/3 graph: indent visual roots in graphPablo Sabater, Jun 20, 2026
  38. 1/3 lib-log-graph: move check_graph functionPablo Sabater, Jun 20, 2026
  39. 2/3 revision: add peek functions for lookaheadPablo Sabater, Jun 20, 2026
  40. Pablo SabaterJun 20, 2026
  41. Junio C HamanoJun 20, 2026
  42. Junio C HamanoJun 20, 2026
  43. Junio C HamanoJun 21, 2026
  44. Chandra PratapJun 21, 2026
  45. Kristofer KarlssonJun 22, 2026
  46. Junio C HamanoJun 29, 2026
  47. Pablo SabaterJun 29, 2026
  48. 3/3 graph: indent visual root in graphPablo Sabater, Jun 20, 2026
  49. 0/3 graph: indent visual roots in graphPablo Sabater, Jul 4, 2026
  50. 1/3 lib-log-graph: move check_graph functionPablo Sabater, Jul 4, 2026
  51. 2/3 graph: add a 2 commit buffer for lookaheadPablo Sabater, Jul 4, 2026
  52. Chandra PratapJul 6, 2026
  53. Kristofer KarlssonJul 6, 2026
  54. Chandra PratapJul 6, 2026
  55. Pablo SabaterJul 7, 2026
  56. Pablo SabaterJul 7, 2026
  57. 3/3 graph: indent visual root in graphPablo Sabater, Jul 4, 2026
  58. 0/4 graph: indent visual roots in graphPablo Sabater, Jul 10, 2026
  59. 1/4 lib-log-graph: move check_graph functionPablo Sabater, Jul 10, 2026
  60. 2/4 revision: add next_commit_to_show()Pablo Sabater, Jul 10, 2026
  61. 3/4 graph: add a 2 commit buffer for lookaheadPablo Sabater, Jul 10, 2026
  62. 4/4 graph: indent visual root in graphPablo Sabater, Jul 10, 2026
  63. Mirko FainaJul 10, 2026
  64. Pablo SabaterJul 10, 2026
  65. 0/4 graph: indent visual roots in graphPablo Sabater, Jul 11, 2026
  66. 1/4 lib-log-graph: move check_graph functionPablo Sabater, Jul 11, 2026
  67. 2/4 revision: add next_commit_to_show()Pablo Sabater, Jul 11, 2026
  68. 3/4 graph: add a 2 commit buffer for lookaheadPablo Sabater, Jul 11, 2026
  69. 4/4 graph: indent visual root in graphPablo Sabater, Jul 11, 2026
  70. Mirko FainaJul 11, 2026
  71. Pablo SabaterJul 11, 2026
  72. Mirko FainaJul 11, 2026
  73. Chandra PratapJul 12, 2026
  74. Mirko FainaJul 12, 2026
  75. Mirko FainaJul 12, 2026
  76. Pablo SabaterJul 12, 2026
  77. Mirko FainaJul 12, 2026
  78. Chandra PratapJul 13, 2026
  79. 0/7 graph: indent visual roots in graphPablo Sabater, Jul 13, 2026
  80. 1/7 lib-log-graph: move check_graph functionPablo Sabater, Jul 13, 2026
  81. 2/7 revision: add next_commit_to_show()Pablo Sabater, Jul 13, 2026
  82. 3/7 graph: add a 2 commit buffer for lookaheadPablo Sabater, Jul 13, 2026
  83. 4/7 graph: indent visual root in graphPablo Sabater, Jul 13, 2026
  84. 5/7 graph: wrap cascading commits after 4 columnsPablo Sabater, Jul 13, 2026
  85. 6/7 graph: move config reading into graph_read_config()Pablo Sabater, Jul 13, 2026
  86. 7/7 graph: add --[no-]graph-indent and log.graphIndentPablo Sabater, Jul 13, 2026
  87. Mirko FainaJul 13, 2026
  88. Pablo SabaterJul 13, 2026
  89. 0/7 graph: indent visual roots in graphPablo Sabater, Jul 13, 2026
  90. 1/7 lib-log-graph: move check_graph functionPablo Sabater, Jul 13, 2026
  91. 2/7 revision: add next_commit_to_show()Pablo Sabater, Jul 13, 2026
  92. 3/7 graph: add a 2 commit buffer for lookaheadPablo Sabater, Jul 13, 2026
  93. 4/7 graph: indent visual root in graphPablo Sabater, Jul 13, 2026
  94. 6/7 graph: move config reading into graph_read_config()Pablo Sabater, Jul 13, 2026
  95. 7/7 graph: add --[no-]graph-indent and log.graphIndentPablo Sabater, Jul 13, 2026
  96. Chandra PratapJul 14, 2026
  97. Pablo SabaterJul 14, 2026
  98. 5/7 graph: wrap cascading commits after 4 columnsPablo Sabater, Jul 13, 2026
  99. Junio C HamanoJul 13, 2026
  100. Pablo SabaterJul 13, 2026
  101. 0/7 graph: indent visual roots in graphPablo Sabater, Jul 14, 2026
  102. 1/7 lib-log-graph: move check_graph functionPablo Sabater, Jul 14, 2026
  103. 2/7 revision: add next_commit_to_show()Pablo Sabater, Jul 14, 2026
  104. 3/7 graph: add a 2 commit buffer for lookaheadPablo Sabater, Jul 14, 2026
  105. 4/7 graph: indent visual root in graphPablo Sabater, Jul 14, 2026
  106. 5/7 graph: wrap cascading commits after 4 columnsPablo Sabater, Jul 14, 2026
  107. 6/7 graph: move config reading into graph_read_config()Pablo Sabater, Jul 14, 2026
  108. 7/7 graph: add --[no-]graph-indent and log.graphIndentPablo Sabater, Jul 14, 2026
  109. Chandra PratapJul 15, 2026
  110. Phillip WoodMay 14, 2026
  111. Pablo SabaterMay 14, 2026
  112. Phillip WoodMay 15, 2026
  113. Chandra PratapMay 17, 2026
  114. Pablo SabaterMay 18, 2026
  115. Junio C HamanoMay 19, 2026
  116. Pablo SabaterMay 19, 2026
  117. Junio C HamanoJun 10, 2026
  118. Pablo SabaterJun 10, 2026
  119. Chandra PratapMay 19, 2026

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.