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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 27, 2010, 22:28 UTC
Message-ID
<7vsk9rnpxo.fsf@alter.siamese.dyndns.org>
In-Reply-To
<201001272309.26054.j6t@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
Show 25 quoted lines
> On Mittwoch, 27. Januar 2010, Michael Spang wrote:
>> Using --max-count with --reverse currently outputs the last N commits
>> in the final output rather than the first N commits. We want to
>> truncate the reversed list after the first few commits, rather than
>> truncating the initial list and reversing that.
>
> 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?

The interaction between --max-count and --reverse was designed a long time ago to support "I want to review the recent N commits in order to make sure that they are natural and logical progression". So an unconditional change of semantics to break that expectation this late in the game will never be acceptable, and giving title to such a patch with a word "Fix" won't fly well (it simply _breaks_ behaviour users have long learned to expect).

It is a different matter to add an explicit command line option (and no configuration to change it to default) to apply reversal before count limiting.

Previous: Michael SpangNext: Michael Spang
Message 5 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.