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