From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.3 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id BE1D81F597 for ; Mon, 16 Jul 2018 15:51:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729778AbeGPQTt (ORCPT ); Mon, 16 Jul 2018 12:19:49 -0400 Received: from mout.gmx.net ([212.227.17.21]:46693 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727376AbeGPQTt (ORCPT ); Mon, 16 Jul 2018 12:19:49 -0400 Received: from [192.168.0.129] ([37.201.195.94]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M81vR-1g1HP92fkP-00vcIH; Mon, 16 Jul 2018 17:51:30 +0200 Date: Mon, 16 Jul 2018 17:51:26 +0200 (DST) From: Johannes Schindelin X-X-Sender: virtualbox@gitforwindows.org To: Eric Sunshine cc: git@vger.kernel.org, Elijah Newren , Johannes Sixt , Jonathan Nieder , Jonathan Tan , Stefan Beller , Junio C Hamano , Luke Diamand , Jeff King Subject: Re: [PATCH 11/25] t7400: fix broken "submodule add/reconfigure --force" test In-Reply-To: Message-ID: References: <20180702002405.3042-1-sunshine@sunshineco.com> <20180702002405.3042-12-sunshine@sunshineco.com> 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:K1:FcY3wwfr9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ViU4YbNUNG R8W7X/V Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi Eric, On Mon, 16 Jul 2018, Johannes Schindelin wrote: > On Sun, 1 Jul 2018, Eric Sunshine wrote: > > > This test has been dysfunctional since it was added by 619acfc78c > > (submodule add: extend force flag to add existing repos, 2016-10-06), > > however, two problems early in the test went unnoticed due to a broken > > &&-chain later in the test. > > > > First, it tries configuring the submodule with repository "bogus-url", > > however, "git submodule add" insists that the repository be either an > > absolute URL or a relative pathname requiring prefix "./" or "../" (this > > is true even with --force), but "bogus-url" does not meet those > > criteria, thus the command fails. > > > > Second, it then tries configuring a submodule with a path which is > > .gitignore'd, which is disallowed. This restriction can be overridden > > with --force, but the test neglects to use that option. > > > > Fix both problems, as well as the broken &&-chain behind which they hid. > > > > Reviewed-by: Stefan Beller > > Signed-off-by: Eric Sunshine > > --- > > t/t7400-submodule-basic.sh | 10 +++++----- > > 1 file changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh > > index 812db137b8..401adaed32 100755 > > --- a/t/t7400-submodule-basic.sh > > +++ b/t/t7400-submodule-basic.sh > > @@ -171,12 +171,12 @@ test_expect_success 'submodule add to .gitignored path with --force' ' > > test_expect_success 'submodule add to reconfigure existing submodule with --force' ' > > ( > > cd addtest-ignore && > > - git submodule add --force bogus-url submod && > > - git submodule add -b initial "$submodurl" submod-branch && > > - test "bogus-url" = "$(git config -f .gitmodules submodule.submod.url)" && > > - test "bogus-url" = "$(git config submodule.submod.url)" && > > + git submodule add --force /bogus-url submod && > > + git submodule add --force -b initial "$submodurl" submod-branch && > > + test "/bogus-url" = "$(git config -f .gitmodules submodule.submod.url)" && > > + test "/bogus-url" = "$(git config submodule.submod.url)" && > > # Restore the url > > - git submodule add --force "$submodurl" submod > > + git submodule add --force "$submodurl" submod && > > test "$submodurl" = "$(git config -f .gitmodules submodule.submod.url)" && > > test "$submodurl" = "$(git config submodule.submod.url)" > > ) > > This breaks on Windows because of the absolute Unix-y path having to be > translated to a Windows path: > > https://git-for-windows.visualstudio.com/git/git%20Team/_build/results?buildId=12365&view=logs > > (In this case, it is prefixed with `C:/git-sdk-64-ci` because that is the > pseudo root when running in a Git for Windows SDK that is installed into > that directory.) > > I could imagine that using "$(pwd)/bogus-url" (which will generate a > Windows-y absolute path on Windows) would work, though. Yes, this works indeed, see the patch below. Could you please squash it in if you send another iteration of your patch series? Junio, could you please add this as a SQUASH??? commit so that `pu` is fixed on Windows? Thanks. -- snipsnap -- diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index 5ffc2726aad..2c2c97e1441 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -171,10 +171,11 @@ test_expect_success 'submodule add to .gitignored path with --force' ' test_expect_success 'submodule add to reconfigure existing submodule with --force' ' ( cd addtest-ignore && - git submodule add --force /bogus-url submod && + bogus_url="$(pwd)/bogus-url" && + git submodule add --force "$bogus_url" submod && git submodule add --force -b initial "$submodurl" submod-branch && - test "/bogus-url" = "$(git config -f .gitmodules submodule.submod.url)" && - test "/bogus-url" = "$(git config submodule.submod.url)" && + test "$bogus_url" = "$(git config -f .gitmodules submodule.submod.url)" && + test "$bogus_url" = "$(git config submodule.submod.url)" && # Restore the url git submodule add --force "$submodurl" submod && test "$submodurl" = "$(git config -f .gitmodules submodule.submod.url)" &&