Skip to content

Commit

Permalink
Explain why we don't just use --show-scope
Browse files Browse the repository at this point in the history
  • Loading branch information
EliahKagan committed Aug 28, 2024
1 parent 15e7b67 commit f35e44c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gix-path/src/env/git/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f35e44c

Please sign in to comment.