Repository navigation
fix(gix-path): skip the Git query without /etc/gitconfig - #3188
Merged
Sebastian Thiel (Byron) merged 2 commits intoNov 10, 2026
Merged
Sebastian Thiel (Byron) merged 2 commits into
Sebastian Thiel (Byron) merged 2 commits into
Conversation
Follow-up to GitoxideLabs#3182. Linux `/usr/bin/git` and `/bin/git` are inferred to read `/etc/gitconfig`, but when that file doesn't exist we still ran `git config --show-origin`, only to learn there is no installation config. That's the default on Debian, Ubuntu and Arch, so most Linux users kept paying for the spawn in every process opening a repository, for example every `starship` prompt. Treat a missing system config like MSYS2 already does: it's valid even when absent, and means no installation config. Prefix-derived layouts such as Homebrew still query Git, since a missing file there can mean the prefix was misidentified.
Contributor
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
5 of 8 tasks
Sebastian Thiel (Byron)
force-pushed
the
fix/gix-path-absent-system-config
branch
from
November 10, 2026 04:39
71db15b to
2571c34
Compare
Use a dedicated read-only fixture for the `gix-path` system-config regression test, following the Windows tests. Prepare missing and existing configurations in the fixture script so the test itself performs no writes. Assisted-by: GPT 6.1 Sol Co-authored-by: GPT 6.1 Sol <codex@openai.com>
Sebastian Thiel (Byron)
force-pushed
the
fix/gix-path-absent-system-config
branch
from
November 10, 2026 05:03
2571c34 to
bcd416b
Compare
Sebastian Thiel (Byron)
merged commit Nov 10, 2026
3247e95
into
GitoxideLabs:main
28 of 37 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #3182: Linux distro Git still spawns
git configwhen/etc/gitconfigdoesn't exist, which is the default on Debian, Ubuntu and Arch.Motivation
starship opens a repo in a fresh process for every prompt (starship/starship#7851). After #3182 Homebrew and Linux setups with an
/etc/gitconfigskip the query, but a stock Debian box still runs it on every prompt, just to learn there's no installation config.Change
For the Linux
/usr/bin/git//bin/gitlayout, a missing/etc/gitconfignow means "no installation config", same as the MSYS2 path already does ("the system path is valid even when absent"). This is what the query returns there anyway, since distro builds useprefix=/usr→sysconfdir=/etc.Homebrew and other prefix-derived layouts still query Git when their config is missing, since that can mean the prefix was guessed wrong (e.g. a relocated Cellar), so
missing_homebrew_config_is_queriedstays as is.Numbers
Debian bookworm container,
starship promptin a repo copied into the container, no/etc/gitconfig:gitprocesses per prompt (strace)maingit config+ an unrelated starship spawn)Small on Linux since spawns are cheap there, tbh, but it adds up when every process does it.
Tests
cargo test -p gix-pathon macOS and in Debian bookwormcargo clippy -p gix-path --all-targets -- -D warningsabsent_system_config_is_no_installation_configcovers the missing system config, a missing prefix config (still queried), and an existing one