From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=202.12.124.144 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796291775; b=yQu9nDCKZ4L9u9HafHrAmfac5nnr7Z6LWqzH+AL1PYjqI8yltFbD+28Y0xn892W5Pt6F sLxb0+o7wpMoLAjxQR+Hwu1LkveLUPcDY4TDk7MAkiNBH2Bp9lbl9IE5GQLFWVt2sID0c 56QB3SJ1c4fTGeLCspyXCGm5YR+xhvZp6K3Q1BLKlNSXjnQYza35WfycXyuolM78TkBa+ Y5KmCo07LV/U17/kUsLrdbtcpLxAceEfRDFRGDTvhpenOq0UGIINWqUct06cYeqc7JqBd WdjbJ0V81a7zgLMzmcktW2TxLuiEFTxUCnnym9PNZP0EyDLVp4R6PfUCQsbuCeOLWaA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796291775; 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=1Dj0rtGWDrgcbldb38Ff1HTRTVIidYVs0sYFPoJV0X0=; b=IB4TA/+ildn2Rv45tBWrwloyAh27JBQiYKQXLtCJNxHb0hse7VQD4oarHEgq7GPIydPk 5N2SAufir2tlp7co2MNdhkfm6Rpdg5dKDvonTiXOmlo/bdU4Iw89qmgOoS6YuxO0k3LQZ 5KM6lrY55WjYveE3ygtyJzaiHBR4Xw/hoU+TB49NkddrEqwkxoW8KE8YAr/k+KKH+eb9e PzNxE3ubkv7ranvh3Si0LUQyPMufWvHZF0MVXPByqOytHyjrSHX6uyzvn+kU0yX6nSXnW 2ePapqZkOuHKpCR0xJLvVhR+0XkEVxTAkMvXtnZRrXWcDZFBdwsF77gjIREo6A7DVhQ== 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="n2FKzj/x"; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=0RbgRzA+; arc=none smtp.remote-ip=202.12.124.144 Received: from fout-b1-smtp.messagingengine.com (fout-b1-smtp.messagingengine.com [202.12.124.144]) (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 C0560606A322 for ; Thu, 3 Dec 2026 09:56:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C0560606A322 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=n2FKzj/x; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=0RbgRzA+ Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id 2A4851D00238 for ; Thu, 3 Dec 2026 04:56:14 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Thu, 03 Dec 2026 04:56: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=1796291773; x=1796378173; bh=1Dj0rtGWDr gcbldb38Ff1HTRTVIidYVs0sYFPoJV0X0=; b=n2FKzj/xqburrsFqGCm53u/ZSG pVAum5IYw8VTXWXUOywag9+6NbpPHhloGIZ/xaECh2vpe35Y4+tDVg4i8TPdbHk0 Ri1BawkpBFNzZHPixrqrnryLC9xzBKFxlWyqpip8pMrv9A6G8adjgLxRqnumNd5G xIA0wL/v/CKLp4i/A/ct6SZEAda3s0jSsxb/CttBQsoKKvIeFtFVCnQnLsN9Dz0/ eF4D8lPkqJrkAbSQ+Qopc43h8lZqWvyM9xHVvEVOl0QunCz1yIwfbt7SlTdXQKLe cLR0zuKYFXyfUES3RN6pjt34xqLfREuqGzD9tCJRiyJiktVH8Rb3mjSNHN/w== 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= 1796291773; x=1796378173; bh=1Dj0rtGWDrgcbldb38Ff1HTRTVIidYVs0sY FPoJV0X0=; b=0RbgRzA+CArpTckvOw2Cl66U+HaSGIm4mGSVXuegP9rxhfxa/TJ 49VjXp4xujQj2uIdYJxnbta97MRIksw17ji2eY6urMUCQq/r68JMy9Pg8TG9WakW 98hlsbd7lc4uAdO2Vqx1HE+Jv4ssER/VDS49r1hJsa+dx0vTYAtXRtwB5TQ6w9DZ JhgxTLxW7FjD/vFUPBB1leQSHc9H7mQTt+I9ExUWd2K4WAl7jsk1H2/lr93T5Ej2 v5hC6BqvyJoy+lcfrkpoquSsCNGdO9zwiOic4M89tyx5EMJk7FKCErfxVRwUnWky 42kuXO7TonBrGb4jCooIHHqvwoF1UTCVQOg== 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=1796291773; d=pks.im; mf=PHBzQHBrcy5pbT4=; rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+; s=fm3:rsa-sha256:sINCX83MSS+g6HQ3bn92ivKqXg068HOLbhMdd3WmRDG1KVo wN+OC4LSq2r91zU+arWz44xTx1mAUASRcPeJ6BJvQlgPuIDZzqoqjsKx5iEtVsDu VDAQESCc0TVfHhc/jzW9HN4U1NmchMuZXp+tTK+E02rUVFwOVhjYPIHaX/+CKNWj 12U0tz40B8Q7DqU8cquYlQu+b80LIvrRWGStA6bzeuKc0RCHWqaZmds1owsLIN7b lrcl5LX9CnAI/pmgVXzkO85DVirMEz17aS1bV4gNdyYDJeendnkBSsVoq6BpWHd5 0F/s3Go3l4Vjq/4pZoK8JcuV74qrnn0A3TwD2pg==; 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:I3C9Y/avrBPIRpD2RolSWSaTLcaqaQocxYuNnrFBD7w=:+9ZR1UIvIYG0JnVqZo+EVPYErU3FHqmapxR8plSEbpo=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTF+Mos79TaFygWOseWe2F4iAcHagOV9MTGnX/VaovuoGXP73NsU9Dw0sdo1Ts7QG5 60gG7vfuiyccfiRgvNYLIrcQ4MnAYtTGTn0BvIOhlkEBqsIlFh5cyrID/CsjwhbP4NM/C2 sOs7UMNWLdkydwrrPDuEtwNe22yVNTmfVNCTfK1B7+Rur5Svg6FU1Rr8nC3Nn6HS11UndH VvKN17d71b83W7HXjszVYqdl+Ohxaa7Txn4+eqVmF4bVugxUzYeT6Q2cmwWoFqGzb9S9Mm UsywdNutKxft21CkcTrUpXuixuN+1Pal7QP+2WVzOpWXzyDNDEp6M1chYLGyzaDzoQrNkl u/xZtVEzf+RBkxEJpGW4fVuRvMzT/W1Tv3UeXUhrILtE7Z7Q0UyIDajGummZnG2LnNrkOF KBKpDYsfjxpf8jUyhTcOSZs69mI6lutxZ9LjU0lZz34aVbvoiPL2sA77w/+4v0hs/m0yim eD+ND241r/zQe5/k9LX1LY7umV5GDQLaZVY7058cleLwPmuSqJoAokBa9iGQQWGLUV+YRO U3MkAgu96XdTGdrGPZ89dhxQ5mwLj/+Mdn/kbxNs/o54X5mLATu7uZtQq/45BLa7jtIWAl oXchVDbMaEq7lFENJLx62qum3TFd41P4Wh0+3rzZqQxTA/XYyHmYa6vlnp8A X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 3 Dec 2026 04:56:12 -0500 (EST) Received: by mail (OpenSMTPD) with ESMTPSA id d53ddbb5 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 3 Dec 2026 09:56:11 +0000 (UTC) Date: Thu, 3 Dec 2026 10:56:08 +0100 From: Patrick Steinhardt To: Abhishek Agarwal Cc: git@vger.kernel.org, Junio C Hamano , Jacob Keller , Adrian Ratiu Subject: Re: [PATCH 2/2] fetch: reject a negative --jobs Message-ID: References: <20261202171328.805150-1-agab0323@gmail.com> <20261202171328.805150-3-agab0323@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: <20261202171328.805150-3-agab0323@gmail.com> On Wed, Dec 02, 2026 at 10:43:28PM +0530, Abhishek Agarwal wrote: > diff --git a/builtin/fetch.c b/builtin/fetch.c > index 533fdfe7d8..12140f6a87 100644 > --- a/builtin/fetch.c > +++ b/builtin/fetch.c > @@ -207,6 +207,19 @@ static int parse_refmap_arg(const struct option *opt, const char *arg, int unset > return 0; > } > > +static int parse_jobs_cb(const struct option *opt, const char *arg, int unset) > +{ > + int *jobs = opt->value; > + > + if (unset) > + *jobs = 0; > + else if (!git_parse_int(arg, jobs)) > + return error(_("invalid value for '%s': '%s'"), "--jobs", arg); > + else if (*jobs < 0) > + return error(_("'%s' cannot be negative"), "--jobs"); > + return 0; > +} > + > static void unlock_pack(unsigned int flags) > { > if (gtransport) > @@ -2555,8 +2568,9 @@ int cmd_fetch(int argc, > N_("fetch all tags and associated objects"), TAGS_SET), > OPT_SET_INT('n', NULL, &tags, > N_("do not fetch all tags (--no-tags)"), TAGS_UNSET), > - OPT_INTEGER('j', "jobs", &max_jobs, > - N_("number of submodules fetched in parallel")), > + OPT_CALLBACK('j', "jobs", &max_jobs, N_("n"), > + N_("number of submodules fetched in parallel"), > + parse_jobs_cb), > OPT_BOOL(0, "prefetch", &prefetch, > N_("modify the refspec to place all refs within refs/prefetch/")), > OPT_BOOL('p', "prune", &prune, And this is essentially the equivalent change, just for git-fetch(1). The same suggestion as for git-clone(1) applies here of course. Overall, these changes look good to me though, thanks! Patrick