Skip to content

Commit 1526b01

Browse files
committed
Expand and clarify "unkown" scope comment in git_cmd
- Mention `/Applications` as well as `/Library`, since macOS users with a full Xcode installation installation seem often to have Apple Git under `/Applications` rather than under `/Library`, but this higher-than-system "unknown" scope applies equally to both. - Expand the explanation enough to make clear what the conceptual relationship is between `GIT_CONFIG_SYSTEM` and `--system` and why the disparity between the scopes they select could be misleading in a relevant way.
1 parent 56dbcd5 commit 1526b01

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gix-path/src/env/git/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ fn git_cmd(executable: PathBuf) -> Command {
136136
//
137137
// Separately from that, we can't use --system here, because scopes treated higher than the
138138
// system scope are possible. This commonly happens on macOS with Apple Git, where the config
139-
// file under `/Library` is shown as an "unknown" scope but takes precedence over the system
140-
// scope. Although `GIT_CONFIG_NOSYSTEM` will suppress this as well, passing --system omits it.
139+
// file under `/Library` or `/Applications` is shown as an "unknown" scope but takes precedence
140+
// over the system scope. Although `GIT_CONFIG_NOSYSTEM` suppresses this scope along with the
141+
// system scope, passing --system selects only the system scope and omit this "unknown" scope.
141142
cmd.args(["config", "-lz", "--show-origin", "--name-only"])
142143
.current_dir(cwd)
143144
.env_remove("GIT_CONFIG")

0 commit comments

Comments
 (0)