git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: git@vger.kernel.org, Elijah Newren <newren@gmail.com>,
	Johannes Sixt <j6t@kdbg.org>,
	Jonathan Nieder <jrnieder@gmail.com>,
	Jonathan Tan <jonathantanmy@google.com>,
	Stefan Beller <sbeller@google.com>,
	Junio C Hamano <gitster@pobox.com>,
	Luke Diamand <luke@diamand.org>, Jeff King <peff@peff.net>
Subject: Re: [PATCH 11/25] t7400: fix broken "submodule add/reconfigure --force" test
Date: Mon, 16 Jul 2018 17:51:26 +0200 (DST)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.1807161749410.71@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.1807161641140.71@tvgsbejvaqbjf.bet>

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 <sbeller@google.com>
> > Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
> > ---
> >  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)" &&

  reply	other threads:[~2018-07-16 15:51 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02  0:23 [PATCH 00/25] fix buggy tests, modernize tests, fix broken &&-chains Eric Sunshine
2018-07-02  0:23 ` [PATCH 01/25] t: use test_might_fail() instead of manipulating exit code manually Eric Sunshine
2018-07-02 17:44   ` Stefan Beller
2018-07-02 20:58     ` Eric Sunshine
2018-07-03 19:20   ` Junio C Hamano
2018-07-02  0:23 ` [PATCH 02/25] t: use test_write_lines() instead of series of 'echo' commands Eric Sunshine
2018-07-02 17:53   ` Stefan Beller
2018-07-02  0:23 ` [PATCH 03/25] t: use sane_unset() rather than 'unset' with broken &&-chain Eric Sunshine
2018-07-02  0:23 ` [PATCH 04/25] t: drop unnecessary terminating semicolon in subshell Eric Sunshine
2018-07-03 19:23   ` Junio C Hamano
2018-07-02  0:23 ` [PATCH 05/25] t/lib-submodule-update: fix "absorbing" test Eric Sunshine
2018-07-02  0:23 ` [PATCH 06/25] t5405: use test_must_fail() instead of checking exit code manually Eric Sunshine
2018-07-02  0:23 ` [PATCH 07/25] t5406: use write_script() instead of birthing shell script manually Eric Sunshine
2018-07-02  0:23 ` [PATCH 08/25] t5505: modernize and simplify hard-to-digest test Eric Sunshine
2018-07-02  0:23 ` [PATCH 09/25] t6036: fix broken "merge fails but has appropriate contents" tests Eric Sunshine
2018-07-02  0:23 ` [PATCH 10/25] t7201: drop pointless "exit 0" at end of subshell Eric Sunshine
2018-07-02  0:23 ` [PATCH 11/25] t7400: fix broken "submodule add/reconfigure --force" test Eric Sunshine
2018-07-16 14:43   ` Johannes Schindelin
2018-07-16 15:51     ` Johannes Schindelin [this message]
2018-07-16 18:50       ` Eric Sunshine
2018-07-16 21:37         ` Junio C Hamano
2018-07-16 23:05           ` Eric Sunshine
2018-07-17 10:09             ` Johannes Schindelin
2018-07-17 17:53           ` Junio C Hamano
2018-07-02  0:23 ` [PATCH 12/25] t7810: use test_expect_code() instead of hand-rolled comparison Eric Sunshine
2018-07-02 18:05   ` Stefan Beller
2018-07-02 21:12     ` Eric Sunshine
2018-07-02  0:23 ` [PATCH 13/25] t9001: fix broken "invoke hook" test Eric Sunshine
2018-07-02  0:23 ` [PATCH 14/25] t9814: simplify convoluted check that command correctly errors out Eric Sunshine
2018-07-02  0:23 ` [PATCH 15/25] t0000-t0999: fix broken &&-chains Eric Sunshine
2018-07-02  0:23 ` [PATCH 16/25] t1000-t1999: " Eric Sunshine
2018-07-02  0:23 ` [PATCH 17/25] t2000-t2999: " Eric Sunshine
2018-07-02  0:23 ` [PATCH 18/25] t3000-t3999: " Eric Sunshine
2018-07-02  0:23 ` [PATCH 19/25] t3030: " Eric Sunshine
2018-07-02  0:24 ` [PATCH 20/25] t4000-t4999: " Eric Sunshine
2018-07-02  0:24 ` [PATCH 21/25] t5000-t5999: " Eric Sunshine
2018-07-12 12:37   ` SZEDER Gábor
2018-07-12 17:44     ` Eric Sunshine
2018-07-12 18:19       ` Jeff King
2018-07-12 18:31       ` Junio C Hamano
2018-07-12 18:35         ` Junio C Hamano
2018-07-12 18:46           ` Eric Sunshine
2018-07-12 18:50             ` Junio C Hamano
2018-07-12 18:53               ` Eric Sunshine
2018-07-17  8:15           ` SZEDER Gábor
2018-07-02  0:24 ` [PATCH 22/25] t6000-t6999: " Eric Sunshine
2018-07-02  0:24 ` [PATCH 23/25] t7000-t7999: " Eric Sunshine
2018-07-02  0:24 ` [PATCH 24/25] t9000-t9999: " Eric Sunshine
2018-07-02  0:24 ` [PATCH 25/25] t9119: " Eric Sunshine
2018-07-02 18:27 ` [PATCH 00/25] fix buggy tests, modernize tests, " Stefan Beller
2018-07-02 21:20   ` Eric Sunshine
2018-07-03 19:40 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.QRO.7.76.6.1807161749410.71@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=jonathantanmy@google.com \
    --cc=jrnieder@gmail.com \
    --cc=luke@diamand.org \
    --cc=newren@gmail.com \
    --cc=peff@peff.net \
    --cc=sbeller@google.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).