Subject: Re: 0-Based indexes for git log

From: Patrick Steinhardt <[email-masked]>
Date: Thu, 25 Sep 2025 07:46:45 +0200

On Wed, Sep 24, 2025 at 01:28:31PM -0400, Ben Knoble wrote:
> > * merge parent numbers are 2-based (sanity of this statement is
> >   already questionable).  If HEAD is a merge, HEAD~2 is the
> >   "(first) side branch that was merged", HEAD~3 is the "(second)
> >   side brnach that was merged (in an octopus merge), and so on.
> 
> HEAD^2, 3, etc., rather? :)

Probably. I also always regarded this as the nth parent, not the nth
merge parent. HEAD^1 returns the first parent even for non-merges,
HEAD^2 the second and so on. So I'd claim these are also 1-based.

Patrick