git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Crowe <mac@mcrowe.com>
To: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Cc: Mike Crowe <mac@mcrowe.com>, Jeff King <peff@peff.net>
Subject: [PATCH 1/2] push: Fully test --recurse-submodules on command line overrides config
Date: Thu,  3 Dec 2015 13:10:34 +0000	[thread overview]
Message-ID: <1449148235-29569-1-git-send-email-mac@mcrowe.com> (raw)
In-Reply-To: <20151203131006.GA5119@mcrowe.com>

t5531 only checked that the push.recurseSubmodules config option was
overridden by passing --recurse-submodules=check on the command line.
Add new tests for overriding with --recurse-submodules=no,
--no-recurse-submodules and --recurse-submodules=push too.

Also correct minor typo in test commit message.

Signed-off-by: Mike Crowe <mac@mcrowe.com>
---
 t/t5531-deep-submodule-push.sh | 32 ++++++++++++++++++++++++++++----
 1 file changed, 28 insertions(+), 4 deletions(-)

diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh
index 9fda7b0..721be32 100755
--- a/t/t5531-deep-submodule-push.sh
+++ b/t/t5531-deep-submodule-push.sh
@@ -126,24 +126,48 @@ test_expect_success 'push succeeds if submodule commit not on remote but using o
 	)
 '
 
-test_expect_success 'push fails if submodule commit not on remote using check from cmdline overriding config' '
+test_expect_success 'push recurse-submodules on command line overrides config' '
 	(
 		cd work/gar/bage &&
 		>recurse-check-on-command-line-overriding-config &&
 		git add recurse-check-on-command-line-overriding-config &&
-		git commit -m "Recurse on command-line overridiing config junk"
+		git commit -m "Recurse on command-line overriding config junk"
 	) &&
 	(
 		cd work &&
 		git add gar/bage &&
 		git commit -m "Recurse on command-line overriding config for gar/bage" &&
+
+		# Ensure that we can override on-demand in the config
+		# to just check submodules
 		test_must_fail git -c push.recurseSubmodules=on-demand push --recurse-submodules=check ../pub.git master &&
 		# Check that the supermodule commit did not get there
 		git fetch ../pub.git &&
 		git diff --quiet FETCH_HEAD master^ &&
 		# Check that the submodule commit did not get there
-		cd gar/bage &&
-		git diff --quiet origin/master master^
+		(cd gar/bage && git diff --quiet origin/master master^) &&
+
+		# Ensure that we can override check in the config to
+		# disable submodule recursion entirely
+		(cd gar/bage && git diff --quiet origin/master master^) &&
+		git -c push.recurseSubmodules=on-demand push --recurse-submodules=no ../pub.git master &&
+		git fetch ../pub.git &&
+		git diff --quiet FETCH_HEAD master &&
+		(cd gar/bage && git diff --quiet origin/master master^) &&
+
+		# Ensure that we can override check in the config to
+		# disable submodule recursion entirely (alternative form)
+		git -c push.recurseSubmodules=on-demand push --no-recurse-submodules ../pub.git master &&
+		git fetch ../pub.git &&
+		git diff --quiet FETCH_HEAD master &&
+		(cd gar/bage && git diff --quiet origin/master master^) &&
+
+		# Ensure that we can override check in the config to
+		# push the submodule too
+		git -c push.recurseSubmodules=check push --recurse-submodules=on-demand ../pub.git master &&
+		git fetch ../pub.git &&
+		git diff --quiet FETCH_HEAD master &&
+		(cd gar/bage && git diff --quiet origin/master master)
 	)
 '
 
-- 
2.1.4

  reply	other threads:[~2015-12-03 13:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01 11:49 [PATCH v3] push: add recurseSubmodules config option Mike Crowe
2015-12-02  0:40 ` Jeff King
2015-12-02  9:54   ` Mike Crowe
2015-12-02  9:56     ` [PATCH] push: Improve --recurse-submodules support Mike Crowe
2015-12-02 23:21       ` Junio C Hamano
2015-12-03 13:10         ` Mike Crowe
2015-12-03 13:10           ` Mike Crowe [this message]
2015-12-03 13:10             ` [PATCH 2/2] push: Use "last one wins" convention for --recurse-submodules Mike Crowe
2015-12-04 21:04               ` Junio C Hamano
2015-12-10 23:31               ` Stefan Beller
2015-12-10 23:38                 ` Junio C Hamano
2015-12-10 23:44                   ` Stefan Beller
2015-12-16 20:48             ` [PATCH 1/2] push: Fully test --recurse-submodules on command line overrides config Stefan Beller
2015-12-16 22:41               ` Junio C Hamano
2015-12-16 22:46                 ` Stefan Beller
2015-12-17 16:41                   ` 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

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

  git send-email \
    --in-reply-to=1449148235-29569-1-git-send-email-mac@mcrowe.com \
    --to=mac@mcrowe.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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.
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 NNTP newsgroup(s).