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

Re: [PATCH 2/3] tests: suppress global and system gitattributes

From
Jeff King <peff@peff.net>
Date
Mar 15, 2011, 07:16 UTC
Message-ID
<20110315071625.GA11754@sigill.intra.peff.net>
In-Reply-To
<20110315065643.GB29530@elie>
On Tue, Mar 15, 2011 at 01:56:43AM -0500, Jonathan Nieder wrote:
Show 9 quoted lines
> Set GIT_ATTR_NOGLOBAL and GIT_ATTR_NOSYSTEM in test-lib to make
> tests more reliable in two ways:
> 
>  - an invalid GIT_ATTR_NOGLOBAL or GIT_ATTR_NOSYSTEM setting
>    should not cause tests to fail with
> 
> 	fatal: bad config value for 'GIT_ATTR_NOGLOBAL'
> 
>  - /etc/gitattributes should not change the outcome of tests.

We already munge $HOME, as you note in 1/3, I don't know that there is much point in setting GIT_ATTR_NOGLOBAL. The alternative would be to drop your 1/3 and unset GIT_ATTR_NOGLOBAL in test-lib.sh.

I don't care much either way. Having it set prevents others tests from accidentally triggering global attributes (since we have the odd case of $HOME and the repo in the same directory). But IIRC, they'd have to set core.attributesfile anyway, so that is not likely to happen.

And what you're doing at least matches what GIT_CONFIG_* does (I think GIT_CONFIG_NOGLOBAL is also redundant in the tests at this point).

So I'm fine with either strategy. But definitely it should be protected, so thanks for looking into it.

-Peff
Previous: Jonathan NiederNext: Jonathan Nieder
Message 4 of 15 in “tests: unsetting variables that influence the outcome”
  1. 0/3 tests: unsetting variables that influence the outcomeJonathan Nieder, Mar 15, 2011
  2. 1/3 tests: protect against GIT_ATTR_NOGLOBAL from environmentJonathan Nieder, Mar 15, 2011
  3. 2/3 tests: suppress global and system gitattributesJonathan Nieder, Mar 15, 2011
  4. Jeff KingMar 15, 2011
  5. 2/3 Re: tests: suppress global and system gitattributesJonathan Nieder, Mar 15, 2011
  6. 1/3 gitattributes: drop support for GIT_ATTR_NOGLOBALJonathan Nieder, Mar 15, 2011
  7. 2/3 config: drop support for GIT_CONFIG_NOGLOBALJonathan Nieder, Mar 15, 2011
  8. 3/3 tests: suppress system gitattributesJonathan Nieder, Mar 15, 2011
  9. 3/3 tests: scrub environment of GIT_* variablesJonathan Nieder, Mar 15, 2011
  10. Jeff KingMar 15, 2011
  11. 0/2 tests: stop hard-coding the list of GIT_* vars to scrubJonathan Nieder, Mar 15, 2011
  12. 1/2 tests: stop worrying about obsolete environment variablesJonathan Nieder, Mar 15, 2011
  13. 2/2 tests: scrub environment of GIT_* variablesJonathan Nieder, Mar 15, 2011
  14. Junio C HamanoMar 15, 2011
  15. Jeff KingMar 15, 2011

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.