Thread (1 message) 1 message, 1 author, 2022-05-06

Re: [PATCH v2 2/2] bisect: output bisect setup status in bisect log

From: Junio C Hamano <hidden>
Date: 2022-05-06 16:47:52

Chris Down [off-list ref] writes:
This allows seeing the current intermediate status without adding a new
good or bad commit:

    $ git bisect log | tail -1
    # status: waiting for bad commit, 1 good commit known
Clever.  As we are keeping the "log" of what we have done so far,
it is a good place to record this new piece of info, too.  I find
it much better than my earlier suggestion to add "bisect status"
subcommand.
+__attribute__((format (printf, 1, 2)))
+static void bisect_log_printf(const char *fmt, ...)
+{
+	va_list ap;
+	char buf[1024];
+
+	va_start(ap, fmt);
+	if (vsnprintf(buf, sizeof(buf), fmt, ap) < 0)
+		*buf = '\0';
+	va_end(ap);
We probably should use strbuf_addf() or something so that we do not
even have to wonder if 1024 is large enough for everybody.  That
would be in line with what is done in other parts of the codebase,
e.g. bisect_next_all() uses xstrfmt() that is a thin wrapper around
strbuf to format the estimated steps.

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