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

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

From
GGGarima Singh via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 8, 2019, 16:40 UTC
Message-ID
<pull.314.v5.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.314.v4.git.gitgitgadget@gmail.com>
Hey,

Empty arguments passed on the command line can be a represented by a '', however sq_quote_buf_pretty was incorrectly dropping these arguments altogether. Fix this problem by ensuring that such arguments are emitted as '' instead.

Looking forward to your review. Cheers! Garima Singh

Reported by: Junio Hamano gitster@pobox.com [gitster@pobox.com] in https://public-inbox.org/git/pull.298.git.gitgitgadget@gmail.com/T/#m9e33936067ec2066f675aa63133a2486efd415fd

Garima Singh (1):
  sq_quote_buf_pretty: don't drop empty arguments
 quote.c          | 6 ++++++
 t/t0014-alias.sh | 7 +++++++
 2 files changed, 13 insertions(+)
base-commit: 5fa0f5238b0cd46cfe7f6fa76c3f526ea98148d9
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-314%2Fgarimasi514%2FcoreGit-fixQuote-v5
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-314/garimasi514/coreGit-fixQuote-v5
Pull-Request: https://github.com/gitgitgadget/git/pull/314
Range-diff vs v4:
 1:  a6a0217ce6 ! 1:  412626ccf9 sq_quote_buf_pretty: don't drop empty arguments
     @@ -17,9 +17,6 @@
       	static const char ok_punct[] = "+,-./:=@_^";
       	const char *p;
       
     -+	if (!src) 
     -+		BUG("Cannot append a NULL token to the buffer");
     -+	
      +	/* Avoid losing a zero-length string by adding '' */ 
      +	if (!*src) {
      +		strbuf_addstr(dst, "''");
-- 
gitgitgadget
Previous: Junio C HamanoNext: Garima Singh via GitGitGadget
Message 18 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.