Re: [PATCH v4 03/15] bugreport: gather git version and build info
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 17, 2019, 20:34 UTC
- Message-ID
- <xmqqfthig07m.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <nycvar.QRO.7.76.6.1912171941451.46@tvgsbejvaqbjf.bet>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 10 quoted lines
>> + if (build_options) {
>> + strbuf_addf(buf, "cpu: %s\n", GIT_HOST_CPU);
>> + if (git_built_from_commit_string[0])
>> + strbuf_addf(buf, "built from commit: %s\n",
>> + git_built_from_commit_string);
>> + else
>> + strbuf_addf(buf, "no commit associated with this build\n");
>
> The "StaticAnalysis" job of the Azure Pipeline is not happy with this,
> claiming that this should be an `strbuf_addstr()` call instead.You mean the "else" clause, right? That feels similar to say
printf("Hello world\n");should better be written as
fputs("Hello world\n", stdout);which I do not agree with at all. IOW, I view the distinction more like "once it is written one way or the other way, it is not worth spending bits and braincycles to see if it is worth changing it" kind of minor stylistic preference.