Skip to content

Commit f35e44c

Browse files
committed
Explain why we don't just use --show-scope
1 parent 15e7b67 commit f35e44c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ fn git_cmd(executable: PathBuf) -> Command {
115115
const CREATE_NO_WINDOW: u32 = 0x08000000;
116116
cmd.creation_flags(CREATE_NO_WINDOW);
117117
}
118-
// git 2.8.0 and higher support --show-origin.
118+
// Git 2.8.0 and higher support --show-origin. The -l, -z, and --name-only options were
119+
// supported even before that. In contrast, --show-scope was introduced later, in Git 2.26.0.
120+
// Low versions of git are still sometimes used, and this is sometimes reasonable because
121+
// downstream distributions often backport security patches without adding most new features.
122+
// So for now, we forgo the convenience of --show-scope for greater backward compatibility.
119123
cmd.args(["config", "-lz", "--show-origin", "--name-only"])
120124
.current_dir(env::temp_dir())
121125
.env("GIT_DIR", NULL_DEVICE) // Avoid getting local-scope config.

0 commit comments

Comments
 (0)