From f35e44c41cc2ae4216c8c76075cdeedd5c4076c7 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Mon, 26 Aug 2024 12:52:16 -0400 Subject: [PATCH] Explain why we don't just use `--show-scope` --- gix-path/src/env/git/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gix-path/src/env/git/mod.rs b/gix-path/src/env/git/mod.rs index 95c5929b0f..4e7e780967 100644 --- a/gix-path/src/env/git/mod.rs +++ b/gix-path/src/env/git/mod.rs @@ -115,7 +115,11 @@ fn git_cmd(executable: PathBuf) -> Command { const CREATE_NO_WINDOW: u32 = 0x08000000; cmd.creation_flags(CREATE_NO_WINDOW); } - // git 2.8.0 and higher support --show-origin. + // Git 2.8.0 and higher support --show-origin. The -l, -z, and --name-only options were + // supported even before that. In contrast, --show-scope was introduced later, in Git 2.26.0. + // Low versions of git are still sometimes used, and this is sometimes reasonable because + // downstream distributions often backport security patches without adding most new features. + // So for now, we forgo the convenience of --show-scope for greater backward compatibility. cmd.args(["config", "-lz", "--show-origin", "--name-only"]) .current_dir(env::temp_dir()) .env("GIT_DIR", NULL_DEVICE) // Avoid getting local-scope config.