public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Ben Knoble <ben.knoble@gmail•com>
To: Junio C Hamano <gitster@pobox•com>
Cc: "Nico Williams" <nico@cryptonector•com>,
	𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣 <velocifyer@velocifyer•com>,
	git@vger•kernel.org
Subject: Re: 0-Based indexes for git log
Date: Wed, 24 Sep 2025 13:28:31 -0400	[thread overview]
Message-ID: <95F22D6A-38D9-4F4D-B71E-59320B86B4E8@gmail.com> (raw)
In-Reply-To: <xmqqh5wrn66m.fsf@gitster.g>


> Le 24 sept. 2025 à 12:53, Junio C Hamano <gitster@pobox•com> a écrit :
> 
> Nico Williams <nico@cryptonector•com> 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? :)

  parent reply	other threads:[~2025-09-24 17:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-23 21:15 0-Based indexes for git log 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣
2025-09-24  2:12 ` Ben Knoble
2025-09-24 13:46   ` 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣
2025-09-24 15:26     ` Ben Knoble
2025-09-24  5:22 ` Jeff King
2025-09-24 13:42   ` 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣
2025-09-24 15:43 ` Nico Williams
2025-09-24 16:53   ` Junio C Hamano
2025-09-24 17:11     ` 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣
2025-09-24 17:28     ` Ben Knoble [this message]
2025-09-25  5:46       ` Patrick Steinhardt
2025-09-25 13:25       ` Junio C Hamano
2025-09-24 17:01   ` 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣
2025-09-24 17:04     ` Nico Williams
2025-09-24 17:15 ` 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣
2025-09-24 17:22   ` Emily Shaffer
2025-09-24 17:18 ` 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣

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=95F22D6A-38D9-4F4D-B71E-59320B86B4E8@gmail.com \
    --to=ben.knoble@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=nico@cryptonector$(echo .)com \
    --cc=velocifyer@velocifyer$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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