From: Ben Knoble Date: Wed, 24 Sep 2025 17:28:31 GMT Subject: Re: 0-Based indexes for git log Message-ID: <95F22D6A-38D9-4F4D-B71E-59320B86B4E8@gmail.com> In-Reply-To: > Le 24 sept. 2025 Γ  12:53, Junio C Hamano a Γ©crit : > > ο»ΏNico Williams writes: > >>> On Tue, Sep 23, 2025 at 05:15:46PM -0400, π•π•–π•π• π•”π•šπ•—π•ͺ𝕖𝕣 wrote: >>> In git log it uses a 1-based index for the date instead of a 0 based index. >>> So it says "Fri Sep 19 14:23:24 2025 -0400" when it should say "Fri Sep 18 >>> 14:23:24 2025 -0400" (or "Friday 2025-8-18 14:23:24 (-4:00.00)" to get a >>> better format) >> >> Day of month numbers are 1-based. > > Correct. > > There are a few things in Git that are 0 based, but not so many. > > * parent numbers are 1-based. HEAD~1 is the "previous commit", aka > "first parent". HEAD~0 is the HEAD itself. > > * 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? :)