git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] test-lib: set GIT_CEILING_DIRECTORIES to protect the surrounding repository

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Sep 1, 2021, 04:58 UTC
Message-ID
<20210901045845.GA76263@szeder.dev>
In-Reply-To
<87pmttwuaw.fsf@evledraar.gmail.com>
On Tue, Aug 31, 2021 at 04:40:39PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 14 quoted lines
> 
> On Sun, Aug 29 2021, SZEDER Gábor wrote:
> 
> > Every once in a while a test somehow manages to escape from its trash
> > directory and modifies the surrounding repository, whether because of
> > a bug in git itself, a bug in a test [1], or e.g. when trying to run
> > tests with a shell that is, in general, unable to run our tests [2].
> >
> > Set GIT_CEILING_DIRECTORIES="$TRASH_DIRECTORY/.." as an additional
> > safety measure to protect the surrounding repository at least from
> > modifications by git commands executed in the tests (assuming that
> > handling of ceiling directories during repository discovery is not
> > broken, and, of course, it won't save us from regular shell commands,
> > e.g. 'cd .. && rm -f ...').
> For what it's worth I'm very happy with this, and have been running this
> in my own daily build of git, I've occasionally ran into e.g. needing to
> manually clean up my own git.git's config file because some test escaped
> its trash directory.
Thanks, that's a good point.

After a test escapes from its trash directory I routinely check the content of the work tree and look for stray refs, but it never occured to me that I should look at the config, too. And indeed, at the bottom of .git/config there are two config variables that I don't remember setting (actually don't even know what they do).

Previous: Ævar Arnfjörð Bjarmason
Message 6 of 6 in “test-lib: set GIT_CEILING_DIRECTORIES to protect the surrounding repository”
  1. test-lib: set GIT_CEILING_DIRECTORIES to protect the surrounding repositorySZEDER Gábor, Aug 28, 2021
  2. Carlo ArenasAug 28, 2021
  3. SZEDER GáborAug 29, 2021
  4. test-lib: set GIT_CEILING_DIRECTORIES to protect the surrounding repositorySZEDER Gábor, Aug 29, 2021
  5. Ævar Arnfjörð BjarmasonAug 31, 2021
  6. SZEDER GáborSep 1, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.