git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Subject: [PATCH 04/11] quote: rename sq_dequote_to_argv_array to mention strvec
Date: Tue, 28 Jul 2020 16:24:02 -0400	[thread overview]
Message-ID: <20200728202402.GD1021513@coredump.intra.peff.net> (raw)
In-Reply-To: <20200728202124.GA1021264@coredump.intra.peff.net>

We want to eventually drop the use of the "argv_array" name in favor of
"strvec." Unlike most other uses of the name, this one is embedded in a
function name, so the definition and all of the callers need to be
updated at the same time.

We don't technically need to update the parameter types here (our
preprocessor compat macros make the two names interchangeable), but
let's do so to keep the site consistent for now.

Signed-off-by: Jeff King <peff@peff.net>
---
 bisect.c     | 2 +-
 builtin/am.c | 2 +-
 quote.c      | 2 +-
 quote.h      | 6 +++---
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/bisect.c b/bisect.c
index 3160e82e96..77e35ddd43 100644
--- a/bisect.c
+++ b/bisect.c
@@ -464,7 +464,7 @@ static void read_bisect_paths(struct argv_array *array)
 
 	while (strbuf_getline_lf(&str, fp) != EOF) {
 		strbuf_trim(&str);
-		if (sq_dequote_to_argv_array(str.buf, array))
+		if (sq_dequote_to_strvec(str.buf, array))
 			die(_("Badly quoted content in file '%s': %s"),
 			    filename, str.buf);
 	}
diff --git a/builtin/am.c b/builtin/am.c
index 69e50de018..0641316e35 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -399,7 +399,7 @@ static void am_load(struct am_state *state)
 
 	read_state_file(&sb, state, "apply-opt", 1);
 	argv_array_clear(&state->git_apply_opts);
-	if (sq_dequote_to_argv_array(sb.buf, &state->git_apply_opts) < 0)
+	if (sq_dequote_to_strvec(sb.buf, &state->git_apply_opts) < 0)
 		die(_("could not parse %s"), am_path(state, "apply-opt"));
 
 	state->rebasing = !!file_exists(am_path(state, "rebasing"));
diff --git a/quote.c b/quote.c
index dac8b4e55e..10b383cc1d 100644
--- a/quote.c
+++ b/quote.c
@@ -198,7 +198,7 @@ int sq_dequote_to_argv(char *arg, const char ***argv, int *nr, int *alloc)
 	return sq_dequote_to_argv_internal(arg, argv, nr, alloc, NULL);
 }
 
-int sq_dequote_to_argv_array(char *arg, struct argv_array *array)
+int sq_dequote_to_strvec(char *arg, struct strvec *array)
 {
 	return sq_dequote_to_argv_internal(arg, NULL, NULL, NULL, array);
 }
diff --git a/quote.h b/quote.h
index 210d580229..fa09309cf6 100644
--- a/quote.h
+++ b/quote.h
@@ -56,12 +56,12 @@ char *sq_dequote(char *);
 int sq_dequote_to_argv(char *arg, const char ***argv, int *nr, int *alloc);
 
 /*
- * Same as above, but store the unquoted strings in an argv_array. We will
- * still modify arg in place, but unlike sq_dequote_to_argv, the argv_array
+ * Same as above, but store the unquoted strings in a strvec. We will
+ * still modify arg in place, but unlike sq_dequote_to_argv, the strvec
  * will duplicate and take ownership of the strings.
  */
 struct strvec;
-int sq_dequote_to_argv_array(char *arg, struct strvec *);
+int sq_dequote_to_strvec(char *arg, struct strvec *);
 
 int unquote_c_style(struct strbuf *, const char *quoted, const char **endp);
 size_t quote_c_style(const char *name, struct strbuf *, FILE *, int no_dq);
-- 
2.28.0.rc2.475.g53c7e1c7f4


  parent reply	other threads:[~2020-07-28 20:24 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28 20:21 [PATCH 0/11] renaming argv_array Jeff King
2020-07-28 20:21 ` [PATCH 01/11] argv-array: use size_t for count and alloc Jeff King
2020-07-28 20:23 ` [PATCH 02/11] argv-array: rename to strvec Jeff King
2020-07-28 20:23 ` [PATCH 03/11] strvec: rename files from argv-array " Jeff King
2020-07-28 20:24 ` Jeff King [this message]
2020-07-28 20:24 ` [PATCH 05/11] strvec: convert builtin/ callers away from argv_array name Jeff King
2020-07-28 20:24 ` [PATCH 06/11] strvec: convert more " Jeff King
2020-07-28 20:25 ` [PATCH 07/11] strvec: convert remaining " Jeff King
2020-07-28 20:26 ` [PATCH 08/11] strvec: fix indentation in renamed calls Jeff King
2020-07-28 22:43   ` Jacob Keller
2020-07-28 23:31     ` Junio C Hamano
2020-07-28 20:26 ` [PATCH 09/11] strvec: update documention to avoid argv_array Jeff King
2020-07-28 20:27 ` [PATCH 10/11] strvec: drop argv_array compatibility layer Jeff King
2020-07-28 22:23   ` Junio C Hamano
2020-07-29  0:04     ` Jeff King
2020-07-29  0:37       ` Jeff King
2020-07-29  0:40         ` Jeff King
2020-07-29  0:47           ` Junio C Hamano
2020-07-29 16:54             ` Derrick Stolee
2020-07-29  0:44         ` Junio C Hamano
2020-07-29 16:22           ` Jeff King
2020-07-28 20:28 ` [PATCH 11/11] strvec: rename struct fields Jeff King
2020-07-28 21:16   ` Junio C Hamano
2020-07-28 21:18     ` Junio C Hamano
2020-07-29  6:55       ` Christian Couder
2020-07-29 16:34         ` Jeff King
2020-07-29 18:03           ` Junio C Hamano
2020-07-28 21:20     ` Jeff King
2020-07-28 22:45 ` [PATCH 0/11] renaming argv_array Jacob Keller
2020-07-29  0:06   ` Jeff King
2020-07-29  6:15 ` Christian Couder
2020-07-29  6:19   ` Christian Couder
2020-07-29 13:32   ` Eric Sunshine
2020-07-29 16:33   ` Jeff King
2020-08-11 16:08 ` René Scharfe
2020-08-11 18:28   ` Taylor Blau
2020-08-11 19:00   ` Junio C Hamano
2020-08-11 20:39     ` Jacob Keller
2020-08-11 21:03       ` Junio C Hamano
2020-08-12 12:42     ` Johannes Schindelin
2020-08-12 15:06   ` Jeff King
2020-08-12 15:10     ` Jeff King
2020-08-12 16:23       ` René Scharfe
2020-08-12 17:08         ` Jeff King
2020-08-12 18:18           ` René Scharfe
2020-08-12 19:57             ` Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20200728202402.GD1021513@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).