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

From: Mirko Faina <[email-masked]>
Date: Tue, 19 May 2026 03:04:06 +0200

On Tue, May 19, 2026 at 02:55:22AM +0200, Mirko Faina wrote:
> --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 do something like
> 
>     git log $(git rev-list HEAD | tail -n N | head -n 1)
> 
> This is not very user-friendly.
> 
> Teach get_revision() the --max-count-oldest option.
> 
> Signed-off-by: Mirko Faina <[email-masked]>
> ---
>  Documentation/rev-list-options.adoc |   5 +-
>  revision.c                          | 111 +++++++++++++++++++++++++++-
>  revision.h                          |   2 +
>  t/t4202-log.sh                      |  41 ++++++++++
>  4 files changed, 155 insertions(+), 4 deletions(-)

Sorry, forgot to write down what changed since v7. There was an issue
with the counting as --max-count-oldest counted boundary commits too.
That is simply solved by only adding on non boundaries.

That left another issue, there are now some "orphaned" boundaries when
printing the graph. In addition to that, because of how the graph
machinery works, the graph is now trying to include the parents of the
orphaned boundaries. To fix this we just flip the CHILD_SHOWN flag on
the parents of the commit we're discarding.

Hopefully this is the last version.