From: 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣 <velocifyer@velocifyer•com>
To: Junio C Hamano <gitster@pobox•com>,
Nico Williams <nico@cryptonector•com>
Cc: git@vger•kernel.org
Subject: Re: 0-Based indexes for git log
Date: Wed, 24 Sep 2025 13:11:35 -0400 [thread overview]
Message-ID: <771fc44e-32d4-4758-b497-bcef86433446@velocifyer.com> (raw)
In-Reply-To: <xmqqh5wrn66m.fsf@gitster.g>
[-- Attachment #1.1: Type: text/plain, Size: 901 bytes --]
>> 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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
next prev parent reply other threads:[~2025-09-24 17:11 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 ` 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣 [this message]
2025-09-24 17:28 ` Ben Knoble
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=771fc44e-32d4-4758-b497-bcef86433446@velocifyer.com \
--to=velocifyer@velocifyer$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=nico@cryptonector$(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