Subject: Re: 0-Based indexes for git log

From: 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣<[email-masked]>
Date: Wed, 24 Sep 2025 13:11:35 -0400

>> Day of month numbers are 1-based.
> Correct.
No, day of month numbers are 0-based.
> 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.
HEAD~1 just means HEAD - 1 commit.(AKA "reverse 0-based index")
>   * reflog entries are 1-based.  @{1} is the "previous object pointed
>     by the current branch", @{2} is one before that.  @{0} is the
>     current branch itself.
No, that is just a reverse 0-based index.
>   * stash entries are counted 0-based.  "git stash list" shows from
>     stash@{0} that is the most recently created stash entry.

That is correct. It's a reverse 0-based index becuase it uses reflog syntax.

-- 
George truly, 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣
This email does not constitute a legally binding contract