git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Brandon Williams <bmwill@google.com>, git@vger.kernel.org
Subject: Re: [PATCH 1/2] push: --dry-run updates submodules when --recurse-submodules=on-demand
Date: Tue, 15 Nov 2016 08:03:24 +0100	[thread overview]
Message-ID: <4a72ad14-0a8f-ede9-9f54-601fcd37740b@kdbg.org> (raw)
In-Reply-To: <1479172735-698-2-git-send-email-bmwill@google.com>

Am 15.11.2016 um 02:18 schrieb Brandon Williams:
> 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^

This line looks like a clean-up to be done after the test case. You 
should wrap it in test_when_finished, but outside of a sub-shell, which 
looks like it's just one line earlier, before the test_cmp.

> +'
> +
> +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"
> +		) &&

Could you please avoid this nested sub-shell? It is fine to cd around 
when you are in a sub-shell.

> +		git checkout master &&
> +		git rev-parse master >../expected_pub

Broken && chain.

> +		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 &&

All of the commands above are 'git something' that could become 'git -C 
work something' and then the sub-shell would be unnecessary. I'm not 
sure I would appreciate the verbosity of the result, though. (Perhaps 
aligning the git subcommands after -C foo would help.)

> +	test_cmp expected_pub actual_pub &&
> +	test_cmp expected_submodule actual_submodule
>  '
>
>  test_done
>


  reply	other threads:[~2016-11-15  7:03 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 ` [PATCH 1/2] push: --dry-run updates submodules when --recurse-submodules=on-demand Brandon Williams
2016-11-15  7:03   ` Johannes Sixt [this message]
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

  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=4a72ad14-0a8f-ede9-9f54-601fcd37740b@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=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.
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).