From: Brandon Williams <bmwill@google.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] push: --dry-run updates submodules when --recurse-submodules=on-demand
Date: Tue, 15 Nov 2016 09:29:09 -0800 [thread overview]
Message-ID: <20161115172909.GA66382@google.com> (raw)
In-Reply-To: <4a72ad14-0a8f-ede9-9f54-601fcd37740b@kdbg.org>
On 11/15, Johannes Sixt wrote:
> 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.
K will do.
>
> >+'
> >+
> >+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.
Yes I can reorganize it to avoid the nested sub-shells. I was just
trying to follow the organization of the other tests in the same file.
>
> >+ 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.)
I'll play around with it and try to make it look pretty while trying to
avoid sub-shells. I'm assuming the reason we want to avoid sub-shells is
for performance reasons right?
--
Brandon Williams
next prev parent reply other threads:[~2016-11-15 17:29 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
2016-11-15 17:29 ` Brandon Williams [this message]
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=20161115172909.GA66382@google.com \
--to=bmwill@google.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.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 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).