git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Heiko Voigt <hvoigt@hvoigt.net>
To: git@vger.kernel.org
Cc: sbeller@google.com, jrnieder@gmail.com, Jens.Lehmann@web.de,
	bmwill@google.com
Subject: [RFC PATCH 2/4] change submodule push test to use proper repository setup
Date: Sat, 7 Oct 2017 00:32:34 +0200	[thread overview]
Message-ID: <20171006223234.GC26642@sandbox> (raw)
In-Reply-To: <20171006222544.GA26642@sandbox>

NOTE: The argument in this message is not correct, see description in
cover letter.

The setup of the repositories in this test is using gitlinks without the
.gitmodules infrastructure. It is however testing convenience features
like --recurse-submodules=on-demand. These features are already not
supported by fetch without a .gitmodules file. This leads us to the
conclusion that it is not really used here as well.

Let's use the usual submodule commands to setup the repository in a
typical way. This also has the advantage that we are testing with a
repository structure that is more similar to one we could expect on a
users setup.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
---

As mentioned in the cover letter. This seems to be the only test that
ensures that we stay compatible with setups without .gitmodules. Maybe
we should add/revive some?

Cheers Heiko

 t/t5531-deep-submodule-push.sh | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh
index 39cb2c1..a4a2c6a 100755
--- a/t/t5531-deep-submodule-push.sh
+++ b/t/t5531-deep-submodule-push.sh
@@ -8,22 +8,26 @@ test_expect_success setup '
 	mkdir pub.git &&
 	GIT_DIR=pub.git git init --bare &&
 	GIT_DIR=pub.git git config receive.fsckobjects true &&
+	mkdir submodule &&
+	(
+		cd submodule &&
+		git init &&
+		git config push.default matching &&
+		>junk &&
+		git add junk &&
+		git commit -m "Initial junk"
+	) &&
+	git clone --bare submodule submodule.git &&
 	mkdir work &&
 	(
 		cd work &&
 		git init &&
 		git config push.default matching &&
-		mkdir -p gar/bage &&
-		(
-			cd gar/bage &&
-			git init &&
-			git config push.default matching &&
-			>junk &&
-			git add junk &&
-			git commit -m "Initial junk"
-		) &&
-		git add gar/bage &&
+		mkdir gar &&
+		git submodule add ../submodule.git gar/bage &&
 		git commit -m "Initial superproject"
+		cd gar/bage &&
+		git remote rm origin
 	)
 '
 
@@ -51,11 +55,10 @@ test_expect_success 'push if submodule has no remote' '
 
 test_expect_success 'push fails if submodule commit not on remote' '
 	(
-		cd work/gar &&
-		git clone --bare bage ../../submodule.git &&
-		cd bage &&
+		cd work/gar/bage &&
 		git remote add origin ../../../submodule.git &&
 		git fetch &&
+		git push --set-upstream origin master &&
 		>junk3 &&
 		git add junk3 &&
 		git commit -m "Third junk"
-- 
2.10.0.129.g35f6318


  parent reply	other threads:[~2017-10-06 22:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-06 22:25 [RFC PATCH v3 0/4] implement fetching of moved submodules Heiko Voigt
2017-10-06 22:30 ` [RFC PATCH 1/4] fetch: add test to make sure we stay backwards compatible Heiko Voigt
2017-10-06 22:32 ` Heiko Voigt [this message]
2017-10-09 18:20   ` [RFC PATCH 2/4] change submodule push test to use proper repository setup Stefan Beller
2017-10-10 13:03     ` Heiko Voigt
2017-10-10 18:39       ` Stefan Beller
2017-10-10 23:31         ` Junio C Hamano
2017-10-10 23:41           ` Stefan Beller
2017-10-11  0:19           ` Junio C Hamano
2017-10-11 14:56           ` Heiko Voigt
2017-10-12  0:26             ` Junio C Hamano
2017-10-11 14:52         ` Heiko Voigt
2017-10-11 15:10         ` Josh Triplett
2017-10-12 16:17           ` Brandon Williams
2017-10-06 22:34 ` [RFC PATCH v3 3/4] implement fetching of moved submodules Heiko Voigt
2017-10-06 22:35 ` [RFC PATCH v3 4/4] submodule: simplify decision tree whether to or not to fetch Heiko Voigt
2017-10-06 22:57 ` [RFC PATCH v3 0/4] implement fetching of moved submodules Stefan Beller
2017-10-07  1:24 ` 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=20171006223234.GC26642@sandbox \
    --to=hvoigt@hvoigt.net \
    --cc=Jens.Lehmann@web.de \
    --cc=bmwill@google.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=sbeller@google.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).