Skip to content

Commit d14e00c

Browse files
nasamuffingitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent efbace6 commit d14e00c

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Documentation/git-bugreport.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The following information is requested from the user:
2626
The following information is captured automatically:
2727

2828
- 'git version --build-options'
29+
- uname sysname, release, version, and machine strings
2930

3031
This tool is invoked via the typical Git setup process, which means that in some
3132
cases, it might not be able to launch - for example, if a relevant config file

bugreport.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,24 @@
77

88
static void get_system_info(struct strbuf *sys_info)
99
{
10+
struct utsname uname_info;
11+
1012
/* get git version from native cmd */
1113
strbuf_addstr(sys_info, _("git version:\n"));
1214
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);
1428
}
1529

1630
static const char * const bugreport_usage[] = {

0 commit comments

Comments
 (0)