git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] sequencer: assign only free()able strings to gpg_sign

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 22, 2017, 18:40 UTC
Message-ID
<xmqqpo76sj15.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<alpine.DEB.2.21.1.1712221817470.406@MININT-6BKU6QN.europe.corp.microsoft.com>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 7 quoted lines
>> I thought the bug could be triggered when commit.gpgsign was true and 
>> it was not overriden on the commandline, is it worth adding a test for 
>> that?
>
> ... If we want to verify that the
> gpg_sign is correctly allocated before it is free()d, then the test case I
> added *already* covers it,...

It depends on what we are testing, how we anticipate this code will be broken by others in the future and how we want to futureproof the code. We can say "already covers it" if we know the implementation (especially, the code calls free() when it replaces opts->gpg_sign always, so the other side you are choosing not to test will die the same way) and assume it won't be broken (i.e. the attitude is OK for whitebox testing).

I'd think that this particular case it is sufficient to test just one; I doubt that adding another will increse the test load measurably, though.

Previous: Johannes SchindelinNext: Junio C Hamano
Message 4 of 5 in “sequencer: assign only free()able strings to gpg_sign”
  1. sequencer: assign only free()able strings to gpg_signJohannes Schindelin, Dec 22, 2017
  2. phillip.wood@talktalk.netDec 22, 2017
  3. Johannes SchindelinDec 22, 2017
  4. Junio C HamanoDec 22, 2017
  5. Junio C HamanoDec 22, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.