From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=202.12.124.147 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796227455; b=H7VA9q37S7veG/G1BsMVjNpPhX1wWbur9PiSWCICJQcjEDJFhxFS7zWGt7xBlamHOK9L pw3UoHCG4K+mqGfqg3WPs7IvHmbDf9Y2b8X3gkIxoKpBurk24kBf1AIZFGYoc4kZcT0F1 Ig9krfRDacYP8sJ+caw73NRCW2TthGZ/FDC9pLleAg5U/sNrqtk++fo8DJ8M3RLVpV2pg i6oXNfojRB/t1XiNMgKVVIQu8ZZZ5fwG3LyN/YLunOJ+2FYO75LIK0afekobWF6JaEDEY 2XRncNwd9QlYiZQvvVGztXWRYofu5hhILKDpsTVzZtF6Vm8NOq7LZIuSUUre9CNNJNQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796227455; 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=Bc+vBpA//DidC4MPzgOodeEVm9TCf+i/m+Tr3VyLizw=; b=utiIzzHvLeHt9XEzmxC05KitgqHBpaiV9qMUzoMlMuHGhieSvWLK5mlZvEaOLRSJcYuH XLiOgyIG8EUuOmkhUuvqyCoHLpZsE8VBQ+T7//SjeHM9n0jM4RVtkUYw+0xtcBqqZusDV fx9/Sd+e6uPya5DoDECR8VdtlZ3Q5kpCbDE6oyaCpGE0scCkELJ2yh1hK1XIVU0RH0wxs WuO24Jxc4YWRvjS0XA7DXjnsBa4w7ETVaN9opPJl9iOF2ztXUVTcVyuMpbuwBqhxs5jXK viWY8rxRY/6FLu4fBr64jkFBj3yLINCV8ciuk0R8LgRSTgkkNbnMGzaxdAun1edDBEQ== 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=VBmVgY+B; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=2eDBLlKT; arc=none smtp.remote-ip=202.12.124.147 Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B979606A31A for ; Wed, 2 Dec 2026 16:04:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3B979606A31A 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=VBmVgY+B; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=2eDBLlKT Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id 4A9AC1D001AB for ; Wed, 2 Dec 2026 11:04:14 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Wed, 02 Dec 2026 11:04:14 -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=1796227453; x=1796313853; bh=Bc+vBpA//D idC4MPzgOodeEVm9TCf+i/m+Tr3VyLizw=; b=VBmVgY+Bf4db/QrQIsOkRsfd/V 45K82dqQch09qlcgqcQWLbrfjoPC1pXxvv8tNroIvGq9WpgtkpJ9JglM2358pwCE g/WypblVQHh4bXdoySypQ9NmF91noNu9gZPaT84PPbkNqs09Evm/bolIHLh97rmV dbapmgW1ioEvDnfN9w35i9lS5eqbDPzzVXOJgcLtQEJ1cgrB9K141NzDvVwS8DLL 0JAqV6prGxk2xGEfviXhc+5Ibjp+m+TdfrWO/Bs25SxSjmqlvV7/m6vKu75ypgBN Q89Z2F+I/5kYbOqnN2xr8wLaukg9gcj4X6VCbati0EMW1tcG+V5K2No4j4JA== 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= 1796227453; x=1796313853; bh=Bc+vBpA//DidC4MPzgOodeEVm9TCf+i/m+T r3VyLizw=; b=2eDBLlKTEaKg5Lg/pZQvwIEk3TWae/jWMqxfoaCBFAeJ3lvlGQC t5W0aZsyVe0xMQjZUeT/5sTs5ZASi7hn3aeOHvC+A2uxqW5BB7svMYrX4MSxaYvB 4P4bkoLLncS6e2oACufpXeD+1aJxYU3GLyuQ+Qd1FOE0Sq4mz2WifxCh4E5mFFtw KHX9wvPDos87qAP1jKaRsiBhf59MDLd3J3HRhcMOkLjbnS1YDrYYJRJc36rjxoMW 7qH0PeVCVCl/2pUzOQ8j1eH4i0Z2j3UrRydMLbwDvh4+1M08W80ZFdxE0CXaMt4E xz88RGAKx/err4I8zclDy7jSDxHLGJwNXpA== 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=1796227453; d=pks.im; mf=PHBzQHBrcy5pbT4=; rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+; s=fm3:rsa-sha256:PscL6Cd+M2c6Z9o7J2XtYSqDPX/gS3ykOPsaLpxSGAz1dXe LLp1CcmUIK3Ha76uZS0suiFBIPG52opLvmH6e+pvUnjWy5lDVVoEtFH9rJfofI4a zCDk2KBPbSk1PqT/02W8ZEoNQt7c+SpX+TgHuMeSL9EDUjp6181gQvR6PqL2zS+z o+Q7j18gyKPkdK1Vz8yzmh60RTsE8w8tW9d70FvSRHgFBQFGCDxg3skHtecNLd+1 nB4vzJ3EFY3eFbjR7j8qZTwMI+DCRdyBt87VIqnXdl+mT0SPvjcJYLFa6fQBM2Le 6P/mJ0ITgoWqU9V8ACFopnQQIW0U/TnerGY2btw==; 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:XBW6br4PpJOvWHAWLRt5SDUqrJyaPon2+ZArRNLnpfM=:7+o3LZc0HKYsgUl8d2HijmAW4Qo12FWrQ2pUudKelwU=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEWfF+qL2QrjVOmmLPSySnUCKt3uJX/eWjhwITgx6nWy3WU4QbW5tUKdkiSEcxAJe 17kI/lYqyiM+IUVwjAj2b+WY4CSrXCWVcuVjm4prOgAOiOoxM5kMyuFP1fwjP+QqbuvkS1 mZxHAtojDW5UzRYVkD7PaW+WJgxdAKWFvqypcsQQZZ6Hu2q/V+5G+eG+Y/OOFXFLKMZDtV AiVS8dRtFEyq9Cj0QHTFdFIa0gEru3lgJpjAcEyq/lft2r3uWxafn/cHDVMlClmzdMhOL1 L1ZVyGoRF4MbGlZid5cobm2FpzlPd3ZcY3rrX4VX7/LGPX5hnmRgIUbqQAKy3nWuiJrcJC EAq1KhTEX6zejlmJ/8kCMpVOyT+0QxSvIZ876myCgAMikHuL9m94My2YugBOyVh35AP9RC JjNyxKEn7ml9fknSFrB5tv++C6SrEJJCh6u64gs2CQGlV0jwagmZ3bqm7Or+swS/3uZf00 zKzTQQzOyfUAfbO/V//cr/CsSbR7mf63QAwu/9tC7fIm9VVbn6I+caIZEd1R9/SAzpQpwY gCYx7gjLrsy5zhBFXdTTBDV2zrDgKYue0P957RYxh8hgEpBApR0EH9vOITdndK7WUxYUdf JiCFB0nYfxJCn3n2dLdAEWpUf7Ymk49pi7f9fKhCVNnwbDrEmNMk1GaQa3YA X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Dec 2026 11:04:13 -0500 (EST) Received: by mail (OpenSMTPD) with ESMTPSA id fdeb095d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 2 Dec 2026 16:04:10 +0000 (UTC) Date: Wed, 2 Dec 2026 17:04:06 +0100 From: Patrick Steinhardt To: Justin Tobler Cc: git@vger.kernel.org Subject: Re: [PATCH v2 1/5] builtin/multi-pack-index: resolve default object directory lazily Message-ID: References: <3e6369b99ba39b135fc1b315dc0721d098968e13.1796147221.git.jltobler@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: <3e6369b99ba39b135fc1b315dc0721d098968e13.1796147221.git.jltobler@gmail.com> On Tue, Dec 01, 2026 at 12:16:12PM -0600, Justin Tobler wrote: > diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c > index c48212290cf8..ba5f326dd6ef 100644 > --- a/builtin/multi-pack-index.c > +++ b/builtin/multi-pack-index.c > @@ -73,33 +72,24 @@ static struct opts_multi_pack_index { > int stdin_packs; > } opts; > > - > -static int parse_object_dir(const struct option *opt, const char *arg, > - int unset) > -{ > - char **value = opt->value; > - free(*value); > - if (unset) > - *value = xstrdup(the_repository->objects->source->path); > - else > - *value = real_pathdup(arg, 1); > - return 0; > -} > - > static struct odb_source_packed *handle_object_dir_option(struct repository *repo) > { > - struct odb_files_dir *dir = odb_source_files_find_dir(repo->objects, opts.object_dir); > + const char *object_dir = opts.object_dir; > + struct odb_files_dir *dir; > + > + if (!object_dir) > + object_dir = repo->objects->source->path; > + > + dir = odb_source_files_find_dir(repo->objects, object_dir); > if (!dir) > die(_("object directory is not an alternate of the current repository: '%s'"), > - opts.object_dir); > + object_dir); > return dir->packed; > } > > static struct option common_opts[] = { > - OPT_CALLBACK(0, "object-dir", &opts.object_dir, > - N_("directory"), > - N_("object directory containing set of packfile and pack-index pairs"), > - parse_object_dir), > + OPT_STRING(0, "object-dir", &opts.object_dir, N_("directory"), > + N_("object directory containing set of packfile and pack-index pairs")), > OPT_BIT(0, "progress", &opts.flags, N_("force progress reporting"), > MIDX_PROGRESS), > OPT_END(), Nice simplification overall. Patrick