git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Derrick Stolee <stolee@gmail.com>, Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Taylor Blau <me@ttaylorr.com>
Subject: Re: [PATCH] multi-pack-index: fix --object-dir from outside repo
Date: Mon, 23 Aug 2021 15:40:10 +0200	[thread overview]
Message-ID: <746f574d20c54b5f7d1eaae74f54a624573ad6bc.camel@sipsolutions.net> (raw)
In-Reply-To: <414ed641-2bd3-1316-8189-ad542988d091@gmail.com>

On Mon, 2021-08-23 at 09:19 -0400, Derrick Stolee wrote:
> 
> We just add subshells this way:
> 
> test_expect_success 'test name' '
> 	prep_step &&
> 	(
> 		# now in a subshell
> 		cd wherever &&
> 		do things
> 		# don't need to cd again
> 	) &&
> 	continue test
> '

Sure. I know how to do subshells :)

My point was that inside the subshell you cannot do test_path_is_file
and similar, because the subshell didn't import the libs.

> > More importantly, how do you feel about the "cd /"?
> > 
> > The tests are always run in a place where there's a parent git folder
> > (even if it's git itself), so you cannot reproduce the segfault in a
> > test without the "cd /", though I guess "cd /tmp" would also work or
> > something, but "cd /" felt pretty safe, hopefully not many people have
> > "/.git" on their system.
> 
> Don't leave the directory your test is set up to run in.

I was specifically asking Junio ;-)

But realistically, if this is the requirement you want to impose, then
you _cannot_ test for the segfault within git's test suite. Your loss.

johannes



  reply	other threads:[~2021-08-23 13:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-20 19:35 [PATCH] multi-pack-index: fix --object-dir from outside repo Johannes Berg
2021-08-22 23:51 ` Derrick Stolee
2021-08-23  7:21   ` Johannes Berg
2021-08-23  8:05     ` Junio C Hamano
2021-08-23  8:10       ` Johannes Berg
2021-08-23 13:19         ` Derrick Stolee
2021-08-23 13:40           ` Johannes Berg [this message]
2021-08-23 16:16             ` Junio C Hamano
2021-08-23 16:06         ` Junio C Hamano
2021-08-23  0:54 ` Taylor Blau
2021-08-23  7:32   ` Johannes Berg

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=746f574d20c54b5f7d1eaae74f54a624573ad6bc.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    --cc=stolee@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 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).