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

How Does "git log --reverse" Work?

From
Jon Forrest <nobozo@gmail.com>
Date
Dec 30, 2025, 00:18 UTC
Message-ID
<16fc8ecb-01f7-4056-be58-e3aa20345f77@gmail.com>

I'm trying to understand how 'git log --reverse' displays commits in reverse order (i.e. oldest commit first).

The fact that each commit object has pointer(s) to parent object(s) makes it trivial to go newest to oldest. But, I haven't found a way to go oldest to newest.

I've looked at the code but it's not well commented. Does the answer have something to do with commit lists?

Any advice would be appreciated.

Cordially, Jon Forrest

Next: Junio C Hamano
Message 1 of 2 in “How Does "git log --reverse" Work?”
  1. Jon ForrestDec 30, 2025
  2. Junio C HamanoDec 30, 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.