From patchwork Thu Nov 9 10:53:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13450923 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 9993DD2F3 for ; Thu, 9 Nov 2023 10:53:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="R/ZIQGYm"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="qmpKfhJN" Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDA752139 for ; Thu, 9 Nov 2023 02:53:33 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id A61E25C02EA; Thu, 9 Nov 2023 05:53:31 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 09 Nov 2023 05:53:31 -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 :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm3; t=1699527211; x=1699613611; bh=Q6nJHhmytuRJ3CY3Sfb9XehBu KzaD/FZS58lCww7sg4=; b=R/ZIQGYmQM2iXE4eBTjlNh6kitSr2I0ThttSc/PaL X2Z7ITKECoYc1Xl5Giun+5o565CAxSMx5WEt3B6qza2ly8SybDMbU10avQsekXmo sLboe+k96LXsRU2KxORgkEOAmTHDzHddiC0p5BfW/0N86FydTqbVqajxv8joIyP/ a7P+x4pdHG+UHMvy2ncVBFSl4nS8SdfAOjvPp3MlT/rjoDbICd3H75bIdhHhZnFh It6C+SHGAeFhcKtt/eD1De3qSo3fu/0eCUroKL5ZGTKHGoJQFz2Rf0jJh9+RVWJp dEzpeekjGnDJuwbkzQHzyy/6qOMtsq8F3ZaqLUF3V66Jw== 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:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1699527211; x=1699613611; bh=Q6nJHhmytuRJ3CY3Sfb9XehBuKzaD/FZS58 lCww7sg4=; b=qmpKfhJNOJ/8y/Se8NiPSuFRtNgB432LgZkv5t4tLF+M4qIRtA7 2CzAGuHZfkRSiECMJWHqdF1OMOixderS0vgAFpAUQMzgUaKjqUOEFqHX7TRtwQEE F6LeAEC7rv+Jj8FwnWsVQd+NlZPVK3uNrVBeB7YmAP7xQqUB5FVG3oqhwHEOckbL pHlo6SI6Sloehnk22ZIuO0Ma6NqVXnbBNZDAAK15VynhLpHq1wSLRK71ne+dl6+X WQeGJqFj6D0LOdnaAYB5qJA5REnesofz8B2miewkwqJ9hsl98uCqxGPi/eCJQrXr 6aJmbz1PLlYbsoqhoFUgyRPtyzonnTVR/3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddvuddgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfggtggusehgtderre dttddvnecuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhk shdrihhmqeenucggtffrrghtthgvrhhnpeeugfeutdeuieehteelveegudejkeejheelje ejhffhgffhvefgkeeukeejtdeijeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehpshesphhkshdrihhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 9 Nov 2023 05:53:30 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 8a6308ed (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 9 Nov 2023 10:53:01 +0000 (UTC) Date: Thu, 9 Nov 2023 11:53:26 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Jeff King , Junio C Hamano Subject: [PATCH 0/4] Replace use of `test -o/a ` Message-ID: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Hi, this patch series replaces all uses of `test -o/a ` that I was able to find in our codebase. This is in accordance to our coding guidelines: - We do not write our "test" command with "-a" and "-o" and use "&&" or "||" to concatenate multiple "test" commands instead, because the use of "-a/-o" is often error-prone. E.g. test -n "$x" -a "$a" = "$b" is buggy and breaks when $x is "=", but test -n "$x" && test "$a" = "$b" does not have such a problem. This patch series is a result of the discussion at [1]. Patrick [1]: <20231109073250.GA2698227@coredump.intra.peff.net> Patrick Steinhardt (4): global: convert trivial usages of `test -a/-o ` contrib/subtree: stop using `-o` to test for number of args contrib/subtree: convert subtree type check to use case statement Makefile: stop using `test -o` when unlinking duplicate executables GIT-VERSION-GEN | 2 +- Makefile | 2 +- configure.ac | 2 +- contrib/subtree/git-subtree.sh | 34 +++++++++++++++++++++++----------- t/perf/perf-lib.sh | 2 +- t/perf/run | 9 +++++---- t/valgrind/valgrind.sh | 2 +- 7 files changed, 33 insertions(+), 20 deletions(-)