All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Garima Singh via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: garimasigit@gmail.com, jeffhost@microsoft.com, stolee@gmail.com,
	Junio C Hamano <gitster@pobox.com>
Subject: [PATCH v5 0/1] quote: handle null and empty strings in sq_quote_buf_pretty()
Date: Tue, 08 Oct 2019 09:40:39 -0700 (PDT)	[thread overview]
Message-ID: <pull.314.v5.git.gitgitgadget@gmail.com> (raw)
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

  parent reply	other threads:[~2019-10-08 16:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 19:35 [PATCH 0/1] quote: handle null and empty strings in sq_quote_buf_pretty() Garima Singh via GitGitGadget
2019-08-20 19:35 ` [PATCH 1/1] " Garima Singh via GitGitGadget
2019-08-20 20:29   ` Junio C Hamano
2019-08-21 15:22     ` Junio C Hamano
2019-08-20 20:32   ` Junio C Hamano
2019-08-26 14:44 ` [PATCH v2 0/1] " Garima Singh via GitGitGadget
2019-08-26 14:44   ` [PATCH v2 1/1] " Garima Singh via GitGitGadget
2019-08-26 15:24     ` Garima Singh
2019-08-26 16:20       ` Junio C Hamano
2019-10-07 16:17   ` [PATCH v3 0/1] " Garima Singh via GitGitGadget
2019-10-07 16:17     ` [PATCH v3 1/1] quote: handle numm and empty strings in sq_quote_buf_pretty Garima Singh via GitGitGadget
2019-10-07 17:08       ` Garima Singh
2019-10-07 17:27       ` Eric Sunshine
2019-10-07 17:47         ` Garima Singh
2019-10-07 19:38     ` [PATCH v4 0/1] quote: handle null and empty strings in sq_quote_buf_pretty() Garima Singh via GitGitGadget
2019-10-07 19:38       ` [PATCH v4 1/1] sq_quote_buf_pretty: don't drop empty arguments Garima Singh via GitGitGadget
2019-10-08  3:16         ` Junio C Hamano
2019-10-08 16:40       ` Garima Singh via GitGitGadget [this message]
2019-10-08 16:40         ` [PATCH v5 " Garima Singh via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.314.v5.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=garimasigit@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jeffhost@microsoft.com \
    --cc=stolee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.