Re: [PATCH v4 08/15] bugreport: include user interactive shell
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 13, 2019, 21:38 UTC
- Message-ID
- <xmqq8snfj47x.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20191213004312.169753-9-emilyshaffer@google.com>
Emily Shaffer <emilyshaffer@google.com> writes:
Show 8 quoted lines
> 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. > > $SHELL isn't set by every shell, but getenv() returns NULL in the > event the variable isn't found, so we'll see a line like "$SHELL: > (null)" to tell us that variable wasn't set.
Do not depend on vsnprintf() from glibc that accepts NULL and shows "(null)". You can segfault on systems without glibc that way.
Show 19 quoted lines
> Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
> ---
> bugreport.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/bugreport.c b/bugreport.c
> index f5598513d9..759cc0b0f8 100644
> --- a/bugreport.c
> +++ b/bugreport.c
> @@ -45,6 +45,9 @@ static void get_system_info(struct strbuf *sys_info)
> strbuf_addstr(sys_info, gnu_get_libc_version());
> strbuf_complete_line(sys_info);
>
> + strbuf_addf(sys_info, "$SHELL (typically, interactive shell): %s\n",
> + getenv("SHELL"));
> +
> strbuf_addstr(sys_info, "git-http-fetch -V:\n");
> get_http_version_info(sys_info);
> strbuf_complete_line(sys_info);