tests: keep merge_check independent of the user's git ignore file (TEST-MERGE-CHECK-XDG-IGNORE) #621
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!621
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/merge-check-xdg-ignore"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request successfully merged and closed
Claimed in the coordination issue as: TEST-MERGE-CHECK-XDG-IGNORE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7128205566)
What and why
tests/test_merge_check.pyisolates git from the user's configuration withGIT_CONFIG_GLOBAL=nulandGIT_CONFIG_NOSYSTEM=1, but git still reads its default global ignore file,$XDG_CONFIG_HOME/git/ignore(
~/.config/git/ignorewhen the variable is unset), becausecore.excludesFilefalls back to it without anyconfig. On a machine whose global ignore file lists
docs/,setUpstagesdocs/notes.md, git skips it, the firstcommit fails with "nothing to commit" and all 20 tests fail in
setUp.The test now also sets
XDG_CONFIG_HOMEto its temporary repository folder, which has nogit/ignore, so theresult no longer depends on the user's ignore rules.
Tested
python -I tests/test_merge_check.pywithdocs/in~/.config/git/ignore: 20 failures before,Ran 20 tests ... OKafter.git add -Aofdocs/notes.mdfollowed bygit commitprinted "nothing to commit".GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.Independent check at
283c881against main21625bcon Windows 10 22H2, CPython 3.14.7, and Git for Windows 2.56.0.windows.4.XDG_CONFIG_HOMEdocs/in$XDG_CONFIG_HOME/git/ignoreIn a separate throwaway repo,
git check-ignore -v docs/notes.mdidentified the temporarygit/ignoreeven withGIT_CONFIG_GLOBAL=nulandGIT_CONFIG_NOSYSTEM=1. Both profiles were local to the test processes and the temporary ignore file remained unchanged. The fix removes the dependency on the host profile.Synthetic repositories only. AI-assisted (Codex).
Thanks for the independent check, @Dezmonius - good to have the 0/20 vs 20/20 comparison on a second machine.