git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v12 4/5] bugreport: add uname info

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 6, 2020, 23:20 UTC
Message-ID
<xmqqa73ourp7.fsf@gitster.c.googlers.com>
In-Reply-To
<20200406224526.256074-5-emilyshaffer@google.com>
Emily Shaffer <emilyshaffer@google.com> writes:
> The contents of uname() can give us some insight into what sort of
> system the user is running on, and help us replicate their setup if need
> be. The domainname field is not guaranteed to be available, so don't
> collect it.

Unlike "what's the verison of 'git'?" and "with what versions of which libraries does the 'git' the user is having trouble with links with?" I mentioned earlier in my review of [3/5], what this step deals with, i.e. "what are these properties of the running system?", is perfectly good to report from "git bugreport" itself.

Looking good.
Thanks.
Show 49 quoted lines
>
> Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
> ---
>  Documentation/git-bugreport.txt |  1 +
>  bugreport.c                     | 16 +++++++++++++++-
>  2 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/git-bugreport.txt b/Documentation/git-bugreport.txt
> index f44ae8cbe7..17b0d14e8d 100644
> --- a/Documentation/git-bugreport.txt
> +++ b/Documentation/git-bugreport.txt
> @@ -26,6 +26,7 @@ The following information is requested from the user:
>  The following information is captured automatically:
>  
>   - 'git version --build-options'
> + - uname sysname, release, version, and machine strings
>  
>  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 4cdb58bbaa..1a3172bcec 100644
> --- a/bugreport.c
> +++ b/bugreport.c
> @@ -7,10 +7,24 @@
>  
>  static void get_system_info(struct strbuf *sys_info)
>  {
> +	struct utsname uname_info;
> +
>  	/* get git version from native cmd */
>  	strbuf_addstr(sys_info, _("git version:\n"));
>  	get_version_info(sys_info, 1);
> -	strbuf_complete_line(sys_info);
> +
> +	/* system call for other version info */
> +	strbuf_addstr(sys_info, "uname: ");
> +	if (uname(&uname_info))
> +		strbuf_addf(sys_info, _("uname() failed with error '%s' (%d)\n"),
> +			    strerror(errno),
> +			    errno);
> +	else
> +		strbuf_addf(sys_info, "%s %s %s %s\n",
> +			    uname_info.sysname,
> +			    uname_info.release,
> +			    uname_info.version,
> +			    uname_info.machine);
>  }
>  
>  static const char * const bugreport_usage[] = {
Previous: Emily ShafferNext: Emily Shaffer
Message 26 of 32 in “add git-bugreport tool”
  1. 0/5 add git-bugreport toolEmily Shaffer, Mar 23, 2020
  2. 1/5 help: move list_config_help to builtin/helpEmily Shaffer, Mar 23, 2020
  3. 2/5 bugreport: add tool to generate debugging infoEmily Shaffer, Mar 23, 2020
  4. 3/5 bugreport: gather git version and build infoEmily Shaffer, Mar 23, 2020
  5. 4/5 bugreport: add uname infoEmily Shaffer, Mar 23, 2020
  6. 5/5 bugreport: add compiler infoEmily Shaffer, Mar 23, 2020
  7. Junio C HamanoMar 23, 2020
  8. Emily ShafferMar 25, 2020
  9. 0/5 add git-bugreport toolEmily Shaffer, Mar 25, 2020
  10. 1/5 help: move list_config_help to builtin/helpEmily Shaffer, Mar 25, 2020
  11. 2/5 bugreport: add tool to generate debugging infoEmily Shaffer, Mar 25, 2020
  12. SZEDER GáborApr 1, 2020
  13. 3/5 bugreport: gather git version and build infoEmily Shaffer, Mar 25, 2020
  14. 4/5 bugreport: add uname infoEmily Shaffer, Mar 25, 2020
  15. 5/5 bugreport: add compiler infoEmily Shaffer, Mar 25, 2020
  16. 0/5 bugreport: add tool to generate debugging infoEmily Shaffer, Apr 6, 2020
  17. 1/5 help: move list_config_help to builtin/helpEmily Shaffer, Apr 6, 2020
  18. Junio C HamanoApr 6, 2020
  19. 2/5 bugreport: add tool to generate debugging infoEmily Shaffer, Apr 6, 2020
  20. 3/5 bugreport: gather git version and build infoEmily Shaffer, Apr 6, 2020
  21. Junio C HamanoApr 6, 2020
  22. Emily ShafferApr 7, 2020
  23. Junio C HamanoApr 7, 2020
  24. Emily ShafferApr 7, 2020
  25. 4/5 bugreport: add uname infoEmily Shaffer, Apr 6, 2020
  26. Junio C HamanoApr 6, 2020
  27. 5/5 bugreport: add compiler infoEmily Shaffer, Apr 6, 2020
  28. Junio C HamanoApr 6, 2020
  29. Danh DoanApr 6, 2020
  30. Junio C HamanoApr 7, 2020
  31. Emily ShafferApr 7, 2020
  32. Junio C HamanoApr 7, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.