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: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id CE9651F5AE for ; Wed, 16 Jun 2021 07:49:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231383AbhFPHvW (ORCPT ); Wed, 16 Jun 2021 03:51:22 -0400 Received: from cloud.peff.net ([104.130.231.41]:57188 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231461AbhFPHvU (ORCPT ); Wed, 16 Jun 2021 03:51:20 -0400 Received: (qmail 11519 invoked by uid 109); 16 Jun 2021 07:49:12 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Wed, 16 Jun 2021 07:49:12 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 24196 invoked by uid 111); 16 Jun 2021 07:49:14 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Wed, 16 Jun 2021 03:49:14 -0400 Authentication-Results: peff.net; auth=none Date: Wed, 16 Jun 2021 03:49:12 -0400 From: Jeff King To: Junio C Hamano Cc: Johannes Schindelin , Luke Shumaker , Johannes Schindelin via GitGitGadget , git@vger.kernel.org, Luke Shumaker Subject: Re: [PATCH 1/2] subtree: fix the GIT_EXEC_PATH sanity check to work on Windows Message-ID: References: <87bl8d6xoq.wl-lukeshu@lukeshu.com> <875yyk7c3j.wl-lukeshu@lukeshu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Wed, Jun 16, 2021 at 09:52:34AM +0900, Junio C Hamano wrote: > Jeff King writes: > > >> So,... is contrib/subtree for Windows only? > > > > I read it as "this workaround is needed only on Windows, and will kick > > in only there; on other platforms, the "-ef" code will not run at all, > > so we don't have to worry about its portability". > > Yes, in the latest round that I queued yesterday, it is clear that > the use of non-POSIX "test" comes after the original condition > followed by "||", and even if "test" may sometimes be a builtin, I > do not think we will trigger an error at parse-time [*1*], so it is > a safe change. Yep, thanks for saying that last part out loud. > *1* I recall we had one interesting breakage of a script that tried > to do what is essentially: > > if are we running a shell with that funky feature? > then > shell commands that use the funky feature > else > portable POSIX shell feature > fi > > but the part that were supposed to be excluded from the > "portable" codepath by being between "then" and "else" still > were parsed and caused a parse error. IIRC, one instance was trying to redirect descriptors over 9. That works in bash but not elsewhere, but we ran into shells that choke on the parsing. So yeah, that is an important distinction in any portability workarounds. Sometimes an extra layer of "eval" can get around it, though. -Peff