git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: "Spencer E. Olson" <olsonse@umich.edu>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 2/2 (v2)] t7406: "git submodule update {--merge|--rebase]" with new submodules
Date: Thu, 17 Feb 2011 20:43:01 +0100	[thread overview]
Message-ID: <4D5D7A45.6020204@web.de> (raw)
In-Reply-To: <1297959526-8089-2-git-send-email-olsonse@umich.edu>

Am 17.02.2011 17:18, schrieb Spencer E. Olson:
> This patch adds two new test cases in t7406 to ensure that the --merge/--rebase
> options are ignored for "git submodule update" with new modules.  These test
> that a simple checkout is performed instead.
> 
> Signed-off-by: Spencer E. Olson <olsonse@umich.edu>
> ---
>  t/t7406-submodule-update.sh |   24 ++++++++++++++++++++++++
>  1 files changed, 24 insertions(+), 0 deletions(-)
> 
> diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
> index bfb4975..141251c 100755
> --- a/t/t7406-submodule-update.sh
> +++ b/t/t7406-submodule-update.sh
> @@ -203,4 +203,28 @@ test_expect_success 'submodule init picks up merge' '
>  	)
>  '
>  
> +test_expect_success 'submodule update --merge  - ignores --merge  for new submodules' '
> +	(cd super &&
> +	 rm -rf submodule &&
> +	 git submodule update submodule &&
> +	 git submodule status submodule >expect &&
> +	 rm -rf submodule &&
> +	 git submodule update --merge submodule &&
> +	 git submodule status submodule >actual &&
> +	 test_cmp expect actual
> +	)
> +'
> +
> +test_expect_success 'submodule update --rebase - ignores --rebase for new submodules' '
> +	(cd super &&
> +	 rm -rf submodule &&
> +	 git submodule update submodule &&
> +	 git submodule status submodule >expect &&
> +	 rm -rf submodule &&
> +	 git submodule update --rebase submodule &&
> +	 git submodule status submodule >actual &&
> +	 test_cmp expect actual
> +	)
> +'
> +
>  test_done

Thanks for writing these tests!

Unfortunately the first new test doesn't fail for me with current git.
This should be fixed to be able to detect regressions in the future, so
I came up with replacing the "git submodule status submodule" calls with
"git status -s submodule", which did the trick for me.

Apart from that tests which cover the case when rebase or merge are
configured via "submodule.<name>.update" would help, as that triggers
the same problem.

So maybe you want to squash the following diff in, then feel free to add:
Acked-by: Jens Lehmann <Jens.Lehmann@web.de>


diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index 141251c..fa9d23a 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -207,10 +207,10 @@ test_expect_success 'submodule update --merge  - ignores --merge  for new submod
 	(cd super &&
 	 rm -rf submodule &&
 	 git submodule update submodule &&
-	 git submodule status submodule >expect &&
+	 git status -s submodule >expect &&
 	 rm -rf submodule &&
 	 git submodule update --merge submodule &&
-	 git submodule status submodule >actual &&
+	 git status -s submodule >actual &&
 	 test_cmp expect actual
 	)
 '
@@ -219,10 +219,38 @@ test_expect_success 'submodule update --rebase - ignores --rebase for new submod
 	(cd super &&
 	 rm -rf submodule &&
 	 git submodule update submodule &&
-	 git submodule status submodule >expect &&
+	 git status -s submodule >expect &&
 	 rm -rf submodule &&
 	 git submodule update --rebase submodule &&
-	 git submodule status submodule >actual &&
+	 git status -s submodule >actual &&
+	 test_cmp expect actual
+	)
+'
+
+test_expect_success 'submodule update ignores update=merge config for new submodules' '
+	(cd super &&
+	 rm -rf submodule &&
+	 git submodule update submodule &&
+	 git status -s submodule >expect &&
+	 rm -rf submodule &&
+	 git config submodule.submodule.update merge &&
+	 git submodule update submodule &&
+	 git status -s submodule >actual &&
+	 git config --unset submodule.submodule.update &&
+	 test_cmp expect actual
+	)
+'
+
+test_expect_success 'submodule update ignores update=rebase config for new submodules' '
+	(cd super &&
+	 rm -rf submodule &&
+	 git submodule update submodule &&
+	 git status -s submodule >expect &&
+	 rm -rf submodule &&
+	 git config submodule.submodule.update rebase &&
+	 git submodule update submodule &&
+	 git status -s submodule >actual &&
+	 git config --unset submodule.submodule.update &&
 	 test_cmp expect actual
 	)
 '
-- 
1.7.4.1.109.g3d8f5

  reply	other threads:[~2011-02-17 19:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-17 16:18 [PATCH 1/2 (v2)] submodule: no [--merge|--rebase] when newly cloned Spencer E. Olson
2011-02-17 16:18 ` [PATCH 2/2 (v2)] t7406: "git submodule update {--merge|--rebase]" with new submodules Spencer E. Olson
2011-02-17 19:43   ` Jens Lehmann [this message]
2011-02-17 20:18     ` Junio C Hamano
2011-02-17 21:39       ` Jens Lehmann
2011-02-17 19:41 ` [PATCH 1/2 (v2)] submodule: no [--merge|--rebase] when newly cloned Jens Lehmann
2011-02-17 20:25   ` Junio C Hamano
2011-02-17 22:17     ` Spencer E. Olson
2011-02-17 23:37       ` Junio C Hamano
2011-02-17 23:50         ` Spencer E. Olson
2011-02-17 20:02 ` 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=4D5D7A45.6020204@web.de \
    --to=jens.lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=olsonse@umich.edu \
    /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).