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

Re: log --graph draws an orphaned branch with parents

From
Pablo Sabater <pabloosabaterr@gmail.com>
Date
Nov 3, 2026, 21:27 UTC
Message-ID
<DMLW72EXMN1K.3IXVPHWNYQ3EH@gmail.com>
In-Reply-To
<CAFzd1+5s6V+YC3onNjYQmxRPVnsMROpsVi=qy1mg2=LOAnU+gg@mail.gmail.com>
On Tue Nov 3, 2026 at 7:25 PM WET, herr.kaste wrote:
Show 13 quoted lines
> Finally had time for a repro (tested with git 2.56.0.windows.3):
>
> sh
> git init -q -b main repro && cd repro
> export GIT_COMMITTER_DATE="@1700000000 +0000"
> GIT_AUTHOR_DATE="@1700000000 +0000"
> git commit -q --allow-empty -m B
> git switch -q -c topic
> git commit -q --allow-empty -m T
> git switch -q --orphan orphan
> git commit -q --allow-empty -m R
> git merge -q --allow-unrelated-histories --no-ff -m M main
> git log --graph --oneline --all
Hi!
Thanks for the repro and the bug report.
>
> Actual output:

The bug is because the indentation state GRAPH_PRE_ROOT is being triggered, due to "R" being a root. What this state does is add a new row to connect the indentation:

>
> *   40a81a9 M
> |\
>  \ |

^^^ This one

>   * | 1d9120a R
Then it pushes everything to the right.
Show 14 quoted lines
>  /
> | * 5a29a85 T
> |/
> * f1cd12c B
>
> With --no-graph-indent:
>
> *   40a81a9 M
> |\
> * | 1d9120a R
>  /
> | * 5a29a85 T
> |/
> * f1cd12c B

The fix should be that the rendering of the graph is the same with the indentation or without it, as there is nothing ambiguous in this case that needs it.

I think I may be able to see how to fix it tomorrow, but I'm quite busy until next week.

Regards, Pablo

Previous: herr.kasteNext: Pablo Sabater
Message 3 of 9 in “log --graph draws an orphaned branch with parents”
  1. herr.kasteOct 13, 2026
  2. herr.kasteNov 3, 2026
  3. Pablo SabaterNov 3, 2026
  4. Pablo SabaterNov 3, 2026
  5. herr.kasteNov 3, 2026
  6. Pablo SabaterNov 3, 2026
  7. graph: do not indent visual roots with columns to their rightCaspar Duregger, Nov 3, 2026
  8. Pablo SabaterNov 3, 2026
  9. Junio C HamanoNov 4, 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.