@matheusbsbs / matheus-bagliano / commits / 1411914a1c
Fork 0

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>

Emily Shaffer committed Apr 16, 2020 at 14:18 UTC 1411914a1cbd6f5680e33db9817a1aecb01f8817
2 files changed +16 -1
Documentation/git-bugreport.txt
+1
@@ -26,6 +26,7 @@ The following information is requested from the user:
26 The following information is captured automatically:
27
28 - 'git version --build-options'
29 + - uname sysname, release, version, and machine strings
30
31 This tool is invoked via the typical Git setup process, which means that in some
32 cases, it might not be able to launch - for example, if a relevant config file
bugreport.c
+15 -1
@@ -7,10 +7,24 @@
7
8 static void get_system_info(struct strbuf *sys_info)
9 {
10 + struct utsname uname_info;
11 +
12 /* get git version from native cmd */
13 strbuf_addstr(sys_info, _("git version:\n"));
14 get_version_info(sys_info, 1);
13 - strbuf_complete_line(sys_info);
15 +
16 + /* system call for other version info */
17 + strbuf_addstr(sys_info, "uname: ");
18 + if (uname(&uname_info))
19 + strbuf_addf(sys_info, _("uname() failed with error '%s' (%d)\n"),
20 + strerror(errno),
21 + errno);
22 + else
23 + strbuf_addf(sys_info, "%s %s %s %s\n",
24 + uname_info.sysname,
25 + uname_info.release,
26 + uname_info.version,
27 + uname_info.machine);
28 }
29
30 static const char * const bugreport_usage[] = {