git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
b1a5a279ace90b45246228faaa672587184f87ef blob 2280 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
 
#include "cache.h"
#include "parse-options.h"
#include "stdio.h"
#include "strbuf.h"
#include "time.h"
#include "help.h"

static void get_system_info(struct strbuf *sys_info)
{
	struct strbuf version_info = STRBUF_INIT;

	/* get git version from native cmd */
	strbuf_addstr(sys_info, "git version:\n");
	get_version_info(&version_info, 1);
	strbuf_addbuf(sys_info, &version_info);
	strbuf_complete_line(sys_info);
}

static const char * const bugreport_usage[] = {
	N_("git bugreport [-o|--output <file>]"),
	NULL
};

static int get_bug_template(struct strbuf *template)
{
	const char template_text[] = N_(
"Thank you for filling out a Git bug report!\n"
"Please answer the following questions to help us understand your issue.\n"
"\n"
"What did you do before the bug happened? (Steps to reproduce your issue)\n"
"\n"
"What did you expect to happen? (Expected behavior)\n"
"\n"
"What happened instead? (Actual behavior)\n"
"\n"
"What's different between what you expected and what actually happened?\n"
"\n"
"Anything else you want to add:\n"
"\n"
"Please review the rest of the bug report below.\n"
"You can delete any lines you don't wish to send.\n");

	strbuf_addstr(template, template_text);
	return 0;
}

static void get_header(struct strbuf *buf, const char *title)
{
	strbuf_addf(buf, "\n\n[%s]\n", title);
}

int cmd_main(int argc, const char **argv)
{
	struct strbuf buffer = STRBUF_INIT;
	struct strbuf report_path = STRBUF_INIT;
	FILE *report;
	time_t now = time(NULL);
	char *option_output = NULL;

	const struct option bugreport_options[] = {
		OPT_STRING('o', "output", &option_output, N_("path"),
			   N_("specify a destination for the bugreport file")),
		OPT_END()
	};
	argc = parse_options(argc, argv, "", bugreport_options,
			     bugreport_usage, 0);

	if (option_output) {
		strbuf_addstr(&report_path, option_output);
		strbuf_complete(&report_path, '/');
	}

	strbuf_addstr(&report_path, "git-bugreport-");
	strbuf_addftime(&report_path, "%F", gmtime(&now), 0, 0);
	strbuf_addstr(&report_path, ".txt");


	get_bug_template(&buffer);

	get_header(&buffer, "System Info");
	get_system_info(&buffer);

	report = fopen_for_writing(report_path.buf);
	strbuf_write(&buffer, report);
	fclose(report);

	launch_editor(report_path.buf, NULL, NULL);
	return 0;
}
debug log:

solving b1a5a279ac ...
found b1a5a279ac in https://public-inbox.org/git/20200124033436.81097-4-emilyshaffer@google.com/
found 5495b31674 in https://public-inbox.org/git/20191213004312.169753-2-emilyshaffer@google.com/ ||
	https://public-inbox.org/git/20200124033436.81097-2-emilyshaffer@google.com/

applying [1/3] https://public-inbox.org/git/20191213004312.169753-2-emilyshaffer@google.com/
diff --git a/bugreport.c b/bugreport.c
new file mode 100644
index 0000000000..5495b31674

Checking patch bugreport.c...
Applied patch bugreport.c cleanly.

skipping https://public-inbox.org/git/20200124033436.81097-2-emilyshaffer@google.com/ for 5495b31674
index at:
100644 5495b31674f98dce870b4099c41732ca6c35ff64	bugreport.c

applying [2/3] https://public-inbox.org/git/20200124033436.81097-4-emilyshaffer@google.com/
diff --git a/bugreport.c b/bugreport.c
index 5495b31674..b1a5a279ac 100644

Checking patch bugreport.c...
Applied patch bugreport.c cleanly.

index at:
100644 b1a5a279ace90b45246228faaa672587184f87ef	bugreport.c

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git