From: "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Patrick Steinhardt <ps@pks.im>, Elijah Newren <newren@gmail.com>,
Derrick Stolee <stolee@gmail.com>,
Elijah Newren <newren@gmail.com>,
Elijah Newren <newren@gmail.com>
Subject: [PATCH v3 2/6] receive-pack: avoid repeating connectivity errors
Date: Sun, 06 Sep 2026 07:24:56 +0000 [thread overview]
Message-ID: <74a52a632e81e12a0b3fceebb50756c4fa434bb5.1788679500.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.2208.v3.git.1788679500.gitgitgadget@gmail.com>
From: Elijah Newren <newren@gmail.com>
receive-pack first checks all proposed ref tips together. If that bulk
connectivity check fails, it checks each tip separately to identify
which ref updates need "missing necessary objects".
The bulk check already reports rev-list's diagnostic. The per-ref checks
repeat it merely as a side effect of attributing the failure,
potentially once for every broken ref. Silence their stderr while
retaining their exit status and the per-ref rejection.
Signed-off-by: Elijah Newren <newren@gmail.com>
---
builtin/receive-pack.c | 7 +++++++
t/t5410-receive-pack.sh | 6 ++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index e6e54ba55f..8079901bb6 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -1785,6 +1785,13 @@ static void set_connectivity_errors(struct command *commands,
/* to be checked in update_shallow_ref() */
continue;
+ /*
+ * The bulk check already reported rev-list's diagnostics;
+ * this per-ref pass only attributes the failure, so keep it
+ * quiet rather than repeat those errors for every ref.
+ */
+ opt.quiet = 1;
+
odb_transaction_env(transaction, &env);
opt.env = env.v;
diff --git a/t/t5410-receive-pack.sh b/t/t5410-receive-pack.sh
index 09d6bfd2a1..20d221044f 100755
--- a/t/t5410-receive-pack.sh
+++ b/t/t5410-receive-pack.sh
@@ -68,9 +68,11 @@ test_expect_success TEE_DOES_NOT_HANG \
# Replay captured git-send-pack(1) output on new empty repository.
git init --bare remote.git &&
git receive-pack remote.git <out >actual 2>err &&
+ depacketize <actual >actual.raw &&
- test_grep "missing necessary objects" actual &&
- test_grep "fatal: Failed to traverse parents" err &&
+ test_grep "missing necessary objects" actual.raw &&
+ test_grep "fatal: Failed to traverse parents" actual.raw &&
+ test_must_be_empty err &&
test_must_fail git -C remote.git cat-file -e $(git -C repo rev-parse HEAD)
'
--
gitgitgadget
next prev parent reply other threads:[~2026-09-06 7:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 6:55 [PATCH] send-pack: avoid sending the whole tree when pushing from a shallow clone Elijah Newren via GitGitGadget
2026-08-21 13:17 ` Patrick Steinhardt
2026-08-21 17:36 ` Elijah Newren
2026-08-21 18:21 ` Elijah Newren
2026-08-24 5:30 ` Patrick Steinhardt
2026-08-25 5:00 ` Elijah Newren
2026-09-02 19:05 ` Derrick Stolee
2026-09-02 20:57 ` Elijah Newren
2026-08-25 19:06 ` [PATCH v2] " Elijah Newren via GitGitGadget
2026-09-02 18:23 ` Derrick Stolee
2026-09-03 9:22 ` Elijah Newren
2026-09-06 7:24 ` [PATCH v3 0/6] " Elijah Newren via GitGitGadget
2026-09-06 7:24 ` [PATCH v3 1/6] unpack-objects: distinguish missing objects from type mismatches Elijah Newren via GitGitGadget
2026-09-06 7:24 ` Elijah Newren via GitGitGadget [this message]
2026-09-06 7:24 ` [PATCH v3 3/6] shallow: reject missing boundaries without disconnecting Elijah Newren via GitGitGadget
2026-09-06 7:24 ` [PATCH v3 4/6] send-pack: optionally omit shallow boundaries Elijah Newren via GitGitGadget
2026-09-06 7:24 ` [PATCH v3 5/6] send-pack: default to excluding " Elijah Newren via GitGitGadget
2026-09-06 7:25 ` [PATCH v3 6/6] send-pack: advise splitting incomplete shallow pushes Elijah Newren 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=74a52a632e81e12a0b3fceebb50756c4fa434bb5.1788679500.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=newren@gmail.com \
--cc=ps@pks.im \
--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