Skip to content

Support GIT_CONFIG_GLOBAL for finding core.excludesFile#3394

Open
mitre88 wants to merge 2 commits intoBurntSushi:masterfrom
mitre88:fix-git-config-global
Open

Support GIT_CONFIG_GLOBAL for finding core.excludesFile#3394
mitre88 wants to merge 2 commits intoBurntSushi:masterfrom
mitre88:fix-git-config-global

Conversation

@mitre88
Copy link
Copy Markdown

@mitre88 mitre88 commented May 5, 2026

Support GIT_CONFIG_GLOBAL environment variable for finding core.excludesFile

Git 2.32 introduced GIT_CONFIG_GLOBAL for overriding git config file locations.
The ignore crate did not check this env var, causing global gitignore to be silently ignored.

Added check for GIT_CONFIG_GLOBAL at start of gitconfig_excludes_path() to match git behavior.

Fixes issue #3275

Open Source Contributor added 2 commits May 5, 2026 16:57
When decompressing files with names starting with a dash (e.g., '-10.txt.gz'),
the filename was being passed as an argument without the '--' separator.
This caused gzip to interpret the filename as a string of options.

For example, 'gzip -d -c -10.txt.gz' would fail because gzip treats '-10.txt.gz'
as invalid options rather than a filename.

The fix adds '--' before the filename argument to ensure the compression tool
knows that all following arguments are filenames, not options.

Fixes issue BurntSushi#3222
Git 2.32 introduced GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM environment
variables for overriding git config file locations.

The ignore crate's gitconfig_excludes_path() only checked hardcoded paths
but did not check GIT_CONFIG_GLOBAL, causing users with non-standard
gitconfig locations to have their global gitignore silently ignored.

Added check for GIT_CONFIG_GLOBAL at the start of gitconfig_excludes_path()
to respect the environment variable, matching git's behavior.

Fixes issue BurntSushi#3275
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant