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 17E3F1F5AE for ; Tue, 15 Jun 2021 10:56:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231608AbhFOK6h (ORCPT ); Tue, 15 Jun 2021 06:58:37 -0400 Received: from cloud.peff.net ([104.130.231.41]:55878 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231516AbhFOK6g (ORCPT ); Tue, 15 Jun 2021 06:58:36 -0400 Received: (qmail 7450 invoked by uid 109); 15 Jun 2021 10:56:32 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Tue, 15 Jun 2021 10:56:32 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 13480 invoked by uid 111); 15 Jun 2021 10:56:31 -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; Tue, 15 Jun 2021 06:56:31 -0400 Authentication-Results: peff.net; auth=none Date: Tue, 15 Jun 2021 06:56:31 -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 Tue, Jun 15, 2021 at 11:33:58AM +0900, Junio C Hamano wrote: > Johannes Schindelin writes: > > >> `test FILE1 -ef FILE2` checks wether the inode is the same. And it's > >> POSIX, so I'm assuming that it's sufficiently portable, though I > >> haven't actually tested whether things other than Bash implement it. > > > > It's not POSIX. From > > https://pubs.opengroup.org/onlinepubs/009695399/utilities/test.html: > > > > Some additional primaries newly invented or from the KornShell > > appeared in an early proposal as part of the conditional command > > ([[]]): s1 > s2, s1 < s2, str = pattern, str != pattern, > > f1 -nt f2, f1 -ot f2, and f1 -ef f2. > > > > Having said that, it appears that Bash implements it (what non-standard > > behavior _doesn't_ it implement ;-)) > > > > And since Git for Windows ships with Bash, we can actually use it! > > 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". But having seen the earlier part of the thread, it looks like "are we on Windows" is predicated on "! type -p cygpath", which seems a bit loose. I also think "-p" is a bash-ism, so we'd want to avoid it before determining whether we're on Windows to avoid a chicken-and-egg on other platforms. -Peff