From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.161.53 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796145527; b=AJCJQGnrGTpLwX43iJhgmBTl/WdBA4u8B08dBqAChCRovz92MXmhlaDYkOi7nVsvX2vS vOedYXDZUCYY9ynPq/skk/kC46UstJXe61qyK8bOuw+DBzh5ppyAFLBPqMpctI3oI7zxU SLxzi5+0/cF9LpKorx0YaeQjdp4XF2HATQbUcpvuo7hHVlrBjxwudyzUGeNyyf0YyKmcO sUOhJH3Fu0DHHNWQVqw1ll/VS435EVcHwKfvMy91MY5BVADpzVvra8c3qNuwTXxUVpIvf u1D5CfLFHa+tdg+WCNGbhkP1+26zuqch0y0C9B0zU1zQokDsu8mRfVWoPU9LpdYYm5g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796145527; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=thtd/1sEHNsiS1TiXByeSXOcvk3drT0tFh/0ShVWt1Q=; b=fVYAU9BPMNwddKy8ZQLIu5FjLb42soZLFYu7a+s2ioC9tnoojTH9uQK62tGamz8VRFUz 7hBDYSTAb9Ey8FP9mAYL49TcjmDhx1Fiw8rjCayAXbHaX2zH5gFX2AXSZ7y7vb6BPZ5Nd /mDXj1GtbzaXif0TJ9RyuhEu7976nRpk/wryKhAG2EZWL/orwYkVhOTwIamiiSiyj3N44 tLhs0w6MZ3rORt+AxDIH0PhM1S/zK1rVGv8CbXHql+cMrOs4bdkiBIvoF13slOgvho/xR KeqqbpcWg0Y81rJY+1DVDacAozqNfcXuQjQ7MYd+KIz5E1Un1n7QS4ghdlJ2fEbvtuQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=uTWhyHFV; arc=none smtp.remote-ip=209.85.161.53 Received: from mail-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DEB4606A31A for ; Tue, 1 Dec 2026 17:18:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3DEB4606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=uTWhyHFV Received: by mail-oo1-f53.google.com with SMTP id 006d021491bc7-71af0656bedso7373978eaf.0 for ; Tue, 01 Dec 2026 09:18:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796145526; x=1796750326; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=thtd/1sEHNsiS1TiXByeSXOcvk3drT0tFh/0ShVWt1Q=; b=uTWhyHFVn664LOLmGxwQ//ConL6X4T1Hv9nDMobegYX/hYvqfLopH0hxY6fTByscL4 sH+9q6gXTkClQZ/9yWFuqpEMHHfea035zIgshLt8yWFN9MY17j080hOgJWVx1RrX6xeP M5eS1aFu3iSZ0tfC+cAkAZqYSFWRdnl/FzPUIcuXO+HpEEg4SOKt80BGp5AzwAY/Fj0W UAHZrletu9iNUI84i1chEWLmV33Oh7Ie+jgBSiOFpLMRM8c9HXkEYlQRu2YQDKKFQ1Zq Gvmmf7hzyVZPP4L2klKByBwQSD0ttFeGJImT7FO/BLqk8bDFVmimpR/2F9S8NFfdfNWl mAQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796145526; x=1796750326; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=thtd/1sEHNsiS1TiXByeSXOcvk3drT0tFh/0ShVWt1Q=; b=W/F7Vs+j5ibJ8qC2ZpL/mEUGzq7/AWAS2d7iTBGaQL87xDkiUiOAc9VKy2MUn906SU qK1JqKnsZDHpW+evhwcpWwSi24qWbgpSmSBVfFffnKxcXa257thzUj331aMCjyJpGQhV qDO3QLnBfNf3KrRYMhy5W9WtluU3XkRdxawejLRRUidb9C90Olr6Lcr64JcOtlNofkYt RXcvJh6yozw82AcUsCEVL8FMOmFEv9A3JScL+HK+Xhc/L76kvrVqEj20oY8STefJ6caJ fiuB1xt9n/ILOQ6oNUpAG9BcJcXBl7QT1HirAWicj0d72hZxgq91NgMEWzVhb6rJ+RUX lnpA== X-Gm-Message-State: APuU4Z97aFMvj48KwvqRgoIbm2+YHI9ulj6ZK4BQDdMaKAsCnk5LPR92 AnBM7CdptQ8ic+0Ylc1UX38y1YjyPqkv1fXlXRXxlNQOfF1DBWSwBi5f6iNkPw== X-Gm-Gg: AZFdTZeQzzfvq7lKtTF+c8AVipPeuLIbpz7wlbE3ck37iX0MtzyHMzdKY90gRI55tz/ ItUshgNBJem3Xu0NiLBVc+UNvUCrW8jwDPySYBSa7lQNhNEDbtGFxt6OIuVdTIXaQndjLwRKET1 XMsH/qjDqADh/DW5WmQt70FFk1/ACE4F5tr3FfuY+1vGso1rlLtSRzuBMj+O4INQ0kOs53uPK40 /LLwowu18vQP8VW3q9ruGlkSO2tp9sZVln4XWsoSi/smyWmOkxYLzU9dfKlcp0F8OK5PU3nubxi tZOnVhj8KNfHs6uDeJPrv/JcZeowAd+0b92xND9YkaCEHlLd7iSmObHR/e86sv8xxtrgt9ocCks pawRUckkuVHPcFdi/+yWuhXVLtXGpvIHSzPdSWVqRQD3UE6xcjC7rKl10/uu4B2QTzjYHSfhuZM yVQru1Nsvkjau/UnNwPYAXtj1gcC1Rtkmrk3w7U85iSSaBQ/WtxxXcu7nR1OLpLFuQi7WINWm+N uoevZgZWoTSeGg+j7KKGe4aMUdfGjxP6g4bpT8oC3AXoNJYopWBTRRZA0y/8tYA7gZmJXk+hlfr 2pcNFN0wJYXqlQBwiMTl1pGpyg/ixIhXq+Tmnu9L1i9wdrwgnUT9 X-Received: by 2002:a05:6820:1344:b0:71a:f121:3f7b with SMTP id 006d021491bc7-71b3955c796mr30062001eaf.68.1796145526100; Tue, 01 Dec 2026 09:18:46 -0800 (PST) Received: from localhost ([136.51.44.64]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-71bbfc14667sm3902064eaf.5.2026.12.01.09.18.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 09:18:45 -0800 (PST) Date: Tue, 1 Dec 2026 11:18:45 -0600 From: Justin Tobler To: Patrick Steinhardt Cc: git@vger.kernel.org Subject: Re: [PATCH 5/5] builtin/multi-pack-index: de-globalize options handling Message-ID: References: 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: On 26/12/01 11:59AM, Patrick Steinhardt wrote: > On Mon, Nov 30, 2026 at 03:55:01PM -0600, Justin Tobler wrote: > > diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c > > index d3881aee6a11..eb5c77456b33 100644 > > --- a/builtin/multi-pack-index.c > > +++ b/builtin/multi-pack-index.c > > @@ -214,6 +216,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv, > > > > string_list_clear(&packs, 0); > > free(opts.refs_snapshot); > > + free(opts.object_dir); > > > > return ret; > > > > @@ -223,6 +226,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv, > > opts.refs_snapshot, opts.flags); > > > > free(opts.refs_snapshot); > > + free(opts.object_dir); > > return ret; > > } > > Okay. Now that the options aren't global anymore we of course have to > free everything they reference. It would have been nice though to unify > the logic a bit, either by introducing a common return path or by > introducing a function that releases the memory held on to by `opts`. Or > both. With the changes suggested for patch 1, "--object-dir=" no longer needs to be allocated, and consuently no longer needs to be freed. I'll leave the existing handling of `refs_snapshot` as-is for now. Thanks for the review, -Justin