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: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id DAFC01F506 for ; Thu, 22 Sep 2022 06:29:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230028AbiIVG1D (ORCPT ); Thu, 22 Sep 2022 02:27:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230143AbiIVG0k (ORCPT ); Thu, 22 Sep 2022 02:26:40 -0400 Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com [209.85.219.176]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 080F8B6573 for ; Wed, 21 Sep 2022 23:26:21 -0700 (PDT) Received: by mail-yb1-f176.google.com with SMTP id a67so11331839ybb.3 for ; Wed, 21 Sep 2022 23:26:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=YfB3lMaYrQ2zmbZmkbN6rxA8wIlCfvhUyOv4sniup84=; b=M10yjKjkp165XDjVzi2bGFG/eJAeY7ZM3pPTjiT6JNu+1wDLMau2HtDDtoLZr3AdS0 0EgWp9nw63bjGgIGKGWE0bsrqu6am5n94A6OisFy6AUTeQyI3nuNmkgH7d6Xza51i3xH QrbMSS6u4SqO9C21Up/nFg89auhLfBMDq4BS8K+ERA4KfVqrEHjHGw+ik2sgnVvalPd7 /iIQt7Fdg/+qEr8uNi6ZZSkokmMsNxJ6sX6hDWEt+Arna0xRq9BPZwuLrd0hvdAPKX8w VACNFt0uLygAPHW54u9gSgojYUe7jZtwwKP9EfTeMT3XQooUs1Ce6IXp9z4NG6PHedsx uqeg== X-Gm-Message-State: ACrzQf0rp0WcEvvmCnQMqFak2h4XE7r95Ztj3/8eBf7l/+LGk19HOCSk 1bFyf46TWX4BinbvGmZTcpQe0UJP6rRWlot3dw2b3rKI4kwizYD6 X-Google-Smtp-Source: AMsMyM7tC6zlHMQpQlkBpnptI+WoK4cIyvT1pmlTvOVHn5iGNr48zrIcyuhL502Fkdt2Rf+pAIv6K/w0xRW+mQ5Wewo= X-Received: by 2002:a05:6902:701:b0:6af:86d:b886 with SMTP id k1-20020a056902070100b006af086db886mr2071363ybt.419.1663827980602; Wed, 21 Sep 2022 23:26:20 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Eric Sunshine Date: Thu, 22 Sep 2022 02:26:09 -0400 Message-ID: Subject: Re: [PATCH 1/2] clone: allow "--bare" with "-o" To: Jeff King Cc: "John A. Leuenhagen" , Junio C Hamano , Git List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Thu, Sep 22, 2022 at 2:18 AM Jeff King wrote: > On Thu, Sep 22, 2022 at 01:58:36AM -0400, Eric Sunshine wrote: > > > + (cd parent && pwd) >expect && > > > + git -C clone-bare-o config remote.foo.url >actual && > > > + test_cmp expect actual > > > > Is this safe on Microsoft Windows? My understanding from t/README: > > > > When a test checks for an absolute path that a git command > > generated, construct the expected value using $(pwd) rather than > > $PWD, $TEST_DIRECTORY, or $TRASH_DIRECTORY. It makes a difference > > on Windows, where the shell (MSYS bash) mangles absolute path > > names. For details, see the commit message of 4114156ae9. > > > > was that you should use $(pwd) rather than raw `pwd` when comparing > > against a path generated by Git. Is there a gap in my understanding > > here? > > I think you might be mis-reading the advice here. It is saying to use > the "pwd" program, rather than relying on the shell's $PWD variable. So > $(pwd) and `pwd` are the same thing (and are what I'm using). The $() I > think is just indicating that you'd do: > > foo=$(pwd) > > And yes, I think this is a case where using the right one is important > (which is why I used the pwd program, and not $pwd in the test). > > Or am I missing something else? I was thinking, in particular, about this snippet from t/test-lib.sh: # git sees Windows-style pwd pwd () { builtin pwd -W } If that's inherited by the subshell used in the test, then I suppose all is okay, though I think it would not be inherited.