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

Re: Why does "git log --reverse -1" print the HEAD commit?

From
Miklos Vajna <vmiklos@frugalware.org>
Date
May 31, 2008, 14:24 UTC
Message-ID
<20080531142408.GL29404@genesis.frugalware.org>
In-Reply-To
<20080531141102.GA3035@mithlond.arda.local>
On Sat, May 31, 2008 at 05:11:02PM +0300, Teemu Likonen <tlikonen@iki.fi> wrote:
Show 5 quoted lines
> It feels wrong that "git log -1" and "git log --reverse -1" both print
> the same commit: HEAD. Why is that?
> 
> Since "git log --reverse" starts from the bottom I'd have expected "-1"
> to print one commit from the bottom.

-1 limits the commit list to one element and then it prints that range in reverse order, which is the same for a single commit.

Previous: Teemu LikonenNext: Teemu Likonen
Message 2 of 3 in “Why does "git log --reverse -1" print the HEAD commit?”
  1. Teemu LikonenMay 31, 2008
  2. Miklos VajnaMay 31, 2008
  3. Teemu LikonenMay 31, 2008

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.