All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Karthik Nayak <karthik.188@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] t7900: adapt some tests to use a throwaway repository
Date: Wed, 12 Aug 2026 12:07:19 +0200	[thread overview]
Message-ID: <anxF0P0KVizediDg@pks.im> (raw)
In-Reply-To: <CAOLa=ZTAV=JqOvE0xkE4zmHMm=xx40_3g42ob9RDBRXmw3u6_g@mail.gmail.com>

On Wed, Aug 12, 2026 at 01:19:13AM -0700, Karthik Nayak wrote:
> Patrick Steinhardt <ps@pks.im> writes:
> > diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
> > index 4238569b68..6735a9e082 100755
> > --- a/t/t7900-maintenance.sh
> > +++ b/t/t7900-maintenance.sh
> > @@ -67,41 +67,57 @@ test_expect_success 'run [--auto|--quiet] with gc strategy' '
[snip]
> >  test_expect_success 'maintenance.auto overrides gc.auto' '
> > -	test_when_finished "rm -f trace" &&
> > +	test_when_finished "rm -rf repo" &&
> > +	git init repo &&
> > +	(
> > +		cd repo &&
> >
> > -	test_config maintenance.auto false &&
> > -	test_config gc.auto 1 &&
> > -	GIT_TRACE2_EVENT="$(pwd)/trace" git commit --quiet --allow-empty -m 1 &&
> > -	test_subcommand ! git maintenance run --auto --quiet --detach <trace &&
> > +		git config set maintenance.auto false &&
> > +		git config set gc.auto 1 &&
> 
> So we change from using `test_config` to `git config`, I assume this is
> because earlier since we used a shared folder, we had to undo any config
> changes made. Now that's no longer needed. Nit: This is okay, but
> would've been nicer to call out.

The issue with `test_config` is that it executes `test_when_finished`,
and that function cannot run in subshells. So we have to use `git config
set` instead, but because it's a throw-away repository it doesn't
matter.

Patrick

  reply	other threads:[~2026-08-12 10:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07 10:59 [PATCH 0/2] t7900: fix flaky "maintenance.strategy" test Patrick Steinhardt
2026-08-07 10:59 ` [PATCH 1/2] t7900: adapt some tests to use a throwaway repository Patrick Steinhardt
2026-08-12  8:19   ` Karthik Nayak
2026-08-12 10:07     ` Patrick Steinhardt [this message]
2026-08-12  8:19   ` Karthik Nayak
2026-08-07 10:59 ` [PATCH 2/2] t7900: fix flaky "maintenance.strategy" test Patrick Steinhardt
2026-08-12  8:46   ` Karthik Nayak
2026-08-12 10:09     ` Patrick Steinhardt
2026-08-12 10:11 ` [PATCH v2 0/2] " Patrick Steinhardt
2026-08-12 10:11   ` [PATCH v2 1/2] t7900: adapt some tests to use a throwaway repository Patrick Steinhardt
2026-08-12 10:11   ` [PATCH v2 2/2] t7900: fix flaky "maintenance.strategy" test Patrick Steinhardt

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=anxF0P0KVizediDg@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=karthik.188@gmail.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 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.