From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-2.6 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM,RP_MATCHES_RCVD shortcircuit=no autolearn=no autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id E7EF91FAED for ; Fri, 27 Oct 2017 15:11:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751811AbdJ0PLp (ORCPT ); Fri, 27 Oct 2017 11:11:45 -0400 Received: from mout.gmx.net ([212.227.17.21]:55113 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752664AbdJ0PJf (ORCPT ); Fri, 27 Oct 2017 11:09:35 -0400 Received: from virtualbox ([2.247.243.12]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LnPnu-1dXOeg1zyg-00hgMb; Fri, 27 Oct 2017 17:09:16 +0200 Date: Fri, 27 Oct 2017 17:09:12 +0200 (CEST) From: Johannes Schindelin X-X-Sender: virtualbox@virtualbox To: Bryan Turner cc: Jacob Keller , Junio C Hamano , Christian Couder , Git mailing list , Jeff King , Ben Peart , Jonathan Tan , Nguyen Thai Ngoc Duy , Mike Hommey , Lars Schneider , Eric Wong , Christian Couder Subject: Re: [PATCH 0/6] Create Git/Packet.pm In-Reply-To: Message-ID: References: <20171019123030.17338-1-chriscool@tuxfamily.org> User-Agent: Alpine 2.21.1 (DEB 209 2017-03-23) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Provags-ID: V03:K0:17rUhPIjNH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Wquw4NTgx2pCbQs GWrbeRcl2Wn0kv8YBMNDn7L4z97yrWmVk3aSLnPjM0pSNUg/I0= Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi Bryan, On Thu, 26 Oct 2017, Bryan Turner wrote: > On Thu, Oct 26, 2017 at 2:07 AM, Jacob Keller wrote: > > On Wed, Oct 25, 2017 at 10:38 PM, Junio C Hamano wrote: > >> Johannes Schindelin writes: > >> > >>> Note that the correct blib path starts with `C:\BuildAgent\_work` and > >>> the line > >>> > >>> use lib (split(/:/, $ENV{GITPERLLIB})); > >>> > >>> splits off the drive letter from the rest of the path. Obviously, this > >>> fails to Do The Right Thing, and simply points to Yet Another Portability > >>> Problem with Git's reliance on Unix scripting. > >> > >> In our C code, we have "#define PATH_SEP ';'", and encourage our > >> code to be careful and use it. Is there something similar for Perl > >> scripts, I wonder. > >> > >> I notice that t/{t0202,t9000,t9700}/test.pl share the same > >> split(/:/, $ENV{GITPERLLIB}); forcing this specific variable to use > >> the non-platform convention to accomodate the use of split(/:/) > >> certainly is a workaround, but it does feel dirty. > >> > >> It is hard to imagine that we were the first people who wants to > >> split the value of a variable into a list, where the value is a list > >> of paths, concatenated into a single string with a delimiter that > >> may be platform specific. I wonder if we are going against a best > >> practice established in the Perl world, simply because we don't know > >> about it (i.e. basically, it would say "don't split at a colon > >> because not all world is Unix; use $this_module instead", similar to > >> "don't split at a slash, use File::Spec instead to extract path > >> components"). > >> > > > > I thought there was a way to do this in File::Spec, but that's only > > for splitting regular paths, and not for splitting a list of paths > > separated by ":" or ";" > > > > We probably should find a better solution to allow this to work with > > windows style paths...? I know that python provides os.pathsep, but I > > haven't seen an equivalent for perl yet. > > > > The Env[1] core modules suggests using $Config::Config{path_sep}[2].. > > maybe we should be using this? > > I was testing this recently on the Perl included with Git for Windows > and it returns : for the path separator even though it's on Windows, > so I don't think that would work. The Perl in Git for Windows seems to > want UNIX-style inputs (something Dscho seemed to allude to in his > response earlier.). I'm not sure why it's that way, but he probably > knows. MSYS2 Perl is essentially Cygwin's Perl ported over to MSYS2. And Cygwin tries to keep everything as pseudo Unix as possible, to make it easier to port software (if you think Git's source code is the only source code woefully unprepared for semicolons as path separators, you just need to buy me a few beers to hear plenty of war stories). Ciao, Dscho