]> git.ipfire.org Git - thirdparty/git.git/commitdiff
bugreport: add uname info
authorEmily Shaffer <emilyshaffer@google.com>
Thu, 16 Apr 2020 21:18:06 +0000 (14:18 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Apr 2020 22:23:42 +0000 (15:23 -0700)
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>
Documentation/git-bugreport.txt
bugreport.c

index f44ae8cbe7544b79b0e24645c47fd8718b794254..17b0d14e8d513485bced6ff65dd34d8ae4b0d64e 100644 (file)
@@ -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
index 4cdb58bbaadb1dc2590ec52289303ed150d45b03..1a3172bcec8a49761ff906f1cc83e4b8ffb0cdd9 100644 (file)
@@ -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[] = {