Git development
 help / color / mirror / Atom feed
From: "Pablo Sabater" <pabloosabaterr@gmail.com>
To: "herr.kaste" <herr.kaste@gmail.com>, <git@vger.kernel.org>
Cc: "Pablo Sabater" <pabloosabaterr@gmail.com>,
	"Karthik Nayak" <karthik.188@gmail.com>,
	"Chandra Pratap" <chandrapratap3519@gmail.com>
Subject: Re: log --graph draws an orphaned branch with parents
Date: Tue, 03 Nov 2026 21:27:04 +0000	[thread overview]
Message-ID: <DMLW72EXMN1K.3IXVPHWNYQ3EH@gmail.com> (raw)
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:
> 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.

>  /
> | * 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

  reply	other threads:[~2026-11-03 21:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 19:00 log --graph draws an orphaned branch with parents herr.kaste
2026-11-03 19:25 ` herr.kaste
2026-11-03 21:27   ` Pablo Sabater [this message]
2026-11-03 21:29     ` Pablo Sabater
2026-11-03 21:51       ` herr.kaste
2026-11-03 22:40         ` Pablo Sabater
2026-11-03 23:11 ` [PATCH] graph: do not indent visual roots with columns to their right Caspar Duregger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DMLW72EXMN1K.3IXVPHWNYQ3EH@gmail.com \
    --to=pabloosabaterr@gmail.com \
    --cc=chandrapratap3519@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=herr.kaste@gmail.com \
    --cc=karthik.188@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox