git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Stefan Beller <sbeller@google.com>, git@vger.kernel.org
Subject: Re: [PATCH] t5614: don't use subshells
Date: Tue, 21 Jun 2016 15:38:24 -0400	[thread overview]
Message-ID: <20160621193824.GA22183@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqh9cmpcze.fsf@gitster.mtv.corp.google.com>

On Tue, Jun 21, 2016 at 12:18:29PM -0700, Junio C Hamano wrote:

> Stefan Beller <sbeller@google.com> writes:
> 
> >  Unlike the prior patch we would not want this patch to fall through
> >  to origin/maint fast, but allow cooking?
> 
> I do not see anything that makes this treated differently from the
> other fix.  The only difference in behaviour is that "lines" file is
> now created at the root level of the trash repository's working tree
> instead of tested clones', and I do not think any test depends on
> the number of untracked paths in the trash working tree or tries to
> make sure a file called "lines" is not in there.

I think it is only that the other patch is actually fixing something,
whereas this is cleanup. So the cost/benefit equation is different. I
agree neither is high-risk and a test cleanup is generally OK for maint
(the other is a serious-ish regression IMHO).

> Having said that, I wonder if we want further reduction of the
> repetition.  Each test except "setup" in this script does an
> identical thing with very small set of parameters:
> 
>     - make sure super_clone will be removed when done.
>     - clone file://$pwd/. to super_clone but with different set of options.
>     - check the commits in super_clone and super_clone/sub.
> 
> So, the above would ideally become something like
> 
> do_test 3 3 --recurse-submodules
> 
> where the helper would look like
> 
> do_test () {
> 	cnt_super=$1 cnt_sub=$2 &&
>         shift 2 &&
>         test_when_finished "rm -fr super_clone" &&
>         git clone "$@" "file://$pwd/." super_clone &&
>         git -C super_clone log --oneline >lines &&
>         test_line_count = $cnt_super lines &&
>         git -C super_clone/sub log --oneline >lines &&
>         test_line_count = $cnt_sub lines
> }
> 
> Would it rob too much flexibility from future tests to be added to
> this script if we did it that way?

I think that's an improvement, too. Even if we add further tests, they
don't have to follow the same format. I would give the function a better
name than "do_test" though. :P

-Peff

  reply	other threads:[~2016-06-21 19:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20 17:21 [PATCH] t5614: don't use subshells Stefan Beller
2016-06-21 19:18 ` Junio C Hamano
2016-06-21 19:38   ` Jeff King [this message]
2016-06-21 20:14     ` Stefan Beller

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=20160621193824.GA22183@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sbeller@google.com \
    /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).