Thread (222 messages) 222 messages, 11 authors, 2020-04-06

Re: [PATCH v8 03/15] bugreport: add tool to generate debugging info

From: Johannes Schindelin <hidden>
Date: 2020-02-26 16:12:58
Subsystem: the rest · Maintainer: Linus Torvalds

Hi Emily,

On Wed, 19 Feb 2020, Emily Shaffer wrote:
quoted hunk ↗ jump to hunk
diff --git a/bugreport.c b/bugreport.c
new file mode 100644
index 0000000000..8d4a76fdac
--- /dev/null
+++ b/bugreport.c
@@ -0,0 +1,94 @@
+#include "builtin.h"
+#include "parse-options.h"
+#include "stdio.h"
+#include "strbuf.h"
+#include "time.h"
+
+static const char * const bugreport_usage[] = {
+	N_("git bugreport [-o|--output-directory <file>] [-s|--suffix <format>]"),
+	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 share.\n");
+
+	strbuf_addstr(template, template_text);
+	return 0;
+}
+
+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;
+	char *option_suffix = "%F-%H%M";
This is not a portable `strftime()` format. Let's squash this in?

-- snipsnap --
Subject: [PATCH] fixup??? bugreport: add tool to generate debugging info

The `%F` format is an optional extension to the ISO C standard, see
https://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html

And sure enough, in Git for Windows, this leads to a test failure
because that format is not supported in the version of the MSVC runtime
that we're stuck with.

Let's just use the long-hand instead.

Signed-off-by: Johannes Schindelin <redacted>
---
 bugreport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bugreport.c b/bugreport.c
index a3528a2e2b8..3f78db182e6 100644
--- a/bugreport.c
+++ b/bugreport.c
@@ -338,7 +338,7 @@ int cmd_main(int argc, const char **argv)
 	FILE *report;
 	time_t now = time(NULL);
 	char *option_output = NULL;
-	char *option_suffix = "%F-%H%M";
+	char *option_suffix = "%Y-%m-%d-%H%M";
 	struct stat statbuf;
 	int nongit_ok = 0;

--
2.25.1.windows.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help