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

Re: [GSoC PATCH v6 0/3] graph: add --graph-lane-limit option

From
Pablo <pabloosabaterr@gmail.com>
Date
Apr 1, 2026, 14:42 UTC
Message-ID
<CAN5EUNR_yfkv_hC4wg-nHNg=3FnkYdvFm6FcOUNG2A=MdGs7ZQ@mail.gmail.com>
In-Reply-To
<bdff0a5d-b738-4053-9b72-08eba88156de@kdbg.org>
El mié, 1 abr 2026 a las 10:36, Johannes Sixt (<j6t@kdbg.org>) escribió:
Show 61 quoted lines
>
> Am 28.03.26 um 01:11 schrieb Pablo Sabater:
> > Repositories that have many active branches at the same time produce
> > wide graphs. A lane consists of two columns, the edge and the space
> > padding, each branch takes a lane in the graph and there is no way
> > to limit how many can be shown.
> >
> > The limit is a horizontal truncation, each lane is cut at the lane limit:
> >
> >   Without --graph-lane-limit:
> >
> >   *   7_M1
> >   |\
> >   | * 7_E
> >   * | 7_C
> >   | | *   7_M2
> >   | | |\
> >   | | | * 7_H
> >   | | |/
> >   | |/|
> >   | * | 7_D
> >   | | * 7_G
> >   | | * 7_F
> >   | |/
> >   |/|
> >   * | 7_B
> >   |/
> >   * 7_A
> >
> >   With --graph-lane-limit=1:
> >
> >   *   7_M1
> >   |\
> >   | * 7_E
> >   * ~ 7_C
> >   | ~ 7_M2
> >   | ~ 7_H
> >   | ~
> >   | ~
> >   | * 7_D
> >   | ~ 7_G
> >   | ~ 7_F
> >   | ~
> >   |/~
> >   * ~ 7_B
> >   |/
> >   * 7_A
>
> After seeing this example, my first reaction was that this
> --graph-lane-limit option would not be useful for me. The relationship
> among the commits is apparently obfuscated to such a degree that the
> graph is not a lot better than a plain listing without --graph.
>
> But then I tried on a few real-world examples, and the result turned out
> to be a lot better. The commits (asterisks) typically occur in the
> left-most lanes, and the lanes to the right are usually just connections
> without commits. This makes it more practical to just truncate the graph
> part, i.e., hide the connecting lanes.
>
> In conclusion, I regard the way the option works as useful, even though
> it is not the way of truncation I had envisioned originally.

Thanks for testing it on real-world examples and I'm happy that it seems more useful than expected.

While working on this I spent most of the time with graph.c and I got to understand well how the rendering engine works. I think I have an idea about how to tackle the column rearrangement like gitk, which I believe is what you thought it was about at the start (and the TODO that's been on graph.c for 16 years c12172d2ea).

FWIW, I'd like to send an RFC about the column rearrangement because it would be better overall, no information is lost, you can still limit the number of visible columns which would replace this in most cases (only scenario I can think of where you still want to keep the truncation would be if you want to keep the branches going straight vertically).

I'd like to hold this series and send the RFC with the idea for the rearrangement. If it ends up not being viable I would come back here and add a 4th patch to remove the extra padding lines (merge and collapsing lines truncated) to make it more useful making the graph more compact vertically as well.

I'm sorry if this ends up not being merged and I've wasted your time.
Show 22 quoted lines
>
> I discovered a small glitch, though. If you download today's gitk
> repository https://github.com/j6t/gitk.git, run
>
>   git log --graph --oneline --decorate --boundary \
>      --graph-lane-limit=4 465f03869ae11acd0..origin/j6t-testing
>
> (j6t-testing is a volatile branch and is 86848fe40b60ae58f today).
> Scroll down to line 166 and you see the '~' at the wrong place:
>
> | | * | ~ 9f0d1c2 gitk: sanitize 'exec' arguments: simple cases
> | | * | ~ 6eb797f gitk: have callers of diffcmd supply pipe symbol...
> | | * | ~ b966b73 gitk: treat file names beginning with "|" as...
> * | | | ~ 0c8be6f Merge branch 'ah/fix-open-with-stdin'
> |\| | |~           <-- this is line 166
> | * | | ~ 8e3070a (...) gitk: encode arguments correctly with "open"
> * | | | ~ bfb0fa7 Merge branch 'top-panel-search-highlight' of ...
> |\ \ \ \~
> | * | | ~ 9cad4a9 gitk: do not hard-code color of search results...
>
> I haven't tried to find out what is going wrong here or to simplify the
> reproducer.

IIRC there's one place where the ~ padding comes from if it's in an uneven column, I think it might be what's failing. Thanks.

>
> -- Hannes
>

I'm still new to Git and even though I've read the documentation I may have missed something, if something about what I'm saying to do (The RFC, holding this) is wrong please let me know.

Thanks for the feedback and the reviews, Pablo.

Previous: Johannes SixtNext: Junio C Hamano
Message 42 of 48 in “graph: add --graph-max option to limit displayed columns”
  1. graph: add --graph-max option to limit displayed columnsPablo Sabater, Mar 16, 2026
  2. Karthik NayakMar 16, 2026
  3. PabloMar 16, 2026
  4. graph: add --max-columns option to limit displayed columnsPablo Sabater, Mar 17, 2026
  5. Junio C HamanoMar 18, 2026
  6. PabloMar 18, 2026
  7. Johannes SixtMar 19, 2026
  8. 0/3 graph: add --graph-lane-limit optionPablo Sabater, Mar 22, 2026
  9. 1/3 graph: add --graph-lane-limit optionPablo Sabater, Mar 22, 2026
  10. 2/3 graph: truncate graph visual outputPablo Sabater, Mar 22, 2026
  11. 3/3 graph: add documentation and testing about --graph-lane-limitPablo Sabater, Mar 22, 2026
  12. Junio C HamanoMar 22, 2026
  13. PabloMar 23, 2026
  14. 0/3 graph: add --graph-lane-limit optionPablo Sabater, Mar 23, 2026
  15. 1/3 graph: add --graph-lane-limit optionPablo Sabater, Mar 23, 2026
  16. SZEDER GáborMar 25, 2026
  17. Johannes SixtMar 25, 2026
  18. PabloMar 25, 2026
  19. 2/3 graph: truncate graph visual outputPablo Sabater, Mar 23, 2026
  20. Johannes SixtMar 25, 2026
  21. PabloMar 25, 2026
  22. 3/3 graph: add documentation and tests about --graph-lane-limitPablo Sabater, Mar 23, 2026
  23. Johannes SixtMar 25, 2026
  24. PabloMar 25, 2026
  25. Johannes SixtMar 25, 2026
  26. PabloMar 25, 2026
  27. Johannes SixtMar 25, 2026
  28. PabloMar 25, 2026
  29. 0/2 graph: add --graph-lane-limit optionPablo Sabater, Mar 25, 2026
  30. 1/2 graph: add --graph-lane-limit optionPablo Sabater, Mar 25, 2026
  31. Junio C HamanoMar 25, 2026
  32. PabloMar 27, 2026
  33. PabloMar 27, 2026
  34. Junio C HamanoMar 27, 2026
  35. 2/2 graph: add documentation and tests about --graph-lane-limitPablo Sabater, Mar 25, 2026
  36. 0/3 graph: add --graph-lane-limit optionPablo Sabater, Mar 28, 2026
  37. 1/3 graph: limit the graph width to a hard-coded maxPablo Sabater, Mar 28, 2026
  38. 2/3 graph: add --graph-lane-limit optionPablo Sabater, Mar 28, 2026
  39. 3/3 graph: add truncation mark to capped lanesPablo Sabater, Mar 28, 2026
  40. Junio C HamanoMar 31, 2026
  41. Johannes SixtApr 1, 2026
  42. PabloApr 1, 2026
  43. Junio C HamanoApr 1, 2026
  44. PabloApr 2, 2026
  45. Junio C HamanoApr 2, 2026
  46. Tian YuchenApr 3, 2026
  47. PabloApr 3, 2026
  48. Junio C HamanoApr 3, 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.