From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-a5-smtp.messagingengine.com (fhigh-a5-smtp.messagingengine.com [103.168.172.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7F564A1DE0 for ; Thu, 10 Sep 2026 14:27:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.156 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789050422; cv=none; b=TULNqSOP3hjjMeyPs58XgTBZksJW2SYlBJ+V9bIh77PndrKUOgQungvN2FSqQLbjDBJat0JOKCdJ2rg0mN5csZrG5+FyMylAiHqX6mPD0kaDP4P1ERAw6iDOLZnjvLx6Z/2zJQeZLw92upG4I42/M/DLrmXrZt3IBq2xbcNp6n8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789050422; c=relaxed/simple; bh=Lc66ip0RI5MVmfttBNwI1rYrQ8UEXQXi45WR5/qlUeQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=q3WsBWw37JD2cMsYrvtfv+OZDypgNwC/hmiws4c2nzfjEJ8YgDgWdlXHdqb7kULdDj9fI6uBYo71QiVhUnVYSXFUBqsGFQqTGkaip7Ymm12N3TmIaFzrGYiDRam7lZeo94pxPHez2J/+mYnYGn+3tyLo0glBmfnVWPXHKq9W2is= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=dn105Z/v; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ZaYzD6y9; arc=none smtp.client-ip=103.168.172.156 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) header.d=pks.im header.i=@pks.im header.b="dn105Z/v"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ZaYzD6y9" Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id 1F519140006D; Thu, 10 Sep 2026 10:26:59 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Thu, 10 Sep 2026 10:26:59 -0400 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=fm1; t=1789050419; x=1789136819; bh=0lfWCkZMYS hZUugIrSLC+CShCvqpjI5RrJS0Evjh/0o=; b=dn105Z/vIYeGHz9gC1vr/Hkugr /e6rIQ8ZZ4yue8FNejY9iS32kuYBnWs2jlPeEJINol/aWjJkahhTUunCy3F/ORzE ciDijQD84s5GK9Y9b6CeChI8s9fkXhEP5Kw4gRhEao2CLjg+2NeXhybcnHJIcgeQ AehOPF4MyDWpYcyShUJffy9BxE/w8nkwdHYJQpJt8scVAYnwckTmJmdBlk/USgz3 S0mHWn115lq9tMnvp/VS0PycP6tbXQOwBmpwn1b/+QYBMj2K+ag6yPYrd94GQ9Xn g72k2uMbkbJ+rpgwyzd3y4vhRxMqi6lLjbxnAyHsiA4I864UxSZCAhLiFc1w== 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=fm1; t= 1789050419; x=1789136819; bh=0lfWCkZMYShZUugIrS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U4Eq+slM+1NDywP6kxwvVik22XWbwyY4Y1JeQ X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 10 Sep 2026 10:26:58 -0400 (EDT) Received: by mail (OpenSMTPD) with ESMTPSA id f8b3c54d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 10 Sep 2026 14:26:57 +0000 (UTC) Date: Thu, 10 Sep 2026 16:26:54 +0200 From: Patrick Steinhardt To: Karthik Nayak Cc: git@vger.kernel.org, Toon Claes , Junio C Hamano , Justin Tobler Subject: Re: [PATCH v4 5/9] builtin/clone: move setup of alternates for shared local clones Message-ID: References: <20260909-pks-odb-write-alternates-at-creation-time-v4-0-d8a78ffc32e4@pks.im> <20260909-pks-odb-write-alternates-at-creation-time-v4-5-d8a78ffc32e4@pks.im> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Sep 10, 2026 at 05:54:50AM -0500, Karthik Nayak wrote: > Karthik Nayak writes: > > Patrick Steinhardt writes: > >> diff --git a/builtin/clone.c b/builtin/clone.c > >> index 8786a49332..011fc867c8 100644 > >> --- a/builtin/clone.c > >> +++ b/builtin/clone.c > >> @@ -234,6 +235,16 @@ static void collect_alternates(struct strvec *alternates) > >> for_each_string_list(&option_optional_reference, > >> add_one_alternate, &data); > >> } > >> + > >> + if (is_local) { > >> > > > > Shouldn't we also check for `option_shared` here? > > > >> + struct strbuf commondir = STRBUF_INIT; > >> + > >> + get_common_dir(&commondir, src_repo); > >> + if (option_shared) > >> + strvec_pushf(alternates, "%s/objects", commondir.buf); > >> + > > So we do it here, but then commondir is initiated but unused otherwise. It is, yes. But this is done to prep for the next step, where the `commondir` variable will be used regardless of whether or not we use `option_shared`. I'll adapt the commit message a bit. Patrick