mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
bugreport: add uname info
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. Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
617d57195a
commit
1411914a1c
|
@ -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
|
||||
|
|
16
bugreport.c
16
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[] = {
|
||||
|
|
Loading…
Reference in a new issue