From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=202.12.124.159 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796110827; b=cQFosuIqRucpDnh1nKun7zgopM6Tleyq5ASmL7+wFv7Gr38AsLSDOcpGMc4FATU9fNFu ZYg/4MBwH+Kzu0SdzhudN/mvKIsbYygjVoS8KWb5qPjdmaKtCThSWD+X3/fnQjD7Dep8J C3ogJB7UrNYMznLyV1XnK95pATLZSV9fB8uJbBQIReyNqMTybWVIGNItWDHXfdeUIgmkq A2zzdyW9U2ieg8rRR8MkcK1D4qixfEJVBeN0NE6y0iZcOIW4xFAk/MhydIPA0eMI0m8h0 D51kKAV75N+nCMlGgqoq3VgZq4q3GMTSsjdRRZF3efXu4fKaF7p4HfPMP5uWluWosPA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796110827; 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=jleRkX3RQKl8T6NdtcKY6Sa/9Tdi1lY/Y33f3YyN884=; b=ThUgt5Bk8Ki0ATU2W2Hy3eTN1sAAbsKgj0ZC3ghyP/407/ZvhvZQaIrtUmSWF2spOd4z ya4IZwPYtSgUFj6yNYD6kaj+BUENxX6e6Eb9//GoUreAVylqgH6fx417QEG5cWPQC8Pdd yUNYks4Xlw6890VYw9v6Y8X1X+yi09U6jixPE2zWMcTDXgVxVO4OwOxRM/avHmdC1QHmY tiUSvenj6OvIFr7BsxKK4eSBTXtOJ+PNnSoM1r6mecB1hGG1hgR5UXPrL2vS1s1+07GS1 NUYpZh8IC8Uya0IdxCPV/QTlby1IsjRs7/NzCvI8NqnAnour7OlJHxBY0SiKgJm8T1Q== 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=LjvSeeja; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=coGkEfIT; arc=none smtp.remote-ip=202.12.124.159 Received: from fhigh-b8-smtp.messagingengine.com (fhigh-b8-smtp.messagingengine.com [202.12.124.159]) (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 53BB9606A325 for ; Tue, 1 Dec 2026 07:40:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 53BB9606A325 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=LjvSeeja; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=coGkEfIT Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfhigh.stl.internal (Postfix) with ESMTP id 9A6307A05A0 for ; Tue, 1 Dec 2026 02:40:26 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Tue, 01 Dec 2026 02:40:26 -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=1796110826; x=1796197226; bh=jleRkX3RQK l8T6NdtcKY6Sa/9Tdi1lY/Y33f3YyN884=; b=LjvSeejazLkO6gyzXoi92O7hqm M0rlq7CPMjmSE2XOnFLhIulTFXIGhLgquofqyKIOBaAS97Pov4CSiOy3rEG/A1Kc 3KJprny7cYNdJcxyLgdI8nXZBW5M9P+3BxcmbCzBIdYDNThRWCo4Uw4OMAdwdpqC donghCKiIeuRKH/tisnNQu/PNmBsIlC8WU8uMYGbZSg3t6sUAE3K60X6CItm2wGl g1fBGB74rooZRemY0F2a8NGyzXq9SrwEmbyBCw6lh437HUI3+7JG+WzBUuce56kQ uZRIHr4CPbOOGbPAClgBWuiYN3cpaIBe5seX6u+HIPBMFVpjfLMQr92djJTw== 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= 1796110826; x=1796197226; bh=jleRkX3RQKl8T6NdtcKY6Sa/9Tdi1lY/Y33 f3YyN884=; b=coGkEfIT+se78HVK+EVWqZs4o5t3bwHVNnSiLkucE5bvDAagDdE VKbA3HsdMsydW2/ndGXpdSr1XFjGFMwfcfjgdHBHvsBfnde+SiIkSITeiZ2uMb62 tByfk7NvPcHlAiysX/hVRBNsLcKikebQKQTwlxVJ2GK51utvGoQ0eFW3fyD6rkqF cWomvTemfjAo99GyQdcXBogTzJUS/+eCIgR9q1PoqHAfysG2old07RDnwDgQj+mF LFvnQ+KEH7mIbZXq1cTDs624olm9WW1rO7fLuIK5J7P/ZrCXcK4iGs7db0rTNQlK P17FSeAin2QPYZTY3kJVnlPR6vwyQgzmHog== 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=1796110826; d=pks.im; mf=PHBzQHBrcy5pbT4=; rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+; s=fm3:rsa-sha256:p+81JKjIev6dAjQGUUTmoPTCqjQv0QksIedUNCJPk0eHbNH 5Y2P98W62NCIaBYKYFPav/eUO8z3SVTKjwGj9wXNjo4ZiFtyNJS7T3ptzLqJ9nOV tAINxcZTyKxv3mTcUDLb3ZzXNyvONINkCEJ2wPofi9fwFnPx+AyZX/QSO4Se35lN 5iHsuPPLD5r1HYZ3fmOZNamGMQhmtIt2+CCwlHMP1eqGt62RBUrMyyfpJ3eSlTyg nn09xupAJtBqTM+1QVlMKNxhxq1ADBa+yjz6O0ybiidPy7Bb/Fh6NscM9Zn8UgJJ 4qtWuuzGS9dbQlT1fs1sG1ba/xrMELBu51EpRpQ==; 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:570DsnhAd8krgQW1KHdbLcrxGMEEZ8MgaLO9XLenTYE=:7g7u4OLC+pO/qmunX/7/SMxO/Fir5bQEBpvgYlrJLlo=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEH6O9HcUfoh7lSb/1Z/z2/54IwH9lqwXQrCcHA8/aEPIa1Y28Hivp4Fgz3t+Wj9H 8JJ1/U1PoiLKMWclMW3N3bauLUAOGdAsuyuJ2HJXhQoBZdgM6BPRXuHYq5iSNKRbm1CwxB vZ0XXxUOnSl8vRMtk+rpTJ72dDfqOgvIJPuAzV4PDH12ido2qgQwSPXIkQTkkKYsZs+S+0 /oBJ062LLzWQ4wO1WcJ3pisQ/zRxd+hCb/lPd+HGO2QNpDvwg50Mf/G4wJUJpSoAJv56vf 8PRc2jw60WDWMQ8y5MbuvvMwfIWvigOxfH6PxXrxkY1V4iVeNnTO0UPUHGMvdIPEmGjRev CK9G0o4gzoplnPG3VqYxk4ShDahqnl3Yw2hqddYPzyLklAECKIwAa3YezVjiTsRa4p0KeF NejmuJmiM2tTciwD7IWc3jqOJO/SsOE9Q4iqUpOnvmQiIyocb7w6p97/hqnhLOJVIaBWzT oXQDA1W6Z6woGVV1MV/7eRP0NFTgSjZ1VzX1Q6aW3bDZkXse6ptaOfrHENpcLKeEl1O3vL OCLXOOva4UQpQfZMvMyt2HAbKZYhYCgS+Hn0XFxc0Kr2yEqWJiy95lbVMkhhuIMxbKdVZe U55kvYt7iiuggL7OfYD2+/UmLY9NG1b0W8qitwei9fx2swI3u1NPNRoXLa0Q X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 1 Dec 2026 02:40:25 -0500 (EST) Received: by mail (OpenSMTPD) with ESMTPSA id 547edead (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 1 Dec 2026 07:40:24 +0000 (UTC) Date: Tue, 1 Dec 2026 08:40:20 +0100 From: Patrick Steinhardt To: Christian Couder Cc: git@vger.kernel.org, Junio C Hamano Subject: Re: [PATCH v2 2/2] promisor-remote: fix crash without a repository Message-ID: References: <20261113000600.202744-2-christian.couder@gmail.com> <20261126141626.914848-4-christian.couder@gmail.com> <20261126141626.914848-6-christian.couder@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: <20261126141626.914848-6-christian.couder@gmail.com> On Thu, Nov 26, 2026 at 03:16:29PM +0100, Christian Couder wrote: > diff --git a/promisor-remote.c b/promisor-remote.c > index 85adb66c80..b37ec23a3f 100644 > --- a/promisor-remote.c > +++ b/promisor-remote.c > @@ -1379,6 +1379,17 @@ void promisor_remote_reply(struct repository *repo, > { > struct string_list accepted_remotes = STRING_LIST_INIT_NODUP; > > + /* > + * We can be called outside a repository, for example by > + * "git ls-remote", which has no use for promisor remotes. > + * Not replying is fine then (see gitprotocol-v2(5)). > + */ > + if (!repo || !repo->gitdir) { > + if (accepted_out) > + *accepted_out = NULL; > + return; > + } Yup, makes sense. We could add a NEEDSWORK comment here that says that we'd eventually want to get rid of `!repo->gitdir`. But I think the current version is good enough. > diff --git a/t/t5710-promisor-remote-capability.sh b/t/t5710-promisor-remote-capability.sh > index 463e9e00b0..50a73ec8b0 100755 > --- a/t/t5710-promisor-remote-capability.sh > +++ b/t/t5710-promisor-remote-capability.sh > @@ -813,6 +813,37 @@ test_expect_success "clone with invalid promisor.acceptFromServerUrl" ' > initialize_server 1 "$oid" > ' > > +test_expect_success "ls-remote without a repo doesn't auto-configure" ' > + git -C server config promisor.advertise true && > + > + nongit git -c promisor.acceptFromServerUrl="$ENCODED_TRASH_DIRECTORY_URL/*" \ > + ls-remote "$TRASH_DIRECTORY_URL/server" >out 2>&1 && > + > + # Refs are properly listed > + test_grep "refs/heads/" out && > + > + # No remote is configured > + test_grep ! "Auto-creating" out > +' > + > +test_expect_success "ls-remote without a repo doesn't store fields" ' > + git -C server config promisor.advertise true && > + test_config -C server promisor.sendFields token && > + test_config -C server remote.lop.token "fooBar" && > + > + nongit git -c promisor.acceptFromServer=All \ > + -c promisor.storeFields=token \ > + -c remote.lop.promisor=true \ > + -c remote.lop.url="$TRASH_DIRECTORY_URL/lop" \ > + ls-remote "$TRASH_DIRECTORY_URL/server" >out 2>&1 && > + > + # Refs are properly listed > + test_grep "refs/heads/" out && > + > + # No field is stored > + test_grep ! "Storing new token" out > +' Both tests fail indeed without the changes. So overall this looks good to me, thanks! Patrick