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

Re: [PATCH 1/1] quote: handle null and empty strings in sq_quote_buf_pretty()

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 21, 2019, 15:22 UTC
Message-ID
<xmqq7e76tufs.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<xmqqtvabtwai.fsf@gitster-ct.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 7 quoted lines
> "Garima Singh via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>>  create mode 100644 t/helper/test-quote.c
>>  create mode 100755 t/t0091-quote.sh
>
> I do not appreciate these two new files only to test this corner
> case.  ...

To avoid misunderstanding, I am not against having unit tests when they are appropriate. What I am against is to have only unit tests, especially when the effect of a bug (and its fix) can be tested with externally observable behaviour. The latter gives us a better sense of the real-world impact (e.g. if run_command would spawn the given command via shell using the 'sh -c "... stringified command and its arguments ..."' idiom, it may be done with the function we fixed here, which would mean that the user cannot pass '' as an argument to that codepath), while a unit test gives readers "ok, the function behaves that way now" alone, without answering "then what? What difference does this fix make to my use of Git as a whole?".

In any case, thanks for an attempt to fix.
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 19 in “quote: handle null and empty strings in sq_quote_buf_pretty()”
  1. 0/1 quote: handle null and empty strings in sq_quote_buf_pretty()Garima Singh via GitGitGadget, Aug 20, 2019
  2. 1/1 quote: handle null and empty strings in sq_quote_buf_pretty()Garima Singh via GitGitGadget, Aug 20, 2019
  3. Junio C HamanoAug 20, 2019
  4. Junio C HamanoAug 21, 2019
  5. Junio C HamanoAug 20, 2019
  6. 0/1 quote: handle null and empty strings in sq_quote_buf_pretty()Garima Singh via GitGitGadget, Aug 26, 2019
  7. 1/1 quote: handle null and empty strings in sq_quote_buf_pretty()Garima Singh via GitGitGadget, Aug 26, 2019
  8. Garima SinghAug 26, 2019
  9. Junio C HamanoAug 26, 2019
  10. 0/1 quote: handle null and empty strings in sq_quote_buf_pretty()Garima Singh via GitGitGadget, Oct 7, 2019
  11. 1/1 quote: handle numm and empty strings in sq_quote_buf_prettyGarima Singh via GitGitGadget, Oct 7, 2019
  12. Garima SinghOct 7, 2019
  13. Eric SunshineOct 7, 2019
  14. Garima SinghOct 7, 2019
  15. 0/1 quote: handle null and empty strings in sq_quote_buf_pretty()Garima Singh via GitGitGadget, Oct 7, 2019
  16. 1/1 sq_quote_buf_pretty: don't drop empty argumentsGarima Singh via GitGitGadget, Oct 7, 2019
  17. Junio C HamanoOct 8, 2019
  18. 0/1 quote: handle null and empty strings in sq_quote_buf_pretty()Garima Singh via GitGitGadget, Oct 8, 2019
  19. 1/1 sq_quote_buf_pretty: don't drop empty argumentsGarima Singh via GitGitGadget, Oct 8, 2019

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.