From: Patrick Steinhardt <ps@pks.im>
To: Taylor Blau <ttaylorr@openai.com>
Cc: git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>,
"Jeff King" <peff@peff.net>, "Elijah Newren" <newren@gmail.com>,
"Jonathan Tan" <jonathantanmy@fastmail.com>,
"René Scharfe" <l.s.r@web.de>,
"Derrick Stolee" <stolee@gmail.com>,
"Ted Nyman" <tnyman@openai.com>,
"Daniel Reynaud" <dreynaud@openai.com>,
"Aaron Friel" <friel@openai.com>
Subject: Re: [PATCH] negotiator/skipping.c: parse parents before queueing
Date: Wed, 21 Oct 2026 08:49:27 +0200 [thread overview]
Message-ID: <athgd6Ya12zRdIR_@pks.im> (raw)
In-Reply-To: <dc3dfa3647c42da9170bf3289f4e8a4a8a55c8e2.1792441003.git.me@ttaylorr.com>
On Mon, Oct 19, 2026 at 03:17:07PM -0500, Taylor Blau wrote:
> diff --git a/negotiator/skipping.c b/negotiator/skipping.c
> index db90fa77b53..ed6e88b59b4 100644
> --- a/negotiator/skipping.c
> +++ b/negotiator/skipping.c
> @@ -151,6 +151,9 @@ static int push_parent(struct data *data, struct entry *entry,
> parent_found:
> ;
> } else {
> + /* Parse the parent before using its date to order the queue. */
> + if (repo_parse_commit(the_repository, to_push))
> + return 0;
> parent_entry = rev_list_push(data, to_push, 0);
> }
Why do you parse the commit in `push_parent()` instead of parsing it in
`rev_list_push()`? The latter would also cover the other two callsites
that call it, and to me it's not clear why they wouldn't want to parse
the commits before adding it to the queue.
Doing so in `rev_list_push()` would also bring it in line with the
default negotiator.
There's also another call to `repo_parse_commit()` in `get_rev()`. Once
we start parsing the commit in `rev_list_push()` we could drop that call
as we'd know that every commit in the queue is parsed already.
> diff --git a/t/t5552-skipping-fetch-negotiator.sh b/t/t5552-skipping-fetch-negotiator.sh
> index 96e224168eb..7a0b9b32474 100755
> --- a/t/t5552-skipping-fetch-negotiator.sh
> +++ b/t/t5552-skipping-fetch-negotiator.sh
> @@ -223,4 +223,37 @@ test_expect_success 'do not send "have" with ancestors of commits that server AC
> have_sent b2.c1 b2.c0
> '
>
> +test_expect_success 'recent ancestors are sent before old ref tips' '
> + rm -rf server client trace &&
> + git init server &&
> + test_tick=2000000000 &&
> + test_commit -C server --no-tag base &&
> + test_commit -C server --no-tag parent &&
> + test_commit -C server --no-tag main &&
> + git clone server client &&
> + test_commit -C server --no-tag to_fetch &&
> +
> + git -C client checkout -b topic &&
> + test_commit -C client --no-tag topic &&
> +
> + # These old tips have known dates, but the recent parent has no ref.
> + # Without parsing parents before queueing them, its date is zero and
> + # all of these tips are sent first, delaying it past the first batch.
> + for i in $(test_seq 32)
> + do
> + old=$(echo "old $i" |
> + GIT_AUTHOR_DATE="1000000000 +0000" \
> + GIT_COMMITTER_DATE="1000000000 +0000" \
> + git -C client commit-tree HEAD^{tree}) &&
> + git -C client update-ref refs/heads/old-$i "$old" || return 1
> + done &&
> +
> + test_config -C client fetch.negotiationalgorithm skipping &&
> + trace_fetch client origin &&
> + git -C client rev-parse HEAD HEAD~2 >expect &&
> + sed -n "s/.*fetch> have //p" trace >haves &&
> + sed -n "1,2p" haves >actual &&
Nit: `head -n2 haves >actual`
Thanks!
Patrick
next prev parent reply other threads:[~2026-10-21 6:49 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 20:17 [PATCH] negotiator/skipping.c: parse parents before queueing Taylor Blau
2026-10-21 6:49 ` Patrick Steinhardt [this message]
2026-10-21 19:02 ` Junio C Hamano
2026-10-22 20:38 ` Taylor Blau
2026-10-22 21:46 ` Junio C Hamano
2026-10-22 22:49 ` Taylor Blau
2026-10-22 21:21 ` [PATCH v2] " Taylor Blau
2026-10-22 22:34 ` Junio C Hamano
2026-10-22 22:48 ` Taylor Blau
2026-10-23 14:30 ` Junio C Hamano
2026-10-24 0:03 ` Taylor Blau
2026-10-24 2:06 ` Junio C Hamano
2026-10-26 23:49 ` [PATCH v3 0/2] negotiator: parse commits " Taylor Blau
2026-10-26 23:49 ` [PATCH v3 1/2] negotiator/default.c: mark commits seen only after parsing Taylor Blau
2026-10-26 23:49 ` [PATCH v3 2/2] negotiator/skipping.c: parse parents before queueing Taylor Blau
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=athgd6Ya12zRdIR_@pks.im \
--to=ps@pks.im \
--cc=dreynaud@openai.com \
--cc=friel@openai.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jonathantanmy@fastmail.com \
--cc=l.s.r@web.de \
--cc=newren@gmail.com \
--cc=peff@peff.net \
--cc=stolee@gmail.com \
--cc=tnyman@openai.com \
--cc=ttaylorr@openai.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