From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) (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 07F7C3BB9F1 for ; Wed, 17 Jun 2026 07:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781681216; cv=none; b=JEp01F4EMO19tIHtc9ocbiBfmgdxEUptZ4YoLEL05wThQyVWVghjgCYQ1zWXmmeuIE/QRtLatioT/RtqoGvgX6o5Zxd6F65BRIa59wwCwRMt4wGzb8fgI/HQ7RA4BjaRAjGYYNWksabOWMnDUbfMYQfrDMG0k1QqTzNxMd0YHzM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781681216; c=relaxed/simple; bh=OSH0P0hPM8/S3OABkCn+359nYnx3RnYIbiLnPQayNH8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=byoKBp524Of5HA4f2U01WyxnHCd8mG6pvehU3MrjHrCJIbGn37ypPa3g+EGJZI+ZNMV8e/8Jud0kR/oLhX5Phm3Pe2MWb6x3L6rPNY2DXk6uoJB7+k8P2rMxsLX4bWazP/opCd+BwxdRlMCofnmXNrgOFLzT5BrWn13kR3F46z4= 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=PelCg/Lh; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=EMZPGdHz; arc=none smtp.client-ip=202.12.124.158 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="PelCg/Lh"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="EMZPGdHz" Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfhigh.stl.internal (Postfix) with ESMTP id CC6D57A00A1; Wed, 17 Jun 2026 03:26:50 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Wed, 17 Jun 2026 03:26:50 -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=1781681210; x=1781767610; bh=jLyUCqIHAb 6/dXu/wPFgKJ22rV8Bj9rBiDPOxMEdAeo=; b=PelCg/LhqtuGfdvgGf8mbP7tRn JD8j1CgPR43nDd7pnQNUcVE3npfzZkMXvhNAf3Fmwo4mCpLDwjjABm1QdF4UH8AX TOjqoRl4JvDKhfi7dEnSyL5MIFVsOIzzFlxlIWhGRlnlJ6IZSotv7SvFMOL1sF2y BaqsbINXdbglNDPRx7/gDWocA2wmvALPuyiSzfrvjljQwLcxrbJ4TkrAOAzAih+d E4fm6WaI6DfEwLOLfE1bDjV8SQP3F6j8eEcrLs0aVrFft37LzkhTu7bKqopW2D+k xmTP1J7Sw5tbhXGKcOVb/cECZSzCkfLQ930vN0M4HBmnmutvEpH6IKDweOjw== 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= 1781681210; x=1781767610; bh=jLyUCqI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khJtJ/9igBS12hW/DDsTsrNOJCJI0Mh2VLIOrsplvmQYKVA X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 17 Jun 2026 03:26:49 -0400 (EDT) Received: by mail (OpenSMTPD) with ESMTPSA id a91d9eb4 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 17 Jun 2026 07:26:49 +0000 (UTC) Date: Wed, 17 Jun 2026 09:26:46 +0200 From: Patrick Steinhardt To: Justin Tobler Cc: git@vger.kernel.org, Karthik Nayak Subject: Re: [PATCH v2 16/17] midx: refactor interfaces to work on "packed" source Message-ID: References: <20260609-pks-odb-source-packed-v2-0-839089132c8b@pks.im> <20260609-pks-odb-source-packed-v2-16-839089132c8b@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 Tue, Jun 16, 2026 at 05:37:53PM -0500, Justin Tobler wrote: > On 26/06/09 10:51AM, Patrick Steinhardt wrote: > > diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c > > index 00ffb36394..6e73c85cde 100644 > > --- a/builtin/multi-pack-index.c > > +++ b/builtin/multi-pack-index.c > > @@ -85,12 +86,12 @@ static int parse_object_dir(const struct option *opt, const char *arg, > > return 0; > > } > > > > -static struct odb_source *handle_object_dir_option(struct repository *repo) > > +static struct odb_source_files *handle_object_dir_option(struct repository *repo) > > { > > struct odb_source *source = odb_find_source(repo->objects, opts.object_dir); > > if (!source) > > source = odb_add_to_alternates_memory(repo->objects, opts.object_dir); > > - return source; > > + return odb_source_files_downcast(source); > > Now that we are passing around concrete ODB sources to many of these > interfaces, callers may have to handle downcasting explicitly. Since now > the downcasting may happen a bit ealier than previously in some cases, I > wondered if this would alter any error flows. I don't think this would > be the case though because ultimately we only have the "files" source > currently anyways. Well, we'd be calling `BUG()` all the same. So as we don't have conditional logic anywhere (yet?) that checks whether or not we use the "files" backend all error flows are expected to ultimately be the same. It's only that we may `BUG()` a bit earlier, but I guess the user is going to be somewhat indifferent about this. Patrick