git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Derrick Stolee <stolee@gmail.com>,
	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 10:10:10 +0200	[thread overview]
Message-ID: <caafaf945ec43ba606b054bf4c4faa42e35a8db1.camel@sipsolutions.net> (raw)
In-Reply-To: <xmqqo89osi0b.fsf@gitster.g>

On Mon, 2021-08-23 at 01:05 -0700, Junio C Hamano wrote:
> Johannes Berg <johannes@sipsolutions.net> writes:
> 
> > I just needed to go outside the current test git directory, the tests
> > are running in a way that the current working directory is already the
> > git tree I'm operating in.
> > 
> > > Even if you mean to use "cd",
> > > please do so within a sub-shell.
> > 
> > I thought about it, but clearly all the tests are run in a sub-shell, so
> > it didn't seem necessary? But happy to change, I don't really care
> > either way.
> 
> Please learn to care before you write your next test, then ;-)

Hey now, I'm fixing your segfaults ;-)

> These tests are not run in a sub-shell; they are eval'ed, so that
> the assignment they make to variables can persist and affect the
> next test piece.

Makes sense. FWIW, the test *did* restore the CWD so things worked, and
subshells are actually ugly (need to import test-lib-functions.sh again
if you want to use those), but I'll make it work somehow.


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.

johannes


  reply	other threads:[~2021-08-23  8:10 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 [this message]
2021-08-23 13:19         ` Derrick Stolee
2021-08-23 13:40           ` Johannes Berg
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=caafaf945ec43ba606b054bf4c4faa42e35a8db1.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).