Subject: Re: [PATCH v5] revision.c: implement --max-count-oldest

From: Mirko Faina <[email-masked]>
Date: Mon, 4 May 2026 15:08:14 +0200

On Mon, May 04, 2026 at 02:19:47PM +0900, Junio C Hamano wrote:
> Mirko Faina <[email-masked]> writes:
> 
> > --max-count is a commit limiting option sets a maximum amount of commits
> > to be shown. If a user wants to see only the first N commits of the
> > history (the oldest commits) they'd have to combine --max-count with
> > --skip. This is not very user-friendly.
> 
> To use "--skip=<n>" for this purose, you'd need to know how many
> records are going to be omitted to begin with, but that means you'd
> run the command without count limitation once only to find out how
> many records there are.  "not very user-friendly" sounds like an
> understatement of the year.
> 
> They can do with something silly like
> 
>     git rev-list ... |
>     tail -n N |
>     xargs -n1 git show ...
> 
> and that does count as "not very user-friendly", I would think.

Will reword in v6.

> > Teach get_revision() the --max-count-oldest option.
> >
> > Signed-off-by: Mirko Faina <[email-masked]>
> > ---
> >  Documentation/rev-list-options.adoc |  3 ++
> >  revision.c                          | 77 +++++++++++++++++++++++++++--
> >  revision.h                          |  2 +
> >  t/t4202-log.sh                      | 14 ++++++
> >  4 files changed, 93 insertions(+), 3 deletions(-)
> 
> It looks like this needs measurably smaller damage to the codebase
> than the other --reverse=before approach ;-).

Yes, the control flow of the program is also easier to read.

Thanks