From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=202.12.124.146 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796128512; b=akACc4oiDC7fd/jV6Na83e8AR+OcyXjzesw3ebb+OIwDO2+Qyo+SQhoRZk6H6CjdbGQA Jd16XF7vlv6iOgfu4HLtRuCv8aheD+WxJM7maz3qIq3PGsLjzkKAzOgjLUcgXQ+nW0ZB6 9EQYUWjJH6tAcZD6XEw8RrYPGCUno1TLT8NSz+5eFkHJqrpePkd03ByvR5JNFEvW7vKZ/ vaApAMFD85YYKktrvwF8Ct8aPpybI2PnlxRbZvXrUwHePrXYX8BsvAzfAdhgnza2FBz30 pirhW3r61l/oliUAZ7vg3kRilHyTCiIrc6hxEd1HvAcDs/ClvVdlO/AjESlpAiXkuYg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796128512; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID: Received:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=j/huvPnwMiEcVFsc0avF7ZSVz4xdprI4i9MruVzd4Yo=; b=mO8sD2ElvIpfK0aZv4/N0FRZGHPvTqaHz9jIWqwzu1XqR0pliAzRzmIxeT1en5CuOyze +Q8jXqytmW+uqzbjst07xZBru8VKSzjvUxehkVBl96odPjPiH1rGWVuFeXyGqeCtr0FGX n1K+8uWgrZws4vRS0ctaKI8plScGL0VfzQz2BEDTWtZATQcoxC5KMYf08dt98EJO7v1hT 1awJnwnCzdwssgHcFaUD/AuiSzPBwmWCfeYCt4Tunevhec1H9OgBnuYyd84JAtMdj3Hsb wWG8Spj7ifJZs0DCvhpNenhMk9vHqRyHF0eYzL84D/gi78u+tf+qevR7joawAaBcOfw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass header.d=pks.im header.i=@pks.im header.a=rsa-sha256 header.s=fm3 header.b=MwvUWxDD; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=Mr37gmkY; arc=none smtp.remote-ip=202.12.124.146 Received: from fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACF69606A31A for ; Tue, 1 Dec 2026 12:35:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org ACF69606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=pks.im header.i=@pks.im header.a=rsa-sha256 header.s=fm3 header.b=MwvUWxDD; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=Mr37gmkY Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfout.stl.internal (Postfix) with ESMTP id 1125E1D005B2 for ; Tue, 1 Dec 2026 07:35:11 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Tue, 01 Dec 2026 07:35:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1796128510; x=1796214910; bh=j/huvPnwMi EcVFsc0avF7ZSVz4xdprI4i9MruVzd4Yo=; b=MwvUWxDD8B8etfMkQVCt3jLVaL 3OOQxt1wFI3NLDkzFOWmK5Sbe8f78q+Uj3tk28A3X7tQWqXNKuqGq7Bwuag5LyKL znB6vNEWAUZzA4zLUNP1ja+BxOadcyCWvD+vs6S+m28yHBLr9EcdsBFrTy5STUYs C27pNGUMQy4Kr0NOlykILfbh1DvUI7avAnH+2H4xX3n/4V+PBiSU21tDT7isLtQC 8AANdAQpxbfKeeJkVlWAcIdNYt3P4TeLQjg2Q9Yl+J4CPyjJCexBwmP7Mxt317Wv MBHEhLTls77iIin63vlnBAiADIbDpgJjEQ/8S59FVBZhTLxB/hSpKMu1jyhw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1796128510; x=1796214910; bh=j/huvPnwMiEcVFsc0avF7ZSVz4xdprI4i9M ruVzd4Yo=; b=Mr37gmkY8pY4WxiMPUX4Q8lNwxpOkMf5lA90ZupqKn+6J3reIJ2 ymXHfRJttxzD/Xu1uHug9ugJmf2YrEsxuLb3j2UvfJCqVpdVD+z80nbn6lh/R2fC wnLFPWznE2LEpMh/ZnylDMiUYq6uYvQMwOyp4eS7K4fGdfg4quXC6jmZeTOjP2ID 7AZ3qKKOnIM5RhrvcKzfV5w0WlPN3iECZc7OACKAAErYExxnsWxauCBpWZP6OTmB yd/ErgI5xA/r7El7Vk9NR62+OhRbXgUON+W03Fw/G13kBCdW95DnUhiMEIDdmI+Z V1KHnoUdIi/1WnTS7N3n3RKj0z3uA1kpyOQ== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=pks.im a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1796128510; d=pks.im; mf=PHBzQHBrcy5pbT4=; rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+; s=fm3:rsa-sha256:Ldtv8TsggnWBIPnmEQ3zwnxQ0B0faDZ8eMSIBZkBR90LSxb 0CzDPRkexC9ncxHzY1MfcdjgRByl/oghPy+9YoKFuIMP01eCRxrw7gXlIdJ+j70N /Gvw0K/np99qtmxhKzgXzZppA2uWi8pkDEwn+MR7cFoy/xoF4cVOhGwYxoP22ZIE DWd1EmeohrZA0xKKsx+e7Od8lKe6IYsw6ugHI0K+3otYj+Tvh2tNUn2uFGBbFjxd y8iyE5iWnY3RFlI5srabEpyst5ZI9LqsFkx+ht4pkbSDG0ZgeXkzuXeTfCS3dDr+ HypsrkrWBQrJErTlTYKfKeNEEJeso95Cqwwe2vw==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-disposition,content-type,date,feedback-id,from, in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:fpr4D4/u0yh3BehihyPOuuP7rDYzUsQ2D6t+bzHnBFs=:aQfcX/agxRqrxR2ksZuIb1jFobWcKeZW/eBW0GclJpw=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGAQv1/S4VaH7pZw86De89upKB/XW5AKEtwUXC7qlINN2G1QLvsOj2uWZgusqgP6s Aap/+I7e8gYzPqMdjnD+QozCWNsIgfRvQVWx6uRe7MVyQjlXnyzdSXXzpc6RaMJdzSwT7D WzXJexy+oIpDAyziTczotc5TaYcoP2V4uLBmyghnbxcK9QuRlyVCm1DCs3rkbU/06qZyYs X+mIorxjL/B8lzyTtgqHR4JUaB8ji4z5czXxDSJ/puIgxRKsrI/nLFuJVY0dfLLRrrn71R ku0nPsvHyAVZ6p7ZcT41/NWWzIfyEYUAPVlzEUKmDZj/Q9I98DORw/7d2QvSSlhP/LlzrX kp0rN9eNCELwMZA6xUsWWQOuAQuhH2mgHcpY8dPa4ER1pdW298rCalC5G/cF0e8Nl8HLHK tX8KxtjN+AkKf7LtSs/NKlFjV+0269afB8v5qvmDmIqAFcMc8EhF0Z7MoZqgR+8NnmxO6m 5dqtuflTA4Kxd/X3xH2yNiASdZ1Nr05criHrB+p3e6x3f5v/VAW5aqHIotze7VD8z2vVzT T76XDNs1IDLEImBhS0AoBAj5ejPuT7U+4TKQoDotC1oA4tz4qenOAzp35nMj97veloIes0 4p5GcAEtYyvKEllqpmPktmD6DdNbWdHx1p1UIGpRm2xcQTvvqXDVAkpO9vAA X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 1 Dec 2026 07:35:09 -0500 (EST) Received: by mail (OpenSMTPD) with ESMTPSA id 41855814 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 1 Dec 2026 12:35:08 +0000 (UTC) Date: Tue, 1 Dec 2026 13:35:05 +0100 From: Patrick Steinhardt To: Aniket Gupta Cc: git@vger.kernel.org, Junio C Hamano , Derrick Stolee Subject: Re: [PATCH v5 3/3] bundle-uri: do not die on unresolvable relative URIs Message-ID: References: <20261105152842.566318-1-aniketgupta3001@gmail.com> <20261126115803.30015-1-aniketgupta3001@gmail.com> <20261126115803.30015-4-aniketgupta3001@gmail.com> X-Mailing-List: git@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261126115803.30015-4-aniketgupta3001@gmail.com> On Thu, Nov 26, 2026 at 05:28:03PM +0530, Aniket Gupta wrote: > A bundle list, either advertised by a server or given to "git clone > --bundle-uri", may contain relative URIs. They are resolved with > relative_url(), which calls die() when there are more "../" components > than the base can absorb, so one bad entry aborts the whole clone. > > 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. > > 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 > used and the ones after it are not. A list given to "--bundle-uri" is > read from a file and rejected as a whole. In both cases the clone > carries on and fetches what is missing from the remote. > > This resolves the TODO in t5750, so update the test to match. > > Signed-off-by: Aniket Gupta > --- > bundle-uri.c | 13 ++++++++++++- > t/t5558-clone-bundle-uri.sh | 16 ++++++++++++++++ > t/t5750-bundle-uri-parse.sh | 15 +++++++-------- > 3 files changed, 35 insertions(+), 9 deletions(-) > > diff --git a/bundle-uri.c b/bundle-uri.c > index 41c817eefb..3b54622532 100644 > --- a/bundle-uri.c > +++ b/bundle-uri.c > @@ -214,11 +214,22 @@ static int bundle_list_update(const char *key, const char *value, > strbuf_release(&id); > > if (!strcmp(subkey, "uri")) { > + struct strbuf err = STRBUF_INIT; > + > if (!value) > return config_error_nonbool(key); > if (bundle->uri) > return -1; > - bundle->uri = relative_url(list->baseURI, value, NULL); > + bundle->uri = relative_url_gently(list->baseURI, value, NULL, > + &err); > + 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 0; > } This is now weirdly inconsistent. We error out and remove the entry from the map again in the case where we cannot parse the URI, but we don't in case there is no value in the first place? That doesn't make a ton of sense to me. This change also raises the question why we error on a broken URI, but not on a broken creation token. Maybe the creation token isn't needed? In any case, this could have been avoided if we add the entry to the map at the end of the function, only, after we have parsed everything. Patrick