git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: 0-Based indexes for git log

From
Emily Shaffer <nasamuffin@google.com>
Date
Sep 24, 2025, 17:22 UTC
Message-ID
<CAJoAoZkhqF83gsT963X81zZZi0wvYV9umEoXaArVpan6nDCoDg@mail.gmail.com>
In-Reply-To
<f1599790-b48c-4c37-8cf7-4756f5064d2e@velocifyer.com>

On Wed, Sep 24, 2025 at 10:15 AM 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣 <velocifyer@velocifyer.com> wrote:

Show 9 quoted lines
>
> > 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)
> >
> I suggest git adds a config option for 0-based date and automaticly uses
> 0-based date if there is a file at $HOME/use-0-based-index-for-date or
> $USE-0-BASED-INDEX-FOR-DATE == true

Git uses strftime from libc for date formatting. strftime[1] doesn't offer a way to format the date as you prefer - what you're asking for appears to be a personal preference, not a standard in any community of the world. I think that your best bet would be to attempt to contribute an option to strftime to render the day of the month from 0-30, but I would be surprised if such a contribution were to be welcomed - as, again, this looks like a preference held by very few. Based on my quick refresher through date.[ch] in the Git codebase, it would be infeasible to add such a flag and custom formatting.

However, Git is open source software, and you're fully welcome to patch your copy of Git to accept such a config (or this ~/some-file, which is not a way Git typically sets configuration) and build it yourself locally.

1: https://www.man7.org/linux/man-pages/man3/strftime.3.html
>
> --
> George truly, 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣
> This email does not constitute a legally binding contract
Previous: 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣Next: 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣
Message 16 of 17 in “0-Based indexes for git log”
  1. 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣Sep 23, 2025
  2. Ben KnobleSep 24, 2025
  3. 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣Sep 24, 2025
  4. Ben KnobleSep 24, 2025
  5. Jeff KingSep 24, 2025
  6. 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣Sep 24, 2025
  7. Nico WilliamsSep 24, 2025
  8. Junio C HamanoSep 24, 2025
  9. 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣Sep 24, 2025
  10. Ben KnobleSep 24, 2025
  11. Patrick SteinhardtSep 25, 2025
  12. Junio C HamanoSep 25, 2025
  13. 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣Sep 24, 2025
  14. Nico WilliamsSep 24, 2025
  15. 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣Sep 24, 2025
  16. Emily ShafferSep 24, 2025
  17. 𝕍𝕖𝕝𝕠𝕔𝕚𝕗𝕪𝕖𝕣Sep 24, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.