From: "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, j6t@kdbg.org, Derrick Stolee <stolee@gmail.com>
Subject: [PATCH 0/3] rev-list: use merge-base --independent algorithm when possible
Date: Mon, 06 Apr 2026 13:27:25 +0000 [thread overview]
Message-ID: <pull.2082.git.1775482048.gitgitgadget@gmail.com> (raw)
The --maximal-only option was added to git rev-list in b4e8f60a3c (revision:
add --maximal-only option, 2026-01-22) and the discussion [1] included talks
of how 'git rev-list --maximal-only <refs>' acts the same as 'git merge-base
--independent <refs>' assuming that no other walk modifiers are provided to
the revision walk. And with those assumptions, the merge-base algorithm can
be faster if the refs have most of their history shared.
[1]
https://lore.kernel.org/git/pull.2032.v2.git.1769097958549.gitgitgadget@gmail.com/
This series updates the revision walk to use the merge-base algorithm when
possible. This checks the rev_info struct for options that cause the walk to
be different and also looks for negative references. If none of these
appear, then the merge-base algorithm is used instead.
The series is broken into three patches that could theoretically be squashed
into a single patch.
1. The first demonstrates the equivalence of these two commands via some
tests.
2. The second creates a performance test and documents the current
behavior.
3. The third updates the implementation and demonstrates the improvement in
the case of no walk modifiers.
Thanks, -Stolee
Derrick Stolee (3):
t6600: test --maximal-only and --independent
p6011: add perf test for rev-list --maximal-only
rev-list: use reduce_heads() for --maximal-only
builtin/rev-list.c | 59 ++++++++++++++++++++++++++++++++
t/perf/p6011-rev-list-maximal.sh | 29 ++++++++++++++++
t/t6000-rev-list-misc.sh | 31 +++++++++++++++++
t/t6600-test-reach.sh | 45 ++++++++++++++++++++++++
4 files changed, 164 insertions(+)
create mode 100755 t/perf/p6011-rev-list-maximal.sh
base-commit: ca1db8a0f7dc0dbea892e99f5b37c5fe5861be71
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2082%2Fderrickstolee%2Fmaximal-faster-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2082/derrickstolee/maximal-faster-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2082
--
gitgitgadget
next reply other threads:[~2026-04-06 13:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-06 13:27 Derrick Stolee via GitGitGadget [this message]
2026-04-06 13:27 ` [PATCH 1/3] t6600: test --maximal-only and --independent Derrick Stolee via GitGitGadget
2026-04-06 13:27 ` [PATCH 2/3] p6011: add perf test for rev-list --maximal-only Derrick Stolee via GitGitGadget
2026-04-06 13:27 ` [PATCH 3/3] rev-list: use reduce_heads() for --maximal-only Derrick Stolee via GitGitGadget
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.2082.git.1775482048.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j6t@kdbg.org \
--cc=stolee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox