From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id C4F2F1F487 for ; Mon, 30 Mar 2020 17:37:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729089AbgC3Rhd (ORCPT ); Mon, 30 Mar 2020 13:37:33 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:59221 "EHLO wout1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727368AbgC3Rhd (ORCPT ); Mon, 30 Mar 2020 13:37:33 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id E3057705; Mon, 30 Mar 2020 13:37:31 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 30 Mar 2020 13:37:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=WvAskKrbwFmnN3wiOx592NvglZF uAi+0r/AwUNe6p88=; b=CJANnhKpUs2W+x9vbTBijMtbxLWTg/GyGHT5mb4lDhf 8TJHMTXPLdlXaCgperOMC/VCt7KZ2FJJxSHuFqE7Wnt2O3nrg7P5BtXIVNnjSEpH eYnhC3UCTsPs59LH5sawS0ZKLI8GRxRER1U+J4wrSyLAI1FH+TNeP65GFrV+iKik GLZ4TSj1ezq9WepYEvqCUB7j1wwmx+HrK6PBTv04/kBQylUYPP7VR3G91G3mJAUC Rs+Yyca7vXzrXhvV34VNhfJaScYQ8S9nzZSkH4e3d6sBLLMwD11pXZiKbWgxzgC0 hYXPi+xje/BLBjNWprVfcmnTq0Ucb9PItF0PrQprlPA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=WvAskK rbwFmnN3wiOx592NvglZFuAi+0r/AwUNe6p88=; b=bluq86Utm9ejTIBodGC1as MZWPBrqCUf5eD4E2pSI0w5SeErrebhHIsz+pf7BpbKDfJ/19+uOAD4CMbUtZURb2 sOuDjFtHtJKUwcFAwS6KGk3jpt55p+yuXzKQdSX3oAe4TpZNxOIg6g23ZlveRrCe 6R6KI92wphR6WrmVoPGwkGZ3nTdfG3FmWXFv3QPWog/VU3eYTRDKAdGa8BHzZqrq ZQWN0ln4QFQy04FgKeyR/LqP1/URPoQBM/4gJAvGDuZh0oxosrcdtRn0XV+mGLqT 4rs/ne/6buz/dEjqjUZN3EUD7Atb9/c+8s1kuaVqvvgKS9NbvnhnXcaHnuMbFPWw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudeihedgudduhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecukfhppeejkedrhe egrddvvddtrddutddvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepphhssehpkhhsrdhimh X-ME-Proxy: Received: from vm-mail.pks.im (x4e36dc66.dyn.telefonica.de [78.54.220.102]) by mail.messagingengine.com (Postfix) with ESMTPA id 6EB25306CA1F; Mon, 30 Mar 2020 13:37:30 -0400 (EDT) Received: from localhost (ncase [10.192.0.11]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id b56071c6 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 30 Mar 2020 17:37:27 +0000 (UTC) Date: Mon, 30 Mar 2020 19:37:32 +0200 From: Patrick Steinhardt To: Junio C Hamano Cc: git , Christian Couder Subject: Re: [PATCH 4/9] update-ref: organize commands in an array Message-ID: <20200330173718.GA4837@ncase.pks.im> References: <50ffc263293571f8af71fd1d253ac238c6909229.1585129842.git.ps@pks.im> <20200330080551.GA186019@ncase.pks.im> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4jXrM3lyYWu4nBt5" Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org --4jXrM3lyYWu4nBt5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 30, 2020 at 09:55:44AM -0700, Junio C Hamano wrote: > Patrick Steinhardt writes: >=20 > >> for (i =3D 0; i < ARRAY_SIZE(command); i++) { > >> const char *eoc; > >> if (!skip_prefix(next, commands[i].prefix, &eoc) || > >> *eoc !=3D ' ') > >> continue; > >> cmd =3D &command[i]; > >> next =3D eoc; > >> break; > >> } > > > > The reason why I moved those `skip_prefix` calls into each of the > > respective commands is that this patch series introduces calls that do > > not accept a trailing space at all. Thus we cannot handle the space > > generically here, as that would was soon as we introduce the set of new > > commands. >=20 > That's not a good excuse, though, is it? The command[] structure > can say "this takes parameters" or even "this takes N parameters", > and the field being zero (i.e. "does not take parameters" or "takes > zero parameters") would mean you do not want a trailing SP, no? >=20 > I also suspect that the "extra lines" thing we'd see in a later step > is correlated with this, but we'll see. >=20 > Thanks. You've got a point there. I'll convert this for the next version, thanks! Patrick --4jXrM3lyYWu4nBt5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl6CLloACgkQVbJhu7ck PpRRIBAAktLA4JzRrSYejb+Lz0T3DGaEYeMEXYNNQTzUfSmqsjJiuoFmnAuUeqMZ Bi65sMouCtK1k7GINRKuVUinRdkJ+3H209MJrRb+JQ/CCVbZz4NL6fKj0o/E/g+e QC1Nox9BcVuXeLw3ddMBEi+paSry59gTV/fx1M0Dg7KmSIWlWLmEycdSd+mdYm3F AsuqgH/eKIQgZIVn8YszFtFUU2Uc5UylQKv4zOhXZ1X4cGcmasXkdrvldc+qGlL6 2SdwW05DFT3ZQfpG0OJJMy6Zy10+xAA0X9tiQWZ2473TjgJ7tAiGK6K36NJNfC5s NSpyWaI7ax+wyp9vJt8cJirCEpeuhwRf0wkHh5H3/QbiIIFuiBglvQQHPrbjnInk ayJif6CTNABW5FHMsFZlb5qoXXEG+rRAUnJh2f6b9E/l31HuxqmpOJWzwoGxKytC NleibS78sKr2WrzwBCl4kl0ThGm1kbwopYbONUyE4mzGPP1gpI07HnnV+qzCj4lj sTDAz/f81rRpdqgLw8c2/TFZ5vUq/X+VUp5PiyCot9H+QPYFY3iA4V8hws8ZB/PU QKIvLbjSdJ9h1IFQpLuGNESj4dPrG3AItYR4ZlGnk4vUKdXqFvGqf+5UI9+ApdjV mf4qiE20/JQNDEkEhSChPl8m9sdt5O0iFrG9pAGRpxwbbkbHUHY= =2gIv -----END PGP SIGNATURE----- --4jXrM3lyYWu4nBt5--