diff options
author | brian m. carlson <bk2204@github.com> | 2023-06-27 18:18:57 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-06-27 20:31:05 +0200 |
commit | 1e6572122702cbf0e3b6d3226f73e6b8b45e6e37 (patch) | |
tree | 6a6bab9c2cd02d79d8d04de41c7dcfa11e40784d /Documentation/git-var.txt | |
parent | t: add a function to check executable bit (diff) | |
download | git-1e6572122702cbf0e3b6d3226f73e6b8b45e6e37.tar.xz git-1e6572122702cbf0e3b6d3226f73e6b8b45e6e37.zip |
var: add support for listing the shell
On most Unix systems, finding a suitable shell is easy: one simply uses
"sh" with an appropriate PATH value. However, in many Windows
environments, the shell is shipped alongside Git, and it may or may not
be in PATH, even if Git is.
In such an environment, it can be very helpful to query Git for the
shell it's using, since other tools may want to use the same shell as
well. To help them out, let's add a variable, GIT_SHELL_PATH, that
points to the location of the shell.
On Unix, we know our shell must be executable to be functional, so
assume that the distributor has correctly configured their environment,
and use that as a basic test. On Git for Windows, we know that our
shell will be one of a few fixed values, all of which end in "sh" (such
as "bash"). This seems like it might be a nice test on Unix as well,
since it is customary for all shells to end in "sh", but there probably
exist such systems that don't have such a configuration, so be careful
here not to break them.
Signed-off-by: brian m. carlson <bk2204@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-var.txt')
-rw-r--r-- | Documentation/git-var.txt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Documentation/git-var.txt b/Documentation/git-var.txt index f40202b8e3..f0f647e14a 100644 --- a/Documentation/git-var.txt +++ b/Documentation/git-var.txt @@ -71,6 +71,9 @@ endif::git-default-pager[] GIT_DEFAULT_BRANCH:: The name of the first branch created in newly initialized repositories. +GIT_SHELL_PATH:: + The path of the binary providing the POSIX shell for commands which use the shell. + SEE ALSO -------- linkgit:git-commit-tree[1] |