From 39f4919dc50ff05bcebd0d3c89b718aa2d46bd67 Mon Sep 17 00:00:00 2001 From: Emily Shaffer Date: Tue, 12 May 2020 16:42:12 -0700 Subject: [PATCH 1/2] help: add shell-path to --build-options It may be useful to know which shell Git was built to try to point to, in the event that shell-based Git commands are failing. $SHELL_PATH is set during the build and used to launch the manpage viewer, as well as by git-compat-util.h, and it's used during tests. 'git version --build-options' is encouraged for use in bug reports, so it makes sense to include this information there. Signed-off-by: Emily Shaffer Signed-off-by: Junio C Hamano --- help.c | 1 + 1 file changed, 1 insertion(+) diff --git a/help.c b/help.c index 1de9c0d589..44cee69c11 100644 --- a/help.c +++ b/help.c @@ -641,6 +641,7 @@ void get_version_info(struct strbuf *buf, int show_build_options) strbuf_addstr(buf, "no commit associated with this build\n"); strbuf_addf(buf, "sizeof-long: %d\n", (int)sizeof(long)); strbuf_addf(buf, "sizeof-size_t: %d\n", (int)sizeof(size_t)); + strbuf_addf(buf, "shell-path: %s\n", SHELL_PATH); /* NEEDSWORK: also save and output GIT-BUILD_OPTIONS? */ } } From 4a4804edf4d5f96407fc46eda802a3b29d991e33 Mon Sep 17 00:00:00 2001 From: Emily Shaffer Date: Tue, 12 May 2020 16:42:13 -0700 Subject: [PATCH 2/2] bugreport: include user interactive shell It's possible a user may complain about the way that Git interacts with their interactive shell, e.g. autocompletion or shell prompt. In that case, it's useful for us to know which shell they're using interactively. Signed-off-by: Emily Shaffer Signed-off-by: Junio C Hamano --- Documentation/git-bugreport.txt | 1 + bugreport.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/Documentation/git-bugreport.txt b/Documentation/git-bugreport.txt index 7fe9aef34e..4afc48c452 100644 --- a/Documentation/git-bugreport.txt +++ b/Documentation/git-bugreport.txt @@ -29,6 +29,7 @@ The following information is captured automatically: - uname sysname, release, version, and machine strings - Compiler-specific info string - A list of enabled hooks + - $SHELL This tool is invoked via the typical Git setup process, which means that in some cases, it might not be able to launch - for example, if a relevant config file diff --git a/bugreport.c b/bugreport.c index aa8a489c35..28f4568b01 100644 --- a/bugreport.c +++ b/bugreport.c @@ -9,6 +9,7 @@ static void get_system_info(struct strbuf *sys_info) { struct utsname uname_info; + char *shell = NULL; /* get git version from native cmd */ strbuf_addstr(sys_info, _("git version:\n")); @@ -29,8 +30,13 @@ static void get_system_info(struct strbuf *sys_info) strbuf_addstr(sys_info, _("compiler info: ")); get_compiler_info(sys_info); + strbuf_addstr(sys_info, _("libc info: ")); get_libc_info(sys_info); + + shell = getenv("SHELL"); + strbuf_addf(sys_info, "$SHELL (typically, interactive shell): %s\n", + shell ? shell : ""); } static void get_populated_hooks(struct strbuf *hook_info, int nongit)