From: Brandon Williams <bmwill@google.com>
To: git@vger.kernel.org
Cc: Brandon Williams <bmwill@google.com>
Subject: [PATCH 1/2] push: --dry-run updates submodules when --recurse-submodules=on-demand
Date: Mon, 14 Nov 2016 17:18:54 -0800 [thread overview]
Message-ID: <1479172735-698-2-git-send-email-bmwill@google.com> (raw)
In-Reply-To: <1479172735-698-1-git-send-email-bmwill@google.com>
This patch adds a test to illustrate how push run with --dry-run doesn't
actually perform a dry-run when push is configured to push submodules
on-demand. Instead all submodules which need to be pushed are actually
pushed to their remotes while any updates for the superproject are
performed as a dry-run. This is a bug and not the intended behaviour of
a dry-run.
Signed-off-by: Brandon Williams <bmwill@google.com>
---
t/t5531-deep-submodule-push.sh | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh
index 198ce84..e6ccc30 100755
--- a/t/t5531-deep-submodule-push.sh
+++ b/t/t5531-deep-submodule-push.sh
@@ -427,7 +427,31 @@ test_expect_success 'push unpushable submodule recursively fails' '
cd submodule.git &&
git rev-parse master >../actual
) &&
- test_cmp expected actual
+ test_cmp expected actual &&
+ git -C work reset --hard master^
+'
+
+test_expect_failure 'push --dry-run does not recursively update submodules' '
+ (
+ cd work &&
+ (
+ cd gar/bage &&
+ git checkout master &&
+ git rev-parse master >../../../expected_submodule &&
+ > junk9 &&
+ git add junk9 &&
+ git commit -m "Ninth junk"
+ ) &&
+ git checkout master &&
+ git rev-parse master >../expected_pub
+ git add gar/bage &&
+ git commit -m "Ninth commit for gar/bage" &&
+ git push --dry-run --recurse-submodules=on-demand ../pub.git master
+ ) &&
+ git -C submodule.git rev-parse master >actual_submodule &&
+ git -C pub.git rev-parse master >actual_pub &&
+ test_cmp expected_pub actual_pub &&
+ test_cmp expected_submodule actual_submodule
'
test_done
--
2.8.0.rc3.226.g39d4020
next prev parent reply other threads:[~2016-11-15 1:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-15 1:18 [PATCH 0/2] bug fix with push --dry-run and submodules Brandon Williams
2016-11-15 1:18 ` Brandon Williams [this message]
2016-11-15 7:03 ` [PATCH 1/2] push: --dry-run updates submodules when --recurse-submodules=on-demand Johannes Sixt
2016-11-15 17:29 ` Brandon Williams
2016-11-15 19:46 ` Johannes Sixt
2016-11-15 1:18 ` [PATCH 2/2] push: fix --dry-run to not push submodules Brandon Williams
2016-11-17 18:46 ` [PATCH v2 0/2] bug fix with push --dry-run and submodules Brandon Williams
2016-11-17 18:46 ` [PATCH v2 1/2] push: --dry-run updates submodules when --recurse-submodules=on-demand Brandon Williams
2016-11-17 18:46 ` [PATCH v2 2/2] push: fix --dry-run to not push submodules Brandon Williams
2016-11-17 18:59 ` Stefan Beller
2016-11-17 19:02 ` Brandon Williams
2016-11-22 17:43 ` Junio C Hamano
2016-11-22 18:18 ` Brandon Williams
2016-11-23 16:51 ` Junio C Hamano
2016-11-17 19:01 ` [PATCH v2 0/2] bug fix with push --dry-run and submodules Stefan Beller
2016-11-17 19:06 ` Brandon Williams
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=1479172735-698-2-git-send-email-bmwill@google.com \
--to=bmwill@google.com \
--cc=git@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.