tests: keep merge_check independent of the user's git ignore file (TEST-MERGE-CHECK-XDG-IGNORE) #621
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!621
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/621/head"
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?
@DesertGamer on GitHub · 2026-11-24 10:03 UTC · original
DesertGamer:fix/merge-check-xdg-ignore→main· +1 −1 · 1 files · 1 commits · merged 2026-11-24 13:09 UTCClaimed in the coordination issue as: TEST-MERGE-CHECK-XDG-IGNORE (#14)
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.@Dezmonius on GitHub · 2026-11-24 10:19 UTC · original
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).
@DesertGamer on GitHub · 2026-11-24 10:22 UTC · original
Thanks for the independent check, @Dezmonius - good to have the 0/20 vs 20/20 comparison on a second machine.
@madvillain91 on GitHub · 2026-11-24 10:35 UTC · original · reviewed
Tested locally on Windows 11 — all 20 tests in \ ests/test_merge_check.py\ pass (21.530s). Isolating \XDG_CONFIG_HOME\ to the temp dir is a clean 1-line fix. LGTM.
@madvillain91 on GitHub · 2026-11-24 10:38 UTC · original · reviewed
Independent Windows 11 26H2 (26300.9711) check at
283c8818bagainst main21625bca8, using CPython 3.12.3 and Git for Windows 2.56.0.windows.2. All 20 test_merge_check.py tests passed (21.530s). IsolatingXDG_CONFIG_HOMEto the temp dir is a clean 1-line fix. LGTM.