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

Re: [PATCH] Fix git rev-list --reverse --max-count=N

From
MSMichael Spang <spang@google.com>
Date
Jan 27, 2010, 22:21 UTC
Message-ID
<abef960f1001271421s6c0f72f7xd2697ab34b53d1ea@mail.gmail.com>
In-Reply-To
<201001272309.26054.j6t@kdbg.org>
On Wed, Jan 27, 2010 at 5:09 PM, Johannes Sixt <j6t@kdbg.org> wrote:
Show 21 quoted lines
> On Mittwoch, 27. Januar 2010, Michael Spang wrote:
>
> So when you have this history (A is oldest, D is newest):
>
>   A--B--C--D
>
> and you say
>
>   git log --max-count=2 --reverse D
>
> then you want
>
>   A
>   B
>
> but I want
>
>   C
>   D
>
> Why is your interpretation correct, an mine wrong?

Perhaps not wrong, but for me it was unexpected. For whatever reason, I expected "--reverse" to give you the illusion that you are iterating from the beginning of the history, even if it's not actually possible to iterate that way directly. In line with that, limiting the output to N commits would give you the earliest N commits. If you instead think "stop descending through the history once we have N commits" the current behavior makes sense.

I talked to Junio and he says the current behavior is here to stay.
Michael
Previous: Sverre RabbelierNext: Junio C Hamano
Message 4 of 6 in “Fix git rev-list --reverse --max-count=N”
  1. Fix git rev-list --reverse --max-count=NMichael Spang, Jan 27, 2010
  2. Johannes SixtJan 27, 2010
  3. Sverre RabbelierJan 27, 2010
  4. Michael SpangJan 27, 2010
  5. Junio C HamanoJan 27, 2010
  6. Michael SpangJan 27, 2010

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.