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.8 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 C8AAE1F506 for ; Thu, 22 Sep 2022 06:19:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229919AbiIVGSI (ORCPT ); Thu, 22 Sep 2022 02:18:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229899AbiIVGSF (ORCPT ); Thu, 22 Sep 2022 02:18:05 -0400 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 131E8B56CA for ; Wed, 21 Sep 2022 23:18:03 -0700 (PDT) Received: (qmail 4799 invoked by uid 109); 22 Sep 2022 06:18:03 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Thu, 22 Sep 2022 06:18:03 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 30757 invoked by uid 111); 22 Sep 2022 06:18:04 -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; Thu, 22 Sep 2022 02:18:04 -0400 Authentication-Results: peff.net; auth=none Date: Thu, 22 Sep 2022 02:18:02 -0400 From: Jeff King To: Eric Sunshine Cc: "John A. Leuenhagen" , Junio C Hamano , Git List Subject: Re: [PATCH 1/2] clone: allow "--bare" with "-o" Message-ID: References: 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 Thu, Sep 22, 2022 at 01:58:36AM -0400, Eric Sunshine wrote: > > diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh > > @@ -42,11 +42,12 @@ test_expect_success 'rejects invalid -o/--origin' ' > > +test_expect_success 'clone --bare -o' ' > > + git clone -o foo --bare parent clone-bare-o && > > + (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? -Peff