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

Re: [PATCH 6/8] ls-files tests: filter `.gitconfig` from `--others` output

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 26, 2026, 00:44 UTC
Message-ID
<xmqqldea7dpg.fsf@gitster.g>
In-Reply-To
<ef57244778d8f72754801d80a9e7e8ad034cec28.1777042877.git.gitgitgadget@gmail.com>

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:

Show 7 quoted lines
> +# Remove .gitconfig entries from a file in place.  test-lib.sh may
> +# create $HOME/.gitconfig (e.g. to set safe.bareRepository) which
> +# can appear in ls-files or status output.
> +test_filter_gitconfig () {
> +	sed "/\\.gitconfig/d" "$1" >"$1.filtered" &&
> +	mv "$1.filtered" "$1"
> +}
Thanks.

When I suggested the "just use the usual configuration mechanism to keep the semantics of existing bare repository tests, and that would be very unintrusive", I didn't think of this fallout from an extra file getting reported by ls-files, and this helper function does make sense. If we were starting from scratch, we probably would have created $HOME that is separate from the test repository in the test framework. The simplest layout would be to emulate a developer who has repositories under their $HOME, i.e., $TRASH_DIRECTORY stays to be the $HOME, but the initial test repository would be created as a directory inside $TRASH_DIRECTORY instead of using the trash itself, or something like that. It is all water under the bridge now, unless somebody wants an opportunity to work on a non-trivial clean-up.

By the way, when merged to 'seen', with the 'ps/test-set-e-clean' topic already in 'next', many tests (especially the ones with early test_done, like p4 tests in my environment where p4 does not exist) seem to fail with WITH_BREAKING_CHANGES turned on. I don't have enough time to be sitting in front of the keyboard to isolate the cause, but because this series is one of the topics with biggest impact to the t/ directory that was replaced after the last successful run, I thought I should mention it.

Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin via GitGitGadget
Message 6 of 19 in “safe.bareRepository: default to "explicit" with WITH_BREAKING_CHANGES”
  1. 0/8 safe.bareRepository: default to "explicit" with WITH_BREAKING_CHANGESJohannes Schindelin via GitGitGadget, Apr 24, 2026
  2. 1/8 test-lib: allow bare repository access when breaking changes are enabledJohannes Schindelin via GitGitGadget, Apr 24, 2026
  3. 2/8 t7900: do not let `$HOME/.gitconfig` interfere with XDG testsJohannes Schindelin via GitGitGadget, Apr 24, 2026
  4. 3/8 t1300: remove global config settings injected by test-lib.shJohannes Schindelin via GitGitGadget, Apr 24, 2026
  5. 6/8 ls-files tests: filter `.gitconfig` from `--others` outputJohannes Schindelin via GitGitGadget, Apr 24, 2026
  6. Junio C HamanoApr 26, 2026
  7. 7/8 status tests: filter `.gitconfig` from status outputJohannes Schindelin via GitGitGadget, Apr 24, 2026
  8. 8/8 safe.bareRepository: default to "explicit" with WITH_BREAKING_CHANGESJohannes Schindelin via GitGitGadget, Apr 24, 2026
  9. 4/8 t1305: use `--git-dir=.` for bare repo in include cycle testJohannes Schindelin via GitGitGadget, Apr 24, 2026
  10. 5/8 t5601: restore `.gitconfig` after includeIf testJohannes Schindelin via GitGitGadget, Apr 24, 2026
  11. 0/8 safe.bareRepository: default to "explicit" with WITH_BREAKING_CHANGESJohannes Schindelin via GitGitGadget, Apr 26, 2026
  12. 1/8 test-lib: allow bare repository access when breaking changes are enabledJohannes Schindelin via GitGitGadget, Apr 26, 2026
  13. 2/8 t7900: do not let `$HOME/.gitconfig` interfere with XDG testsJohannes Schindelin via GitGitGadget, Apr 26, 2026
  14. 3/8 t1300: remove global config settings injected by test-lib.shJohannes Schindelin via GitGitGadget, Apr 26, 2026
  15. 4/8 t1305: use `--git-dir=.` for bare repo in include cycle testJohannes Schindelin via GitGitGadget, Apr 26, 2026
  16. 5/8 t5601: restore `.gitconfig` after includeIf testJohannes Schindelin via GitGitGadget, Apr 26, 2026
  17. 6/8 ls-files tests: filter `.gitconfig` from `--others` outputJohannes Schindelin via GitGitGadget, Apr 26, 2026
  18. 7/8 status tests: filter `.gitconfig` from status outputJohannes Schindelin via GitGitGadget, Apr 26, 2026
  19. 8/8 safe.bareRepository: default to "explicit" with WITH_BREAKING_CHANGESJohannes Schindelin via GitGitGadget, Apr 26, 2026

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.