Article View: linux.kernel.git
Article #4263[PATCH v6 0/3] bundle-uri: do not die on unresolvable relative URIs
From: Aniket Gupta
Date: Wed, 02 Dec 2026 20:46
Date: Wed, 02 Dec 2026 20:46
133 lines
16159 bytes
16159 bytes
A bundle list can contain a relative URI that cannot be resolved and
one such entry can result in the entire clone dying. This series lets
the bundle code report it and the clone carry on.
Changes in v6:
* Patch 3: also drop the bundle when a uri key has no value, so that
both cases are handled the same way (Patrick). The code that drops a
bundle is now a small helper as it is used twice.
Changes in v5:
* Patch 3: drop the bundle from the list when its URI cannot be
resolved. A list that a server advertises no longer reports that
bundle a second time as having no uri (Junio). Added a clone test
for it.
Changes in v4:
* Patch 2: dropped the part that hides credentials as Stolee was not
convinced it is needed. The part that names the URL that was passed
in stays, as Patrick wanted. The patch has a new title and its test
no longer uses a password.
* Patch 3: fixed the commit message. Previously it said that the
clone carries on with the other bundles. That is true only for the
bundles before the bad entry, in a list that a server advertises. A
list given to --bundle-uri is rejected as a whole. In both cases,
the clone fetches the rest from the remote. No code change.
Aniket Gupta (3):
remote: add relative_url_gently()
remote: name the original URL when relative_url() fails
bundle-uri: do not die on unresolvable relative URIs
bundle-uri.c | 29 ++++++++++++++++++++++++++---
remote.c | 34 ++++++++++++++++++++++++++++------
remote.h | 8 ++++++++
t/t0060-path-utils.sh | 9 +++++++++
t/t5558-clone-bundle-uri.sh | 16 ++++++++++++++++
t/t5750-bundle-uri-parse.sh | 24 ++++++++++++++++--------
6 files changed, 103 insertions(+), 17 deletions(-)
Range-diff against v5:
1: 0f15f6c89c = 1: 0f15f6c89c remote: add relative_url_gently()
2: bcec8bf453 = 2: bcec8bf453 remote: name the original URL when relative_url() fails
3: ed34ce04d2 ! 3: 16e6441992 bundle-uri: do not die on unresolvable relative URIs
@@ Commit message
Resolve them with relative_url_gently() instead. When that fails,
bundle_list_update() reports the problem as an error, drops the bundle,
which has no URI to use, and stops parsing the list. Dropping it keeps
- the clone from complaining a second time that the bundle has no URI.
+ the clone from complaining a second time that the bundle has no URI. A
+ "uri" key without a value is handled in the same way.
What happens then depends on where the list came from. For a list
advertised by a server, the bundles before the bad entry are still
@@ Commit message
Signed-off-by: Aniket Gupta <aniketgupta3001@gmail.com>
## bundle-uri.c ##
+@@ bundle-uri.c: void print_bundle_list(FILE *fp, struct bundle_list *list)
+ for_all_bundles_in_list(list, summarize_bundle, fp);
+ }
+
++/*
++ * Remove a bundle from the list when its URI cannot be used, so that the
++ * list does not keep an entry without a URI.
++ */
++static int drop_bundle(struct bundle_list *list,
++ struct remote_bundle_info *bundle)
++{
++ hashmap_remove(&list->bundles, &bundle->ent, NULL);
++ clear_remote_bundle_info(bundle, NULL);
++ free(bundle);
++ return -1;
++}
++
+ /**
+ * Given a key-value pair, update the state of the given bundle list.
+ * Returns 0 if the key-value pair is understood. Returns -1 if the key
@@ bundle-uri.c: static int bundle_list_update(const char *key, const char *value,
strbuf_release(&id);
if (!strcmp(subkey, "uri")) {
+- if (!value)
+- return config_error_nonbool(key);
+ struct strbuf err = STRBUF_INIT;
+
- if (!value)
- return config_error_nonbool(key);
++ if (!value) {
++ config_error_nonbool(key);
++ return drop_bundle(list, bundle);
++ }
if (bundle->uri)
return -1;
- bundle->uri = relative_url(list->baseURI, value, NULL);
@@ bundle-uri.c: static int bundle_list_update(const char *key, const char *value,
+ if (!bundle->uri) {
+ error("%s", err.buf);
+ strbuf_release(&err);
-+ hashmap_remove(&list->bundles, &bundle->ent, NULL);
-+ clear_remote_bundle_info(bundle, NULL);
-+ free(bundle);
-+ return -1;
++ return drop_bundle(list, bundle);
+ }
return 0;
}
@@ t/t5750-bundle-uri-parse.sh: test_expect_success 'bundle_uri_parse_line(): relat
'
test_expect_success 'bundle_uri_parse_line() parsing edge cases: empty key or value' '
+@@ t/t5750-bundle-uri-parse.sh: test_expect_success 'parse config format edge cases: keys without a value' '
+ done
+ '
+
++test_expect_success 'parse config format edge cases: a uri without a value drops the bundle' '
++ printf "[bundle]\n\tversion = 1\n\tmode = all\n[bundle \"one\"]\n\turi\n" >input &&
++
++ test_must_fail test-tool bundle-uri parse-config input >actual 2>err &&
++ test_grep "missing value for .bundle.one.uri." err &&
++ test_grep "mode = all" actual &&
++ test_grep ! "bundle .one." actual
++'
++
+ test_done
base-commit: acba8bf9753134d9bde89f94369f775838a8c5fe
--
2.54.0 (Apple Git-157)
Technical Details
Message-ID:
<20261202204608.97770-1-aniketgupta3001@gmail.com>Path:
mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-76900-linux-kernel-git=dewy.ruReferences:
<20261105152842.566318-1-aniketgupta3001@gmail.com> <20261126115803.30015-1-aniketgupta3001@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-76900-linux-kernel-git=dewy.ru
From: aniketgupta3001@gmail.com (Aniket Gupta)
Newsgroups: linux.kernel.git
Subject: [PATCH v6 0/3] bundle-uri: do not die on unresolvable relative URIs
Date: Thu, 3 Dec 2026 02:16:05 +0530
Organization: Usenet Network
Message-ID: <20261202204608.97770-1-aniketgupta3001@gmail.com>
References: <20261105152842.566318-1-aniketgupta3001@gmail.com> <20261126115803.30015-1-aniketgupta3001@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="2056273"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:eB0TBJPaibSoq+ObVXu0Uxfi4OY= sha256:MNeFLfis7jUTjG4l/1cP1WBuSIFcLcC+Lb6dgugD5po=
sha1:GIObeOlWaamGMaZ3AU/Rq6DyynU= sha256:e+pSpgL4aklWuZpzWcXOh8m/Bg9WEYoYdabDElpZ9wM=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id ADEA2117721; Wed, 2 Dec 2026 23:46:30 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.948
X-Spam-Status: No, score=-1.948 tagged_above=-9999 required=6.31
tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id j_ZFVX1dMtFB;
Wed, 2 Dec 2026 23:46:27 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-76900-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id B3CD81176FF; Wed, 2 Dec 2026 23:46:18 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 1679229B1A; Wed, 2 Dec 2026 20:46:17 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1796244377;
b=ApmAa15clJJZZxxhn2ob4mJobtEhvXzlepDH6tFxKhJZuIgrJmHrVehl328X6Cvm49/H
/4YM06+4ehY2e72EDMK6wpP51vlxC8cOi7gEg1iyN9+mtY/5SMVPQYxEto1YT5v0Q3H/9
AjXK7eOixuumGVOXGLXVotB+gOrmcAh2s0IBPIIC9yc6DIXiFeXIUmoAhKC432WfhnYe9
i8HvAqoB+JDZFTNQk5SMZK/v4RutCD0Q0xli6fzwAEOidkSXbNd/auE1ySPtc2+hbd4JR
CaFVyxNXEEKqDhUPR4H4dcPK52ggfFUfgSCVImPCMiiZXiag0Z9x/qXG/MAbVJSHf4Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796244377;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:
References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:
Content-Transfer-Encoding;
bh=YC+un1wiUOtugJKcxjL2W55uosYC4OKr8qPlcr2gAik=;
b=gpLww9htG5FUezFiFXBBkOJK2XtZ2uWqW/87qkBfhUpXSHTZbRudxXPRRRtG2OJgx0Xg
OmzCDjSDqou7OeOsTn6WYIe6dy2OlR7CEMYIlFW4qLqb05TMFs4cH8pHS/+YvYGgzFd6W
9t3RLelhEkYbBJrAJYZHxqGBNcmcPfhz47PReBJHAVDlHVsaj+ogu/8khL7c2VM3e7M5E
6dj3hAvDdtXYncHmX75m7HsQJ5fg5PLLy0x4xdH7cF0p6wtHDUDEV9vqAdsZ1h1R2SqTr
SoX7EWsmn+QC9Vb2ARFrlpf9kmK7pGE2O/zJpNqxFHUM3IcyVVa0M+KHP9g6KGPZ5TA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=ah3rlHeu;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id DE6D1606A333;
Wed, 2 Dec 2026 20:46:16 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=ah3rlHeu
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.176
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1796244376;
b=COLGQmlKGiKbwdph+cN4xs1QCv8n2Q1IzSvVnUdVdF1jaUcDk5sLkO8pL1ma2aNCaiN0
wQ7qFr2J80s0et9HcWgB0y3hCyjUR+FaWrIEWDR/0VDcSlh1U0Ga0oYG1RNkpX1C6Q/nE
eSWpv8Fhw0gqLUuYHJtl5B3urUnKffTi30alSN+Bw9gPkzo6i8IlZdFSl8IiHkj0yRIy/
3iVB8GfRk1Ak/vXsAw9FyyNxn1R1v2mesRJ64fZGbrwXT/b6sH2sOvpvpskjB9byH3NEv
D6m4KQSQdhXWnqFYsLWUB49+GPMxBBtCMdxcVWW7/5EukToNq8L4c9Xgs3nJOzONGUg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796244376;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
Content-Transfer-Encoding;
bh=YC+un1wiUOtugJKcxjL2W55uosYC4OKr8qPlcr2gAik=;
b=GYi7Nm3zy3Vlvd/JxJTnGdctSwdGzJuLFDQqqUqWM8hMT1zU1yQAxkzbRqS8Eo6bY4bY
Dx+mh8nxJgxG1Cj6a+bAuw1+vODrt7lIo6JKx7O/jnAY6resG1zIeRu04DY6M0Vi8p7To
O5eG1qlKJAKM/tqSyY3z35LhQ8HKpIq+H3uBML62bIza6y4Cv7hinweK9J586XSt6jJuB
UlQNz+yFYAkHrOFoba27KGK4Lr6BOfvUWJhnagDjqGGwgmT7DrMldKH33s2yx0bEiPnft
QBe3Z+BxLJVZ4mphrfr3E556J1jFrymfJQID5Bj2aGhc8NmtvGaA8nKW7cgxUaiPnTg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=ah3rlHeu;
arc=none smtp.remote-ip=74.125.82.176
X-Received: from mail-dy1-f176.google.com (mail-dy1-f176.google.com [74.125.82.176])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id A85F1606A32C
for <git@vger.kernel.org>; Wed, 2 Dec 2026 20:46:15 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A85F1606A32C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dy1-f176.google.com with SMTP id 5a478bee46e88-386c4d2e2ccso14464976eec.0
for <git@vger.kernel.org>; Wed, 02 Dec 2026 12:46:15 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1796244375; x=1796849175; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=YC+un1wiUOtugJKcxjL2W55uosYC4OKr8qPlcr2gAik=;
b=ah3rlHeug5TklMHfaNBGjRQSAgSYp6pHbVUD3wv0+vZUQcJ6Yhmi2R2QXqNu6wtBzA
frOvMe0Uf9IE+iY8i3eMF1r20s5JLr8cr3w1tXWshTJYQjaDxZVMrbvlBXEf29iEVilk
pUgFTePsoxLXgp8t0ZdOjLpwfOHQEAWUVUOIpL760SxMVsBBp5H+fI8eTQ08AUoPvOdC
qa1gvkBKkHBT5AUCwk6xBKlVg3sWnodUwYOqcP3DbDxio19PLhyVC2nIQc3Qkl22UaRP
jFgjlpzRDnpFKlHGS50FTBGMDEdRgVu+yDwA9KKTlxHFRQxNTvc8zix4zQv69bRMwfiB
hfkQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1796244375; x=1796849175;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
:to:cc:subject:date:message-id:reply-to:content-type;
bh=YC+un1wiUOtugJKcxjL2W55uosYC4OKr8qPlcr2gAik=;
b=Ialt3az68WEeStIQlpF6WLfTo11Uuf+t6pXwy7OqGeKLz9I8Gp75+gbpaiAR0cV6gN
kl9alfpgAMu6jU9Y3Tuo05SR8IDeYOdp9yZ4G5yoQR7iggAAbb348lo0iVgPf0TFdyS0
HOLui/SZqiFDhl8qwzaVAyadLyOuzAhP7KW8ist8Fq3h3lgliVRFdMGi/6ZVVHYOSr0e
J1vg1I59PEZIayoCKZu9IDpizzZrMjiPfVkjX/zio8sJdIIpb137duaox+yBvQ+HV4r/
tu8co9yftB1TPsqtKlYim7nDS1Q56/JQfOIzzI2gJrOjz6ZMjuK7d1Q6KanEEMyMLtto
X86w==
X-Gm-Message-State: APuU4Z+X+BF/bMymTUTc7kUfP6db+s6ncc/1MzGYzw8OrzN+iAcouYrU
DinMZJQlq15I97iPMZYnKKMR6HzCtXFW2PjOdgtM8izEov9+1RVekQ/98fE069ea
X-Gm-Gg: AZFdTZcxzZmlYQdaOOCBv7S6JdhLzZ2ospf6Alw4JgCW+7Aq97Lx6vBoooqc4wUPAP6
PHmfG0i8PvTA6h/JcG8SFou6lPlLQnmXjWOpgWhJiNF9FLe7Ax0bMdfapn4iow0W8ZDr0lXUVnL
siaRAApxS92ORA9m4uSv6hk5ntTmXL91tP/19PS0JAHdfgtBRH7tju/hIc0qOyES714tGrKjCxe
Yk7vcIYylLEyPbCeTJbnsKdEqeFQkoVZq+GlTlQnOUn5t/jv9mRz42FiDtXsMyamA98Rv/hueOe
ZJ0w5up94bGLe0xZuJXbLT5NljnQrbVvpdLBx4kpgHK71mfxEalf4/sAuos1UgB2B9ne6+UXoQ2
0IrwOeqTndI/ov7w6+CJh52gOvDgqqRLMEcPjsG2RpjymYZWBIVNsgU93bton3d2119W8pdI73b
m9tn/3+7R6xJXMf9jQJZIaIypS1eYpm/D6onq+m39eYX9T6Zv/nyZVUV88SW3hQRU0GC+y96ZwJ
KIm0rx6o6UTdqMGXpHHR5eefvOYHaq2lgoY4eSpvnoajiA/+IA3+4nrJ7P/au5NGL/ySVIoRxyi
Od/X2G6BQhQ7pNoHwOgUropZlkROJJH4aX058mXUmdXW0K7h2I+tRjFekWZ+pV0t45kqcuCgGbP
G8dArbCsmOGX5nBgo
X-Received: by 2002:a05:7301:182d:b0:386:b801:cd06 with SMTP id 5a478bee46e88-386b801cd3bmr29055631eec.40.1796244374411;
Wed, 02 Dec 2026 12:46:14 -0800 (PST)
X-Received: from localhost.localdomain ([223.190.80.135])
by smtp.gmail.com with ESMTPSA id 5a478bee46e88-386f6651e2asm47188152eec.27.2026.12.02.12.46.11
(version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
Wed, 02 Dec 2026 12:46:13 -0800 (PST)
X-Cc: Junio C Hamano <gitster@pobox.com>,
Derrick Stolee <stolee@gmail.com>,
Patrick Steinhardt <ps@pks.im>
X-Mailer: git-send-email 2.54.0
X-In-Reply-To: <20261126115803.30015-1-aniketgupta3001@gmail.com>
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list