{"thread":{"id":"53940","subject":"[PATCH 0/11] renaming argv_array","startedAt":"2020-07-28T20:21:28Z","lastAt":"2020-08-12T19:57:05Z","messageCount":46,"participants":["Jeff King","Junio C Hamano","Jacob Keller","Christian Couder","Eric Sunshine","Derrick Stolee","René Scharfe","Taylor Blau","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":11},"messages":[{"id":"402229","messageId":"20200728202124.GA1021264@coredump.intra.peff.net","threadId":"53940","inReplyTo":null,"subject":"[PATCH 0/11] renaming argv_array","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-28T20:21:24Z","receivedAt":"2020-07-28T20:21:28Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The argv_array data type has turned out to be useful in our code base,\nbut the name isn't very good. From patch 2 of this series:\n\n  The name \"argv-array\" isn't very good, because it describes what the\n  data type can be used for (program argument arrays), not what it\n  actually is (a dynamically-growing string array that maintains a\n  NULL-terminator invariant). This leads to people being hesitant to use\n  it for other cases where it would actually be a good fit. The existing\n  name is also clunky to use. It's overly long, and the name often leads\n  to saying things like \"argv.argv\" (i.e., the field names overlap with\n  variable names, since they're describing the use, not the type). Let's\n  give it a more neutral name.\n\nThis has bugged me for a while, so I decided to finally fix it. It\nwasn't _too_ painful, though I'm sure there will be a little fallout\nwith topics in flight.\n\nI tried to split out the mechanical bits into their own patches to make\nreviewing easier. Patches 5-7 really could be a single patch, but\nthey're too big for the mailing list. I'm OK to leave them separate, or\nthey could be squashed together.\n\nWe could stop at patch 9 for now and allow topics in flight to catch up\nbefore removing the compat layers. But the struct field renaming has to\nhappen as a single step, so it will be a pain whenever we do it. If\nwe're going to go this route, I'd just as soon do it all now and deal\nwith other topics as they get merged.\n\n  [01/11]: argv-array: use size_t for count and alloc\n  [02/11]: argv-array: rename to strvec\n  [03/11]: strvec: rename files from argv-array to strvec\n  [04/11]: quote: rename sq_dequote_to_argv_array to mention strvec\n  [05/11]: strvec: convert builtin/ callers away from argv_array name\n  [06/11]: strvec: convert more callers away from argv_array name\n  [07/11]: strvec: convert remaining callers away from argv_array name\n  [08/11]: strvec: fix indentation in renamed calls\n  [09/11]: strvec: update documention to avoid argv_array\n  [10/11]: strvec: drop argv_array compatibility layer\n  [11/11]: strvec: rename struct fields\n\n Documentation/technical/api-parse-options.txt |   4 +-\n Makefile                                      |   2 +-\n add-interactive.c                             |  28 +--\n add-patch.c                                   |  48 ++--\n argv-array.c                                  | 109 ---------\n bisect.c                                      |  20 +-\n builtin/add.c                                 |  18 +-\n builtin/am.c                                  |  80 +++----\n builtin/annotate.c                            |  10 +-\n builtin/bisect--helper.c                      |  20 +-\n builtin/bundle.c                              |  14 +-\n builtin/clone.c                               |  38 +--\n builtin/commit.c                              |   8 +-\n builtin/describe.c                            |  44 ++--\n builtin/difftool.c                            |  30 +--\n builtin/fetch.c                               |  64 ++---\n builtin/gc.c                                  |  78 +++----\n builtin/grep.c                                |   2 +-\n builtin/log.c                                 |  12 +-\n builtin/ls-remote.c                           |   6 +-\n builtin/pack-objects.c                        |  26 +--\n builtin/pull.c                                | 160 ++++++-------\n builtin/range-diff.c                          |   4 +-\n builtin/rebase.c                              |  90 ++++----\n builtin/receive-pack.c                        | 126 +++++-----\n builtin/remote-ext.c                          |   4 +-\n builtin/remote.c                              |  26 +--\n builtin/repack.c                              |  72 +++---\n builtin/replace.c                             |  18 +-\n builtin/show-branch.c                         |  16 +-\n builtin/stash.c                               | 162 ++++++-------\n builtin/submodule--helper.c                   | 144 ++++++------\n builtin/update-ref.c                          |   2 +-\n builtin/upload-archive.c                      |  12 +-\n builtin/worktree.c                            |  68 +++---\n bundle.c                                      |  24 +-\n bundle.h                                      |   4 +-\n column.c                                      |  12 +-\n commit.c                                      |  10 +-\n compat/mingw.c                                |   4 +-\n compat/terminal.c                             |  18 +-\n connect.c                                     |  69 +++---\n connected.c                                   |  24 +-\n daemon.c                                      |  60 ++---\n diff.c                                        |  32 +--\n environment.c                                 |  12 +-\n exec-cmd.c                                    |  18 +-\n exec-cmd.h                                    |   4 +-\n fast-import.c                                 |   4 +-\n fetch-pack.c                                  |  46 ++--\n fsmonitor.c                                   |   6 +-\n git.c                                         |  32 +--\n gpg-interface.c                               |  22 +-\n graph.c                                       |  16 +-\n http-backend.c                                |   8 +-\n http-push.c                                   |  18 +-\n http.c                                        |   8 +-\n imap-send.c                                   |   2 +-\n line-log.c                                    |   8 +-\n list-objects-filter-options.c                 |   2 +-\n ls-refs.c                                     |  18 +-\n ls-refs.h                                     |   4 +-\n merge.c                                       |  18 +-\n midx.c                                        |  12 +-\n pager.c                                       |   8 +-\n parse-options-cb.c                            |   8 +-\n pathspec.c                                    |  10 +-\n quote.c                                       |   8 +-\n quote.h                                       |   8 +-\n range-diff.c                                  |  40 ++--\n range-diff.h                                  |   4 +-\n ref-filter.c                                  |  12 +-\n refs.c                                        |   8 +-\n refs.h                                        |   4 +-\n refspec.c                                     |  10 +-\n refspec.h                                     |   4 +-\n remote-curl.c                                 | 102 ++++----\n remote-testsvn.c                              |  10 +-\n remote.c                                      |  20 +-\n remote.h                                      |   4 +-\n revision.c                                    |  20 +-\n run-command.c                                 |  72 +++---\n run-command.h                                 |  12 +-\n send-pack.c                                   |  18 +-\n sequencer.c                                   | 126 +++++-----\n serve.c                                       |  20 +-\n serve.h                                       |   4 +-\n sha1-file.c                                   |  14 +-\n strvec.c                                      | 109 +++++++++\n argv-array.h => strvec.h                      |  58 ++---\n sub-process.c                                 |   2 +-\n submodule.c                                   | 218 +++++++++---------\n submodule.h                                   |   6 +-\n t/helper/test-run-command.c                   |  52 ++---\n t/helper/test-trace2.c                        |   2 +-\n tmp-objdir.c                                  |  20 +-\n transport-helper.c                            |  36 +--\n transport-internal.h                          |   4 +-\n transport.c                                   |  12 +-\n transport.h                                   |   2 +-\n unpack-trees.c                                |  12 +-\n unpack-trees.h                                |   4 +-\n upload-pack.c                                 |  53 +++--\n upload-pack.h                                 |   4 +-\n wt-status.c                                   |  19 +-\n 105 files changed, 1619 insertions(+), 1620 deletions(-)\n delete mode 100644 argv-array.c\n create mode 100644 strvec.c\n rename argv-array.h => strvec.h (50%)\n\n"},{"id":"402237","messageId":"20200728202152.GA1021513@coredump.intra.peff.net","threadId":"53940","inReplyTo":"20200728202124.GA1021264@coredump.intra.peff.net","subject":"[PATCH 01/11] argv-array: use size_t for count and alloc","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-28T20:21:52Z","receivedAt":"2020-07-28T20:21:54Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On most 64-bit platforms, \"int\" is significantly smaller than a size_t,\nwhich could lead to integer overflow and under-allocation of the array.\nIt's probably impossible to trigger in practice, as it would imply on\nthe order of 2^32 individual allocations. Even if was possible to grow\nan array in that way (and we typically only use it for sets of strings,\nlike command line options), each allocation needs a pointer, malloc\noverhead, etc. You'd quite likely run out of RAM before succeeding in\nsuch an overflow.\n\nBut all that hand-waving aside, it's easy enough to use the correct\ntype, so let's do so.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nThis one is obviously of value even without the renaming.\n\n argv-array.h | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/argv-array.h b/argv-array.h\nindex a7d3b10707..4fc57b6902 100644\n--- a/argv-array.h\n+++ b/argv-array.h\n@@ -29,8 +29,8 @@ extern const char *empty_argv[];\n  */\n struct argv_array {\n \tconst char **argv;\n-\tint argc;\n-\tint alloc;\n+\tsize_t argc;\n+\tsize_t alloc;\n };\n \n #define ARGV_ARRAY_INIT { empty_argv, 0, 0 }\n-- \n2.28.0.rc2.475.g53c7e1c7f4\n\n"},{"id":"402230","messageId":"20200728202325.GB1021513@coredump.intra.peff.net","threadId":"53940","inReplyTo":"20200728202124.GA1021264@coredump.intra.peff.net","subject":"[PATCH 02/11] argv-array: rename to strvec","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-28T20:23:25Z","receivedAt":"2020-07-28T20:23:29Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The name \"argv-array\" isn't very good, because it describes what the\ndata type can be used for (program argument arrays), not what it\nactually is (a dynamically-growing string array that maintains a\nNULL-terminator invariant). This leads to people being hesitant to use\nit for other cases where it would actually be a good fit. The existing\nname is also clunky to use. It's overly long, and the name often leads\nto saying things like \"argv.argv\" (i.e., the field names overlap with\nvariable names, since they're describing the use, not the type). Let's\ngive it a more neutral name.\n\nI settled on \"strvec\" because \"vector\" is the name for a dynamic array\ntype in many programming languages. \"strarray\" would work, too, but it's\nlonger and a bit more awkward to say (and don't we all say these things\nin our mind as we type them?).\n\nA more extreme direction would be a generic data structure which stores\na NULL-terminated of _any_ type. That would be easy to do with void\npointers, but we'd lose some type safety for the existing cases. Plus it\nraises questions about memory allocation and ownership. So I limited\nmyself here to changing names only, and not semantics. If we do find a\nuse for that more generic data type, we could perhaps implement it at a\nlower level and then provide type-safe wrappers around it for strings.\nBut that can come later.\n\nThis patch does the minimum to convert the struct and function names in\nthe header and implementation, leaving a few things for follow-on\npatches:\n\n  - files retain their original names for now\n\n  - struct field names are retained for now\n\n  - there's a preprocessor compat layer that lets most users remain the\n    same for now. The exception is headers which made a manual forward\n    declaration of the struct. I've converted them (and their dependent\n    function declarations) here.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n argv-array.c         | 44 +++++++++++++++++++-------------------\n argv-array.h         | 51 +++++++++++++++++++++++++++-----------------\n exec-cmd.h           |  4 ++--\n ls-refs.h            |  4 ++--\n quote.h              |  4 ++--\n refs.h               |  4 ++--\n refspec.h            |  4 ++--\n remote.h             |  4 ++--\n serve.h              |  4 ++--\n submodule.h          |  6 +++---\n transport-internal.h |  2 +-\n upload-pack.h        |  4 ++--\n 12 files changed, 74 insertions(+), 61 deletions(-)\n\ndiff --git a/argv-array.c b/argv-array.c\nindex 61ef8c0dfd..b7461c47e4 100644\n--- a/argv-array.c\n+++ b/argv-array.c\n@@ -2,32 +2,32 @@\n #include \"argv-array.h\"\n #include \"strbuf.h\"\n \n-const char *empty_argv[] = { NULL };\n+const char *empty_strvec[] = { NULL };\n \n-void argv_array_init(struct argv_array *array)\n+void strvec_init(struct strvec *array)\n {\n-\tarray->argv = empty_argv;\n+\tarray->argv = empty_strvec;\n \tarray->argc = 0;\n \tarray->alloc = 0;\n }\n \n-static void argv_array_push_nodup(struct argv_array *array, const char *value)\n+static void strvec_push_nodup(struct strvec *array, const char *value)\n {\n-\tif (array->argv == empty_argv)\n+\tif (array->argv == empty_strvec)\n \t\tarray->argv = NULL;\n \n \tALLOC_GROW(array->argv, array->argc + 2, array->alloc);\n \tarray->argv[array->argc++] = value;\n \tarray->argv[array->argc] = NULL;\n }\n \n-const char *argv_array_push(struct argv_array *array, const char *value)\n+const char *strvec_push(struct strvec *array, const char *value)\n {\n-\targv_array_push_nodup(array, xstrdup(value));\n+\tstrvec_push_nodup(array, xstrdup(value));\n \treturn array->argv[array->argc - 1];\n }\n \n-const char *argv_array_pushf(struct argv_array *array, const char *fmt, ...)\n+const char *strvec_pushf(struct strvec *array, const char *fmt, ...)\n {\n \tva_list ap;\n \tstruct strbuf v = STRBUF_INIT;\n@@ -36,28 +36,28 @@ const char *argv_array_pushf(struct argv_array *array, const char *fmt, ...)\n \tstrbuf_vaddf(&v, fmt, ap);\n \tva_end(ap);\n \n-\targv_array_push_nodup(array, strbuf_detach(&v, NULL));\n+\tstrvec_push_nodup(array, strbuf_detach(&v, NULL));\n \treturn array->argv[array->argc - 1];\n }\n \n-void argv_array_pushl(struct argv_array *array, ...)\n+void strvec_pushl(struct strvec *array, ...)\n {\n \tva_list ap;\n \tconst char *arg;\n \n \tva_start(ap, array);\n \twhile ((arg = va_arg(ap, const char *)))\n-\t\targv_array_push(array, arg);\n+\t\tstrvec_push(array, arg);\n \tva_end(ap);\n }\n \n-void argv_array_pushv(struct argv_array *array, const char **argv)\n+void strvec_pushv(struct strvec *array, const char **argv)\n {\n \tfor (; *argv; argv++)\n-\t\targv_array_push(array, *argv);\n+\t\tstrvec_push(array, *argv);\n }\n \n-void argv_array_pop(struct argv_array *array)\n+void strvec_pop(struct strvec *array)\n {\n \tif (!array->argc)\n \t\treturn;\n@@ -66,7 +66,7 @@ void argv_array_pop(struct argv_array *array)\n \tarray->argc--;\n }\n \n-void argv_array_split(struct argv_array *array, const char *to_split)\n+void strvec_split(struct strvec *array, const char *to_split)\n {\n \twhile (isspace(*to_split))\n \t\tto_split++;\n@@ -78,32 +78,32 @@ void argv_array_split(struct argv_array *array, const char *to_split)\n \n \t\twhile (*p && !isspace(*p))\n \t\t\tp++;\n-\t\targv_array_push_nodup(array, xstrndup(to_split, p - to_split));\n+\t\tstrvec_push_nodup(array, xstrndup(to_split, p - to_split));\n \n \t\twhile (isspace(*p))\n \t\t\tp++;\n \t\tto_split = p;\n \t}\n }\n \n-void argv_array_clear(struct argv_array *array)\n+void strvec_clear(struct strvec *array)\n {\n-\tif (array->argv != empty_argv) {\n+\tif (array->argv != empty_strvec) {\n \t\tint i;\n \t\tfor (i = 0; i < array->argc; i++)\n \t\t\tfree((char *)array->argv[i]);\n \t\tfree(array->argv);\n \t}\n-\targv_array_init(array);\n+\tstrvec_init(array);\n }\n \n-const char **argv_array_detach(struct argv_array *array)\n+const char **strvec_detach(struct strvec *array)\n {\n-\tif (array->argv == empty_argv)\n+\tif (array->argv == empty_strvec)\n \t\treturn xcalloc(1, sizeof(const char *));\n \telse {\n \t\tconst char **ret = array->argv;\n-\t\targv_array_init(array);\n+\t\tstrvec_init(array);\n \t\treturn ret;\n \t}\n }\ndiff --git a/argv-array.h b/argv-array.h\nindex 4fc57b6902..ca66a338ad 100644\n--- a/argv-array.h\n+++ b/argv-array.h\n@@ -14,76 +14,89 @@\n  * it contains an item structure with a `util` field that is not compatible\n  * with the traditional argv interface.\n  *\n- * Each `argv_array` manages its own memory. Any strings pushed into the\n- * array are duplicated, and all memory is freed by argv_array_clear().\n+ * Each `strvec` manages its own memory. Any strings pushed into the\n+ * array are duplicated, and all memory is freed by strvec_clear().\n  */\n \n-extern const char *empty_argv[];\n+extern const char *empty_strvec[];\n \n /**\n  * A single array. This should be initialized by assignment from\n- * `ARGV_ARRAY_INIT`, or by calling `argv_array_init`. The `argv`\n+ * `STRVEC_INIT`, or by calling `strvec_init`. The `argv`\n  * member contains the actual array; the `argc` member contains the\n  * number of elements in the array, not including the terminating\n  * NULL.\n  */\n-struct argv_array {\n+struct strvec {\n \tconst char **argv;\n \tsize_t argc;\n \tsize_t alloc;\n };\n \n-#define ARGV_ARRAY_INIT { empty_argv, 0, 0 }\n+#define STRVEC_INIT { empty_strvec, 0, 0 }\n \n /**\n  * Initialize an array. This is no different than assigning from\n- * `ARGV_ARRAY_INIT`.\n+ * `STRVEC_INIT`.\n  */\n-void argv_array_init(struct argv_array *);\n+void strvec_init(struct strvec *);\n \n /* Push a copy of a string onto the end of the array. */\n-const char *argv_array_push(struct argv_array *, const char *);\n+const char *strvec_push(struct strvec *, const char *);\n \n /**\n  * Format a string and push it onto the end of the array. This is a\n- * convenience wrapper combining `strbuf_addf` and `argv_array_push`.\n+ * convenience wrapper combining `strbuf_addf` and `strvec_push`.\n  */\n __attribute__((format (printf,2,3)))\n-const char *argv_array_pushf(struct argv_array *, const char *fmt, ...);\n+const char *strvec_pushf(struct strvec *, const char *fmt, ...);\n \n /**\n  * Push a list of strings onto the end of the array. The arguments\n  * should be a list of `const char *` strings, terminated by a NULL\n  * argument.\n  */\n LAST_ARG_MUST_BE_NULL\n-void argv_array_pushl(struct argv_array *, ...);\n+void strvec_pushl(struct strvec *, ...);\n \n /* Push a null-terminated array of strings onto the end of the array. */\n-void argv_array_pushv(struct argv_array *, const char **);\n+void strvec_pushv(struct strvec *, const char **);\n \n /**\n  * Remove the final element from the array. If there are no\n  * elements in the array, do nothing.\n  */\n-void argv_array_pop(struct argv_array *);\n+void strvec_pop(struct strvec *);\n \n /* Splits by whitespace; does not handle quoted arguments! */\n-void argv_array_split(struct argv_array *, const char *);\n+void strvec_split(struct strvec *, const char *);\n \n /**\n  * Free all memory associated with the array and return it to the\n  * initial, empty state.\n  */\n-void argv_array_clear(struct argv_array *);\n+void strvec_clear(struct strvec *);\n \n /**\n- * Disconnect the `argv` member from the `argv_array` struct and\n+ * Disconnect the `argv` member from the `strvec` struct and\n  * return it. The caller is responsible for freeing the memory used\n  * by the array, and by the strings it references. After detaching,\n- * the `argv_array` is in a reinitialized state and can be pushed\n+ * the `strvec` is in a reinitialized state and can be pushed\n  * into again.\n  */\n-const char **argv_array_detach(struct argv_array *);\n+const char **strvec_detach(struct strvec *);\n+\n+/* compatibility for historic argv_array interface */\n+#define argv_array strvec\n+#define ARGV_ARRAY_INIT STRVEC_INIT\n+#define argv_array_init strvec_init\n+#define argv_array_push strvec_push\n+#define argv_array_pushf strvec_pushf\n+#define argv_array_pushl strvec_pushl\n+#define argv_array_pushv strvec_pushv\n+#define argv_array_pop strvec_pop\n+#define argv_array_split strvec_split\n+#define argv_array_clear strvec_clear\n+#define argv_array_detach strvec_detach\n \n #endif /* ARGV_ARRAY_H */\ndiff --git a/exec-cmd.h b/exec-cmd.h\nindex 8cd1df28d3..330b41d54d 100644\n--- a/exec-cmd.h\n+++ b/exec-cmd.h\n@@ -1,13 +1,13 @@\n #ifndef GIT_EXEC_CMD_H\n #define GIT_EXEC_CMD_H\n \n-struct argv_array;\n+struct strvec;\n \n void git_set_exec_path(const char *exec_path);\n void git_resolve_executable_dir(const char *path);\n const char *git_exec_path(void);\n void setup_path(void);\n-const char **prepare_git_cmd(struct argv_array *out, const char **argv);\n+const char **prepare_git_cmd(struct strvec *out, const char **argv);\n int execv_git_cmd(const char **argv); /* NULL terminated */\n LAST_ARG_MUST_BE_NULL\n int execl_git_cmd(const char *cmd, ...);\ndiff --git a/ls-refs.h b/ls-refs.h\nindex 7e5646f5f6..7b33a7c6b8 100644\n--- a/ls-refs.h\n+++ b/ls-refs.h\n@@ -2,9 +2,9 @@\n #define LS_REFS_H\n \n struct repository;\n-struct argv_array;\n+struct strvec;\n struct packet_reader;\n-int ls_refs(struct repository *r, struct argv_array *keys,\n+int ls_refs(struct repository *r, struct strvec *keys,\n \t    struct packet_reader *request);\n \n #endif /* LS_REFS_H */\ndiff --git a/quote.h b/quote.h\nindex ca8ee3144a..210d580229 100644\n--- a/quote.h\n+++ b/quote.h\n@@ -60,8 +60,8 @@ int sq_dequote_to_argv(char *arg, const char ***argv, int *nr, int *alloc);\n  * still modify arg in place, but unlike sq_dequote_to_argv, the argv_array\n  * will duplicate and take ownership of the strings.\n  */\n-struct argv_array;\n-int sq_dequote_to_argv_array(char *arg, struct argv_array *);\n+struct strvec;\n+int sq_dequote_to_argv_array(char *arg, struct strvec *);\n \n int unquote_c_style(struct strbuf *, const char *quoted, const char **endp);\n size_t quote_c_style(const char *name, struct strbuf *, FILE *, int no_dq);\ndiff --git a/refs.h b/refs.h\nindex f212f8945e..29e28124cd 100644\n--- a/refs.h\n+++ b/refs.h\n@@ -145,8 +145,8 @@ int refname_match(const char *abbrev_name, const char *full_name);\n  * Given a 'prefix' expand it by the rules in 'ref_rev_parse_rules' and add\n  * the results to 'prefixes'\n  */\n-struct argv_array;\n-void expand_ref_prefix(struct argv_array *prefixes, const char *prefix);\n+struct strvec;\n+void expand_ref_prefix(struct strvec *prefixes, const char *prefix);\n \n int expand_ref(struct repository *r, const char *str, int len, struct object_id *oid, char **ref);\n int repo_dwim_ref(struct repository *r, const char *str, int len, struct object_id *oid, char **ref);\ndiff --git a/refspec.h b/refspec.h\nindex 3f2bd4aaa5..23e1555b88 100644\n--- a/refspec.h\n+++ b/refspec.h\n@@ -60,12 +60,12 @@ void refspec_clear(struct refspec *rs);\n \n int valid_fetch_refspec(const char *refspec);\n \n-struct argv_array;\n+struct strvec;\n /*\n  * Determine what <prefix> values to pass to the peer in ref-prefix lines\n  * (see Documentation/technical/protocol-v2.txt).\n  */\n void refspec_ref_prefixes(const struct refspec *rs,\n-\t\t\t  struct argv_array *ref_prefixes);\n+\t\t\t  struct strvec *ref_prefixes);\n \n #endif /* REFSPEC_H */\ndiff --git a/remote.h b/remote.h\nindex 5cc26c1b3b..5e3ea5a26d 100644\n--- a/remote.h\n+++ b/remote.h\n@@ -168,7 +168,7 @@ void free_refs(struct ref *ref);\n \n struct oid_array;\n struct packet_reader;\n-struct argv_array;\n+struct strvec;\n struct string_list;\n struct ref **get_remote_heads(struct packet_reader *reader,\n \t\t\t      struct ref **list, unsigned int flags,\n@@ -178,7 +178,7 @@ struct ref **get_remote_heads(struct packet_reader *reader,\n /* Used for protocol v2 in order to retrieve refs from a remote */\n struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,\n \t\t\t     struct ref **list, int for_push,\n-\t\t\t     const struct argv_array *ref_prefixes,\n+\t\t\t     const struct strvec *ref_prefixes,\n \t\t\t     const struct string_list *server_options,\n \t\t\t     int stateless_rpc);\n \ndiff --git a/serve.h b/serve.h\nindex 42ddca7f8b..fc2683e24d 100644\n--- a/serve.h\n+++ b/serve.h\n@@ -1,8 +1,8 @@\n #ifndef SERVE_H\n #define SERVE_H\n \n-struct argv_array;\n-int has_capability(const struct argv_array *keys, const char *capability,\n+struct strvec;\n+int has_capability(const struct strvec *keys, const char *capability,\n \t\t   const char **value);\n \n struct serve_options {\ndiff --git a/submodule.h b/submodule.h\nindex 4dad649f94..9ce85c03fe 100644\n--- a/submodule.h\n+++ b/submodule.h\n@@ -1,7 +1,7 @@\n #ifndef SUBMODULE_H\n #define SUBMODULE_H\n \n-struct argv_array;\n+struct strvec;\n struct cache_entry;\n struct diff_options;\n struct index_state;\n@@ -84,7 +84,7 @@ int should_update_submodules(void);\n const struct submodule *submodule_from_ce(const struct cache_entry *ce);\n void check_for_new_submodule_commits(struct object_id *oid);\n int fetch_populated_submodules(struct repository *r,\n-\t\t\t       const struct argv_array *options,\n+\t\t\t       const struct strvec *options,\n \t\t\t       const char *prefix,\n \t\t\t       int command_line_option,\n \t\t\t       int default_option,\n@@ -143,7 +143,7 @@ void submodule_unset_core_worktree(const struct submodule *sub);\n  * a submodule by clearing any repo-specific environment variables, but\n  * retaining any config in the environment.\n  */\n-void prepare_submodule_repo_env(struct argv_array *out);\n+void prepare_submodule_repo_env(struct strvec *out);\n \n #define ABSORB_GITDIR_RECURSE_SUBMODULES (1<<0)\n void absorb_git_dir_into_superproject(const char *path,\ndiff --git a/transport-internal.h b/transport-internal.h\nindex 1cde6258a7..284784a2a6 100644\n--- a/transport-internal.h\n+++ b/transport-internal.h\n@@ -3,7 +3,7 @@\n \n struct ref;\n struct transport;\n-struct argv_array;\n+struct strvec;\n \n struct transport_vtable {\n \t/**\ndiff --git a/upload-pack.h b/upload-pack.h\nindex 4bafe16a22..27ddcdc6cb 100644\n--- a/upload-pack.h\n+++ b/upload-pack.h\n@@ -11,9 +11,9 @@ struct upload_pack_options {\n void upload_pack(struct upload_pack_options *options);\n \n struct repository;\n-struct argv_array;\n+struct strvec;\n struct packet_reader;\n-int upload_pack_v2(struct repository *r, struct argv_array *keys,\n+int upload_pack_v2(struct repository *r, struct strvec *keys,\n \t\t   struct packet_reader *request);\n \n struct strbuf;\n-- \n2.28.0.rc2.475.g53c7e1c7f4\n\n"},{"id":"402231","messageId":"20200728202339.GC1021513@coredump.intra.peff.net","threadId":"53940","inReplyTo":"20200728202124.GA1021264@coredump.intra.peff.net","subject":"[PATCH 03/11] strvec: rename files from argv-array to strvec","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-28T20:23:39Z","receivedAt":"2020-07-28T20:23:45Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"This requires updating #include lines across the code-base, but that's\nall fairly mechanical, and was done with:\n\n  git ls-files '*.c' '*.h' |\n  xargs perl -i -pe 's/argv-array.h/strvec.h/'\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Makefile                      | 2 +-\n add-patch.c                   | 2 +-\n bisect.c                      | 2 +-\n builtin/add.c                 | 2 +-\n builtin/annotate.c            | 2 +-\n builtin/bisect--helper.c      | 2 +-\n builtin/bundle.c              | 2 +-\n builtin/describe.c            | 2 +-\n builtin/difftool.c            | 2 +-\n builtin/fetch.c               | 2 +-\n builtin/gc.c                  | 2 +-\n builtin/pack-objects.c        | 2 +-\n builtin/rebase.c              | 2 +-\n builtin/receive-pack.c        | 2 +-\n builtin/remote.c              | 2 +-\n builtin/repack.c              | 2 +-\n builtin/show-branch.c         | 2 +-\n builtin/stash.c               | 2 +-\n builtin/update-ref.c          | 2 +-\n builtin/upload-archive.c      | 2 +-\n builtin/worktree.c            | 2 +-\n bundle.c                      | 2 +-\n bundle.h                      | 2 +-\n diff.c                        | 2 +-\n environment.c                 | 2 +-\n exec-cmd.c                    | 2 +-\n graph.c                       | 2 +-\n http-backend.c                | 2 +-\n http-push.c                   | 2 +-\n line-log.c                    | 2 +-\n list-objects-filter-options.c | 2 +-\n ls-refs.c                     | 2 +-\n parse-options-cb.c            | 2 +-\n pathspec.c                    | 2 +-\n quote.c                       | 2 +-\n range-diff.c                  | 2 +-\n range-diff.h                  | 2 +-\n ref-filter.c                  | 2 +-\n refs.c                        | 2 +-\n refspec.c                     | 2 +-\n remote-curl.c                 | 2 +-\n remote-testsvn.c              | 2 +-\n remote.c                      | 2 +-\n revision.c                    | 2 +-\n run-command.c                 | 2 +-\n run-command.h                 | 2 +-\n sequencer.c                   | 2 +-\n serve.c                       | 2 +-\n argv-array.c => strvec.c      | 2 +-\n argv-array.h => strvec.h      | 6 +++---\n submodule.c                   | 2 +-\n t/helper/test-run-command.c   | 2 +-\n t/helper/test-trace2.c        | 2 +-\n tmp-objdir.c                  | 2 +-\n transport-helper.c            | 2 +-\n unpack-trees.c                | 2 +-\n unpack-trees.h                | 2 +-\n upload-pack.c                 | 2 +-\n wt-status.c                   | 2 +-\n 59 files changed, 61 insertions(+), 61 deletions(-)\n rename argv-array.c => strvec.c (98%)\n rename argv-array.h => strvec.h (97%)\n\ndiff --git a/Makefile b/Makefile\nindex 372139f1f2..65f8cfb236 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -828,7 +828,6 @@ LIB_OBJS += apply.o\n LIB_OBJS += archive-tar.o\n LIB_OBJS += archive-zip.o\n LIB_OBJS += archive.o\n-LIB_OBJS += argv-array.o\n LIB_OBJS += attr.o\n LIB_OBJS += base85.o\n LIB_OBJS += bisect.o\n@@ -986,6 +985,7 @@ LIB_OBJS += sigchain.o\n LIB_OBJS += split-index.o\n LIB_OBJS += stable-qsort.o\n LIB_OBJS += strbuf.o\n+LIB_OBJS += strvec.o\n LIB_OBJS += streaming.o\n LIB_OBJS += string-list.o\n LIB_OBJS += sub-process.o\ndiff --git a/add-patch.c b/add-patch.c\nindex f899389e2c..09d00c5574 100644\n--- a/add-patch.c\n+++ b/add-patch.c\n@@ -2,7 +2,7 @@\n #include \"add-interactive.h\"\n #include \"strbuf.h\"\n #include \"run-command.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"pathspec.h\"\n #include \"color.h\"\n #include \"diff.h\"\ndiff --git a/bisect.c b/bisect.c\nindex d5e830410f..3160e82e96 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -11,7 +11,7 @@\n #include \"log-tree.h\"\n #include \"bisect.h\"\n #include \"oid-array.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"commit-slab.h\"\n #include \"commit-reach.h\"\n #include \"object-store.h\"\ndiff --git a/builtin/add.c b/builtin/add.c\nindex 298e0114f9..6cd9a4cd77 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -18,7 +18,7 @@\n #include \"diffcore.h\"\n #include \"revision.h\"\n #include \"bulk-checkin.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"submodule.h\"\n #include \"add-interactive.h\"\n \ndiff --git a/builtin/annotate.c b/builtin/annotate.c\nindex da413ae0d1..4353448712 100644\n--- a/builtin/annotate.c\n+++ b/builtin/annotate.c\n@@ -5,7 +5,7 @@\n  */\n #include \"git-compat-util.h\"\n #include \"builtin.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n \n int cmd_annotate(int argc, const char **argv, const char *prefix)\n {\ndiff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c\nindex ec4996282e..e929315b38 100644\n--- a/builtin/bisect--helper.c\n+++ b/builtin/bisect--helper.c\n@@ -4,7 +4,7 @@\n #include \"bisect.h\"\n #include \"refs.h\"\n #include \"dir.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"run-command.h\"\n #include \"prompt.h\"\n #include \"quote.h\"\ndiff --git a/builtin/bundle.c b/builtin/bundle.c\nindex f049d27a14..51fc6d9739 100644\n--- a/builtin/bundle.c\n+++ b/builtin/bundle.c\n@@ -1,5 +1,5 @@\n #include \"builtin.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"parse-options.h\"\n #include \"cache.h\"\n #include \"bundle.h\"\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex 21d2cb9e57..32ad6822f7 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -12,7 +12,7 @@\n #include \"revision.h\"\n #include \"diff.h\"\n #include \"hashmap.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"run-command.h\"\n #include \"object-store.h\"\n #include \"list-objects.h\"\ndiff --git a/builtin/difftool.c b/builtin/difftool.c\nindex c280e682b2..c0608a78d9 100644\n--- a/builtin/difftool.c\n+++ b/builtin/difftool.c\n@@ -18,7 +18,7 @@\n #include \"run-command.h\"\n #include \"exec-cmd.h\"\n #include \"parse-options.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"strbuf.h\"\n #include \"lockfile.h\"\n #include \"object-store.h\"\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex 82ac4be8a5..b183b55ee9 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -19,7 +19,7 @@\n #include \"submodule-config.h\"\n #include \"submodule.h\"\n #include \"connected.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"utf8.h\"\n #include \"packfile.h\"\n #include \"list-objects-filter-options.h\"\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 8e0b9cf41b..27951ee061 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -18,7 +18,7 @@\n #include \"parse-options.h\"\n #include \"run-command.h\"\n #include \"sigchain.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"commit.h\"\n #include \"commit-graph.h\"\n #include \"packfile.h\"\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 7016b28485..5f18f0ee9d 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -27,7 +27,7 @@\n #include \"delta-islands.h\"\n #include \"reachable.h\"\n #include \"oid-array.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"list.h\"\n #include \"packfile.h\"\n #include \"object-store.h\"\ndiff --git a/builtin/rebase.c b/builtin/rebase.c\nindex 37ba76ac3d..38145a66ed 100644\n--- a/builtin/rebase.c\n+++ b/builtin/rebase.c\n@@ -8,7 +8,7 @@\n #include \"builtin.h\"\n #include \"run-command.h\"\n #include \"exec-cmd.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"dir.h\"\n #include \"packfile.h\"\n #include \"refs.h\"\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex d43663bb0a..1285631481 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -15,7 +15,7 @@\n #include \"string-list.h\"\n #include \"oid-array.h\"\n #include \"connected.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"version.h\"\n #include \"tag.h\"\n #include \"gpg-interface.h\"\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex e8377994e5..a9f35ba855 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -10,7 +10,7 @@\n #include \"refs.h\"\n #include \"refspec.h\"\n #include \"object-store.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"commit-reach.h\"\n \n static const char * const builtin_remote_usage[] = {\ndiff --git a/builtin/repack.c b/builtin/repack.c\nindex df287739d9..8bccb38a28 100644\n--- a/builtin/repack.c\n+++ b/builtin/repack.c\n@@ -7,7 +7,7 @@\n #include \"sigchain.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"midx.h\"\n #include \"packfile.h\"\n #include \"prune-packed.h\"\ndiff --git a/builtin/show-branch.c b/builtin/show-branch.c\nindex 7e52ee9126..f0a70538c3 100644\n--- a/builtin/show-branch.c\n+++ b/builtin/show-branch.c\n@@ -4,7 +4,7 @@\n #include \"refs.h\"\n #include \"builtin.h\"\n #include \"color.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"parse-options.h\"\n #include \"dir.h\"\n #include \"commit-slab.h\"\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex 0c52a3b849..1acf216254 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -7,7 +7,7 @@\n #include \"cache-tree.h\"\n #include \"unpack-trees.h\"\n #include \"merge-recursive.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"run-command.h\"\n #include \"dir.h\"\n #include \"rerere.h\"\ndiff --git a/builtin/update-ref.c b/builtin/update-ref.c\nindex b74dd9a69d..8a2df4459c 100644\n--- a/builtin/update-ref.c\n+++ b/builtin/update-ref.c\n@@ -4,7 +4,7 @@\n #include \"builtin.h\"\n #include \"parse-options.h\"\n #include \"quote.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n \n static const char * const git_update_ref_usage[] = {\n \tN_(\"git update-ref [<options>] -d <refname> [<old-val>]\"),\ndiff --git a/builtin/upload-archive.c b/builtin/upload-archive.c\nindex 018879737a..7fc8e0e82d 100644\n--- a/builtin/upload-archive.c\n+++ b/builtin/upload-archive.c\n@@ -7,7 +7,7 @@\n #include \"pkt-line.h\"\n #include \"sideband.h\"\n #include \"run-command.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n \n static const char upload_archive_usage[] =\n \t\"git upload-archive <repo>\";\ndiff --git a/builtin/worktree.c b/builtin/worktree.c\nindex f0cbdef718..35945096f6 100644\n--- a/builtin/worktree.c\n+++ b/builtin/worktree.c\n@@ -4,7 +4,7 @@\n #include \"builtin.h\"\n #include \"dir.h\"\n #include \"parse-options.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"branch.h\"\n #include \"refs.h\"\n #include \"run-command.h\"\ndiff --git a/bundle.c b/bundle.c\nindex 2a0d744d3f..d46a387e66 100644\n--- a/bundle.c\n+++ b/bundle.c\n@@ -10,7 +10,7 @@\n #include \"list-objects.h\"\n #include \"run-command.h\"\n #include \"refs.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n \n static const char bundle_signature[] = \"# v2 git bundle\\n\";\n \ndiff --git a/bundle.h b/bundle.h\nindex 2dc9442024..2cf1270092 100644\n--- a/bundle.h\n+++ b/bundle.h\n@@ -1,7 +1,7 @@\n #ifndef BUNDLE_H\n #define BUNDLE_H\n \n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"cache.h\"\n \n struct ref_list {\ndiff --git a/diff.c b/diff.c\nindex d24aaa3047..ee008155e4 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -20,7 +20,7 @@\n #include \"hashmap.h\"\n #include \"ll-merge.h\"\n #include \"string-list.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"graph.h\"\n #include \"packfile.h\"\n #include \"parse-options.h\"\ndiff --git a/environment.c b/environment.c\nindex aaca0e91ac..75fe5f4c56 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -14,7 +14,7 @@\n #include \"refs.h\"\n #include \"fmt-merge-msg.h\"\n #include \"commit.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"object-store.h\"\n #include \"chdir-notify.h\"\n #include \"shallow.h\"\ndiff --git a/exec-cmd.c b/exec-cmd.c\nindex 7deeab3039..bb24c2f3bc 100644\n--- a/exec-cmd.c\n+++ b/exec-cmd.c\n@@ -1,7 +1,7 @@\n #include \"cache.h\"\n #include \"exec-cmd.h\"\n #include \"quote.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n \n #if defined(RUNTIME_PREFIX)\n \ndiff --git a/graph.c b/graph.c\nindex 4cd9915075..96af8f605a 100644\n--- a/graph.c\n+++ b/graph.c\n@@ -4,7 +4,7 @@\n #include \"color.h\"\n #include \"graph.h\"\n #include \"revision.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n \n /* Internal API */\n \ndiff --git a/http-backend.c b/http-backend.c\nindex ec3144b444..6a42badf33 100644\n--- a/http-backend.c\n+++ b/http-backend.c\n@@ -9,7 +9,7 @@\n #include \"run-command.h\"\n #include \"string-list.h\"\n #include \"url.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"packfile.h\"\n #include \"object-store.h\"\n #include \"protocol.h\"\ndiff --git a/http-push.c b/http-push.c\nindex 1ff1883cdd..3a47921cc3 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -11,7 +11,7 @@\n #include \"remote.h\"\n #include \"list-objects.h\"\n #include \"sigchain.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"packfile.h\"\n #include \"object-store.h\"\n #include \"commit-reach.h\"\ndiff --git a/line-log.c b/line-log.c\nindex c53692834d..05d077b8e7 100644\n--- a/line-log.c\n+++ b/line-log.c\n@@ -14,7 +14,7 @@\n #include \"graph.h\"\n #include \"userdiff.h\"\n #include \"line-log.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"bloom.h\"\n \n static void range_set_grow(struct range_set *rs, size_t extra)\ndiff --git a/list-objects-filter-options.c b/list-objects-filter-options.c\nindex 3553ad7b0a..3667766f29 100644\n--- a/list-objects-filter-options.c\n+++ b/list-objects-filter-options.c\n@@ -2,7 +2,7 @@\n #include \"commit.h\"\n #include \"config.h\"\n #include \"revision.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"list-objects.h\"\n #include \"list-objects-filter.h\"\n #include \"list-objects-filter-options.h\"\ndiff --git a/ls-refs.c b/ls-refs.c\nindex 50d86866c6..98fb19092a 100644\n--- a/ls-refs.c\n+++ b/ls-refs.c\n@@ -2,7 +2,7 @@\n #include \"repository.h\"\n #include \"refs.h\"\n #include \"remote.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"ls-refs.h\"\n #include \"pkt-line.h\"\n #include \"config.h\"\ndiff --git a/parse-options-cb.c b/parse-options-cb.c\nindex 86cd393013..7cba96454c 100644\n--- a/parse-options-cb.c\n+++ b/parse-options-cb.c\n@@ -4,7 +4,7 @@\n #include \"commit.h\"\n #include \"color.h\"\n #include \"string-list.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"oid-array.h\"\n \n /*----- some often used options -----*/\ndiff --git a/pathspec.c b/pathspec.c\nindex 8243e06eab..57c9b58418 100644\n--- a/pathspec.c\n+++ b/pathspec.c\n@@ -3,7 +3,7 @@\n #include \"dir.h\"\n #include \"pathspec.h\"\n #include \"attr.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"quote.h\"\n \n /*\ndiff --git a/quote.c b/quote.c\nindex bcc0dbc50d..dac8b4e55e 100644\n--- a/quote.c\n+++ b/quote.c\n@@ -1,6 +1,6 @@\n #include \"cache.h\"\n #include \"quote.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n \n int quote_path_fully = 1;\n \ndiff --git a/range-diff.c b/range-diff.c\nindex 40af086281..b4d1d56445 100644\n--- a/range-diff.c\n+++ b/range-diff.c\n@@ -2,7 +2,7 @@\n #include \"range-diff.h\"\n #include \"string-list.h\"\n #include \"run-command.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"hashmap.h\"\n #include \"xdiff-interface.h\"\n #include \"linear-assignment.h\"\ndiff --git a/range-diff.h b/range-diff.h\nindex e11976dc81..916f18bcd7 100644\n--- a/range-diff.h\n+++ b/range-diff.h\n@@ -2,7 +2,7 @@\n #define RANGE_DIFF_H\n \n #include \"diff.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n \n #define RANGE_DIFF_CREATION_FACTOR_DEFAULT 60\n \ndiff --git a/ref-filter.c b/ref-filter.c\nindex 8447cb09be..81c4399da9 100644\n--- a/ref-filter.c\n+++ b/ref-filter.c\n@@ -22,7 +22,7 @@\n #include \"commit-reach.h\"\n #include \"worktree.h\"\n #include \"hashmap.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n \n static struct ref_msg {\n \tconst char *gone;\ndiff --git a/refs.c b/refs.c\nindex 639cba93b4..0067926262 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -15,7 +15,7 @@\n #include \"tag.h\"\n #include \"submodule.h\"\n #include \"worktree.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"repository.h\"\n #include \"sigchain.h\"\n \ndiff --git a/refspec.c b/refspec.c\nindex 9a9bf21934..f9fb67d295 100644\n--- a/refspec.c\n+++ b/refspec.c\n@@ -1,5 +1,5 @@\n #include \"cache.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"refs.h\"\n #include \"refspec.h\"\n \ndiff --git a/remote-curl.c b/remote-curl.c\nindex 5cbc6e5002..05fb794ddd 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -10,7 +10,7 @@\n #include \"pkt-line.h\"\n #include \"string-list.h\"\n #include \"sideband.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"credential.h\"\n #include \"oid-array.h\"\n #include \"send-pack.h\"\ndiff --git a/remote-testsvn.c b/remote-testsvn.c\nindex cde39b94fb..809b290d45 100644\n--- a/remote-testsvn.c\n+++ b/remote-testsvn.c\n@@ -8,7 +8,7 @@\n #include \"run-command.h\"\n #include \"vcs-svn/svndump.h\"\n #include \"notes.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n \n static const char *url;\n static int dump_from_file;\ndiff --git a/remote.c b/remote.c\nindex bc46413e6a..ba1a386d98 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -11,7 +11,7 @@\n #include \"tag.h\"\n #include \"string-list.h\"\n #include \"mergesort.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"commit-reach.h\"\n #include \"advice.h\"\n \ndiff --git a/revision.c b/revision.c\nindex 6aa7f4f567..07e16ed44b 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -23,7 +23,7 @@\n #include \"bisect.h\"\n #include \"packfile.h\"\n #include \"worktree.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"commit-reach.h\"\n #include \"commit-graph.h\"\n #include \"prio-queue.h\"\ndiff --git a/run-command.c b/run-command.c\nindex a735e380a9..8f57661d96 100644\n--- a/run-command.c\n+++ b/run-command.c\n@@ -2,7 +2,7 @@\n #include \"run-command.h\"\n #include \"exec-cmd.h\"\n #include \"sigchain.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"thread-utils.h\"\n #include \"strbuf.h\"\n #include \"string-list.h\"\ndiff --git a/run-command.h b/run-command.h\nindex ef3071a565..f5e05d38d2 100644\n--- a/run-command.h\n+++ b/run-command.h\n@@ -3,7 +3,7 @@\n \n #include \"thread-utils.h\"\n \n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n \n /**\n  * The run-command API offers a versatile tool to run sub-processes with\ndiff --git a/sequencer.c b/sequencer.c\nindex fd7701c88a..9e7f868b00 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -16,7 +16,7 @@\n #include \"rerere.h\"\n #include \"merge-recursive.h\"\n #include \"refs.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"quote.h\"\n #include \"trailer.h\"\n #include \"log-tree.h\"\ndiff --git a/serve.c b/serve.c\nindex fbd2fcdfb5..8d9a345b3d 100644\n--- a/serve.c\n+++ b/serve.c\n@@ -3,7 +3,7 @@\n #include \"config.h\"\n #include \"pkt-line.h\"\n #include \"version.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"ls-refs.h\"\n #include \"serve.h\"\n #include \"upload-pack.h\"\ndiff --git a/argv-array.c b/strvec.c\nsimilarity index 98%\nrename from argv-array.c\nrename to strvec.c\nindex b7461c47e4..9e76ab9295 100644\n--- a/argv-array.c\n+++ b/strvec.c\n@@ -1,5 +1,5 @@\n #include \"cache.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"strbuf.h\"\n \n const char *empty_strvec[] = { NULL };\ndiff --git a/argv-array.h b/strvec.h\nsimilarity index 97%\nrename from argv-array.h\nrename to strvec.h\nindex ca66a338ad..4be39c8a48 100644\n--- a/argv-array.h\n+++ b/strvec.h\n@@ -1,5 +1,5 @@\n-#ifndef ARGV_ARRAY_H\n-#define ARGV_ARRAY_H\n+#ifndef STRVEC_H\n+#define STRVEC_H\n \n /**\n  * The argv-array API allows one to dynamically build and store\n@@ -99,4 +99,4 @@ const char **strvec_detach(struct strvec *);\n #define argv_array_clear strvec_clear\n #define argv_array_detach strvec_detach\n \n-#endif /* ARGV_ARRAY_H */\n+#endif /* STRVEC_H */\ndiff --git a/submodule.c b/submodule.c\nindex e2ef5698c8..874db5c4b2 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -13,7 +13,7 @@\n #include \"refs.h\"\n #include \"string-list.h\"\n #include \"oid-array.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"blob.h\"\n #include \"thread-utils.h\"\n #include \"quote.h\"\ndiff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c\nindex 1646aa25d8..8d3f6d5a5e 100644\n--- a/t/helper/test-run-command.c\n+++ b/t/helper/test-run-command.c\n@@ -12,7 +12,7 @@\n #include \"git-compat-util.h\"\n #include \"cache.h\"\n #include \"run-command.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"strbuf.h\"\n #include \"parse-options.h\"\n #include \"string-list.h\"\ndiff --git a/t/helper/test-trace2.c b/t/helper/test-trace2.c\nindex 197819c872..823f33ceff 100644\n--- a/t/helper/test-trace2.c\n+++ b/t/helper/test-trace2.c\n@@ -1,6 +1,6 @@\n #include \"test-tool.h\"\n #include \"cache.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"run-command.h\"\n #include \"exec-cmd.h\"\n #include \"config.h\"\ndiff --git a/tmp-objdir.c b/tmp-objdir.c\nindex 91c00567f4..06924a7875 100644\n--- a/tmp-objdir.c\n+++ b/tmp-objdir.c\n@@ -4,7 +4,7 @@\n #include \"sigchain.h\"\n #include \"string-list.h\"\n #include \"strbuf.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"quote.h\"\n #include \"object-store.h\"\n \ndiff --git a/transport-helper.c b/transport-helper.c\nindex c6b753bfae..441763fd7c 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -9,7 +9,7 @@\n #include \"string-list.h\"\n #include \"thread-utils.h\"\n #include \"sigchain.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"refs.h\"\n #include \"refspec.h\"\n #include \"transport-internal.h\"\ndiff --git a/unpack-trees.c b/unpack-trees.c\nindex 4be5fc3075..65c3395f0f 100644\n--- a/unpack-trees.c\n+++ b/unpack-trees.c\n@@ -1,5 +1,5 @@\n #include \"cache.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"repository.h\"\n #include \"config.h\"\n #include \"dir.h\"\ndiff --git a/unpack-trees.h b/unpack-trees.h\nindex 9c2f08277e..f8a904a05b 100644\n--- a/unpack-trees.h\n+++ b/unpack-trees.h\n@@ -2,7 +2,7 @@\n #define UNPACK_TREES_H\n \n #include \"cache.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"string-list.h\"\n #include \"tree-walk.h\"\n \ndiff --git a/upload-pack.c b/upload-pack.c\nindex 951a2b23aa..b435dae62f 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -18,7 +18,7 @@\n #include \"sigchain.h\"\n #include \"version.h\"\n #include \"string-list.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"prio-queue.h\"\n #include \"protocol.h\"\n #include \"quote.h\"\ndiff --git a/wt-status.c b/wt-status.c\nindex c560cbe860..9817161da4 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -8,7 +8,7 @@\n #include \"diffcore.h\"\n #include \"quote.h\"\n #include \"run-command.h\"\n-#include \"argv-array.h\"\n+#include \"strvec.h\"\n #include \"remote.h\"\n #include \"refs.h\"\n #include \"submodule.h\"\n-- \n2.28.0.rc2.475.g53c7e1c7f4\n\n"},{"id":"402233","messageId":"20200728202402.GD1021513@coredump.intra.peff.net","threadId":"53940","inReplyTo":"20200728202124.GA1021264@coredump.intra.peff.net","subject":"[PATCH 04/11] quote: rename sq_dequote_to_argv_array to mention strvec","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-28T20:24:02Z","receivedAt":"2020-07-28T20:24:05Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"We want to eventually drop the use of the \"argv_array\" name in favor of\n\"strvec.\" Unlike most other uses of the name, this one is embedded in a\nfunction name, so the definition and all of the callers need to be\nupdated at the same time.\n\nWe don't technically need to update the parameter types here (our\npreprocessor compat macros make the two names interchangeable), but\nlet's do so to keep the site consistent for now.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n bisect.c     | 2 +-\n builtin/am.c | 2 +-\n quote.c      | 2 +-\n quote.h      | 6 +++---\n 4 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/bisect.c b/bisect.c\nindex 3160e82e96..77e35ddd43 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -464,7 +464,7 @@ static void read_bisect_paths(struct argv_array *array)\n \n \twhile (strbuf_getline_lf(&str, fp) != EOF) {\n \t\tstrbuf_trim(&str);\n-\t\tif (sq_dequote_to_argv_array(str.buf, array))\n+\t\tif (sq_dequote_to_strvec(str.buf, array))\n \t\t\tdie(_(\"Badly quoted content in file '%s': %s\"),\n \t\t\t    filename, str.buf);\n \t}\ndiff --git a/builtin/am.c b/builtin/am.c\nindex 69e50de018..0641316e35 100644\n--- a/builtin/am.c\n+++ b/builtin/am.c\n@@ -399,7 +399,7 @@ static void am_load(struct am_state *state)\n \n \tread_state_file(&sb, state, \"apply-opt\", 1);\n \targv_array_clear(&state->git_apply_opts);\n-\tif (sq_dequote_to_argv_array(sb.buf, &state->git_apply_opts) < 0)\n+\tif (sq_dequote_to_strvec(sb.buf, &state->git_apply_opts) < 0)\n \t\tdie(_(\"could not parse %s\"), am_path(state, \"apply-opt\"));\n \n \tstate->rebasing = !!file_exists(am_path(state, \"rebasing\"));\ndiff --git a/quote.c b/quote.c\nindex dac8b4e55e..10b383cc1d 100644\n--- a/quote.c\n+++ b/quote.c\n@@ -198,7 +198,7 @@ int sq_dequote_to_argv(char *arg, const char ***argv, int *nr, int *alloc)\n \treturn sq_dequote_to_argv_internal(arg, argv, nr, alloc, NULL);\n }\n \n-int sq_dequote_to_argv_array(char *arg, struct argv_array *array)\n+int sq_dequote_to_strvec(char *arg, struct strvec *array)\n {\n \treturn sq_dequote_to_argv_internal(arg, NULL, NULL, NULL, array);\n }\ndiff --git a/quote.h b/quote.h\nindex 210d580229..fa09309cf6 100644\n--- a/quote.h\n+++ b/quote.h\n@@ -56,12 +56,12 @@ char *sq_dequote(char *);\n int sq_dequote_to_argv(char *arg, const char ***argv, int *nr, int *alloc);\n \n /*\n- * Same as above, but store the unquoted strings in an argv_array. We will\n- * still modify arg in place, but unlike sq_dequote_to_argv, the argv_array\n+ * Same as above, but store the unquoted strings in a strvec. We will\n+ * still modify arg in place, but unlike sq_dequote_to_argv, the strvec\n  * will duplicate and take ownership of the strings.\n  */\n struct strvec;\n-int sq_dequote_to_argv_array(char *arg, struct strvec *);\n+int sq_dequote_to_strvec(char *arg, struct strvec *);\n \n int unquote_c_style(struct strbuf *, const char *quoted, const char **endp);\n size_t quote_c_style(const char *name, struct strbuf *, FILE *, int no_dq);\n-- \n2.28.0.rc2.475.g53c7e1c7f4\n\n"},{"id":"402234","messageId":"20200728202427.GE1021513@coredump.intra.peff.net","threadId":"53940","inReplyTo":"20200728202124.GA1021264@coredump.intra.peff.net","subject":"[PATCH 05/11] strvec: convert builtin/ callers away from argv_array name","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-28T20:24:27Z","receivedAt":"2020-07-28T20:24:37Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"We eventually want to drop the argv_array name and just use strvec\nconsistently. There's no particular reason we have to do it all at once,\nor care about interactions between converted and unconverted bits.\nBecause of our preprocessor compat layer, the names are interchangeable\nto the compiler (so even a definition and declaration using different\nnames is OK).\n\nThis patch converts all of the files in builtin/ to keep the diff to a\nmanageable size.\n\nThe conversion was done purely mechanically with:\n\n  git ls-files '*.c' '*.h' |\n  xargs perl -i -pe '\n    s/ARGV_ARRAY/STRVEC/g;\n    s/argv_array/strvec/g;\n  '\n\nand then selectively staging files with \"git add builtin/\". We'll deal\nwith any indentation/style fallouts separately.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n builtin/add.c               |  14 ++--\n builtin/am.c                |  66 ++++++++--------\n builtin/annotate.c          |   6 +-\n builtin/bisect--helper.c    |  12 +--\n builtin/bundle.c            |  12 +--\n builtin/clone.c             |  34 ++++-----\n builtin/commit.c            |   6 +-\n builtin/describe.c          |  28 +++----\n builtin/difftool.c          |  14 ++--\n builtin/fetch.c             |  54 ++++++-------\n builtin/gc.c                |  50 ++++++------\n builtin/grep.c              |   2 +-\n builtin/log.c               |  12 +--\n builtin/ls-remote.c         |   6 +-\n builtin/pack-objects.c      |  22 +++---\n builtin/pull.c              | 148 ++++++++++++++++++------------------\n builtin/range-diff.c        |   4 +-\n builtin/rebase.c            |  60 +++++++--------\n builtin/receive-pack.c      |  68 ++++++++---------\n builtin/remote-ext.c        |   4 +-\n builtin/remote.c            |  20 ++---\n builtin/repack.c            |  62 +++++++--------\n builtin/replace.c           |  16 ++--\n builtin/show-branch.c       |   6 +-\n builtin/stash.c             | 114 +++++++++++++--------------\n builtin/submodule--helper.c | 118 ++++++++++++++--------------\n builtin/upload-archive.c    |   6 +-\n builtin/worktree.c          |  42 +++++-----\n 28 files changed, 503 insertions(+), 503 deletions(-)\n\ndiff --git a/builtin/add.c b/builtin/add.c\nindex 6cd9a4cd77..6185dd12a8 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -188,7 +188,7 @@ int run_add_interactive(const char *revision, const char *patch_mode,\n \t\t\tconst struct pathspec *pathspec)\n {\n \tint status, i;\n-\tstruct argv_array argv = ARGV_ARRAY_INIT;\n+\tstruct strvec argv = STRVEC_INIT;\n \tint use_builtin_add_i =\n \t\tgit_env_bool(\"GIT_TEST_ADD_I_USE_BUILTIN\", -1);\n \n@@ -218,18 +218,18 @@ int run_add_interactive(const char *revision, const char *patch_mode,\n \t\treturn !!run_add_p(the_repository, mode, revision, pathspec);\n \t}\n \n-\targv_array_push(&argv, \"add--interactive\");\n+\tstrvec_push(&argv, \"add--interactive\");\n \tif (patch_mode)\n-\t\targv_array_push(&argv, patch_mode);\n+\t\tstrvec_push(&argv, patch_mode);\n \tif (revision)\n-\t\targv_array_push(&argv, revision);\n-\targv_array_push(&argv, \"--\");\n+\t\tstrvec_push(&argv, revision);\n+\tstrvec_push(&argv, \"--\");\n \tfor (i = 0; i < pathspec->nr; i++)\n \t\t/* pass original pathspec, to be re-parsed */\n-\t\targv_array_push(&argv, pathspec->items[i].original);\n+\t\tstrvec_push(&argv, pathspec->items[i].original);\n \n \tstatus = run_command_v_opt(argv.argv, RUN_GIT_CMD);\n-\targv_array_clear(&argv);\n+\tstrvec_clear(&argv);\n \treturn status;\n }\n \ndiff --git a/builtin/am.c b/builtin/am.c\nindex 0641316e35..992ab3ca27 100644\n--- a/builtin/am.c\n+++ b/builtin/am.c\n@@ -116,7 +116,7 @@ struct am_state {\n \tint keep; /* enum keep_type */\n \tint message_id;\n \tint scissors; /* enum scissors_type */\n-\tstruct argv_array git_apply_opts;\n+\tstruct strvec git_apply_opts;\n \tconst char *resolvemsg;\n \tint committer_date_is_author_date;\n \tint ignore_date;\n@@ -146,7 +146,7 @@ static void am_state_init(struct am_state *state)\n \n \tstate->scissors = SCISSORS_UNSET;\n \n-\targv_array_init(&state->git_apply_opts);\n+\tstrvec_init(&state->git_apply_opts);\n \n \tif (!git_config_get_bool(\"commit.gpgsign\", &gpgsign))\n \t\tstate->sign_commit = gpgsign ? \"\" : NULL;\n@@ -162,7 +162,7 @@ static void am_state_release(struct am_state *state)\n \tfree(state->author_email);\n \tfree(state->author_date);\n \tfree(state->msg);\n-\targv_array_clear(&state->git_apply_opts);\n+\tstrvec_clear(&state->git_apply_opts);\n }\n \n /**\n@@ -398,7 +398,7 @@ static void am_load(struct am_state *state)\n \t\tstate->scissors = SCISSORS_UNSET;\n \n \tread_state_file(&sb, state, \"apply-opt\", 1);\n-\targv_array_clear(&state->git_apply_opts);\n+\tstrvec_clear(&state->git_apply_opts);\n \tif (sq_dequote_to_strvec(sb.buf, &state->git_apply_opts) < 0)\n \t\tdie(_(\"could not parse %s\"), am_path(state, \"apply-opt\"));\n \n@@ -452,8 +452,8 @@ static int run_post_rewrite_hook(const struct am_state *state)\n \tif (!hook)\n \t\treturn 0;\n \n-\targv_array_push(&cp.args, hook);\n-\targv_array_push(&cp.args, \"rebase\");\n+\tstrvec_push(&cp.args, hook);\n+\tstrvec_push(&cp.args, \"rebase\");\n \n \tcp.in = xopen(am_path(state, \"rewritten\"), O_RDONLY);\n \tcp.stdout_to_stderr = 1;\n@@ -651,16 +651,16 @@ static int split_mail_mbox(struct am_state *state, const char **paths,\n \tint ret;\n \n \tcp.git_cmd = 1;\n-\targv_array_push(&cp.args, \"mailsplit\");\n-\targv_array_pushf(&cp.args, \"-d%d\", state->prec);\n-\targv_array_pushf(&cp.args, \"-o%s\", state->dir);\n-\targv_array_push(&cp.args, \"-b\");\n+\tstrvec_push(&cp.args, \"mailsplit\");\n+\tstrvec_pushf(&cp.args, \"-d%d\", state->prec);\n+\tstrvec_pushf(&cp.args, \"-o%s\", state->dir);\n+\tstrvec_push(&cp.args, \"-b\");\n \tif (keep_cr)\n-\t\targv_array_push(&cp.args, \"--keep-cr\");\n+\t\tstrvec_push(&cp.args, \"--keep-cr\");\n \tif (mboxrd)\n-\t\targv_array_push(&cp.args, \"--mboxrd\");\n-\targv_array_push(&cp.args, \"--\");\n-\targv_array_pushv(&cp.args, paths);\n+\t\tstrvec_push(&cp.args, \"--mboxrd\");\n+\tstrvec_push(&cp.args, \"--\");\n+\tstrvec_pushv(&cp.args, paths);\n \n \tret = capture_command(&cp, &last, 8);\n \tif (ret)\n@@ -787,7 +787,7 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths,\n \tconst char *series_dir;\n \tchar *series_dir_buf;\n \tFILE *fp;\n-\tstruct argv_array patches = ARGV_ARRAY_INIT;\n+\tstruct strvec patches = STRVEC_INIT;\n \tstruct strbuf sb = STRBUF_INIT;\n \tint ret;\n \n@@ -805,7 +805,7 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths,\n \t\tif (*sb.buf == '#')\n \t\t\tcontinue; /* skip comment lines */\n \n-\t\targv_array_push(&patches, mkpath(\"%s/%s\", series_dir, sb.buf));\n+\t\tstrvec_push(&patches, mkpath(\"%s/%s\", series_dir, sb.buf));\n \t}\n \n \tfclose(fp);\n@@ -814,7 +814,7 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths,\n \n \tret = split_mail_conv(stgit_patch_to_mail, state, patches.argv, keep_cr);\n \n-\targv_array_clear(&patches);\n+\tstrvec_clear(&patches);\n \treturn ret;\n }\n \n@@ -1390,8 +1390,8 @@ static int parse_mail_rebase(struct am_state *state, const char *mail)\n  */\n static int run_apply(const struct am_state *state, const char *index_file)\n {\n-\tstruct argv_array apply_paths = ARGV_ARRAY_INIT;\n-\tstruct argv_array apply_opts = ARGV_ARRAY_INIT;\n+\tstruct strvec apply_paths = STRVEC_INIT;\n+\tstruct strvec apply_opts = STRVEC_INIT;\n \tstruct apply_state apply_state;\n \tint res, opts_left;\n \tint force_apply = 0;\n@@ -1400,8 +1400,8 @@ static int run_apply(const struct am_state *state, const char *index_file)\n \tif (init_apply_state(&apply_state, the_repository, NULL))\n \t\tBUG(\"init_apply_state() failed\");\n \n-\targv_array_push(&apply_opts, \"apply\");\n-\targv_array_pushv(&apply_opts, state->git_apply_opts.argv);\n+\tstrvec_push(&apply_opts, \"apply\");\n+\tstrvec_pushv(&apply_opts, state->git_apply_opts.argv);\n \n \topts_left = apply_parse_options(apply_opts.argc, apply_opts.argv,\n \t\t\t\t\t&apply_state, &force_apply, &options,\n@@ -1426,12 +1426,12 @@ static int run_apply(const struct am_state *state, const char *index_file)\n \tif (check_apply_state(&apply_state, force_apply))\n \t\tBUG(\"check_apply_state() failed\");\n \n-\targv_array_push(&apply_paths, am_path(state, \"patch\"));\n+\tstrvec_push(&apply_paths, am_path(state, \"patch\"));\n \n \tres = apply_all_patches(&apply_state, apply_paths.argc, apply_paths.argv, options);\n \n-\targv_array_clear(&apply_paths);\n-\targv_array_clear(&apply_opts);\n+\tstrvec_clear(&apply_paths);\n+\tstrvec_clear(&apply_opts);\n \tclear_apply_state(&apply_state);\n \n \tif (res)\n@@ -1454,10 +1454,10 @@ static int build_fake_ancestor(const struct am_state *state, const char *index_f\n \tstruct child_process cp = CHILD_PROCESS_INIT;\n \n \tcp.git_cmd = 1;\n-\targv_array_push(&cp.args, \"apply\");\n-\targv_array_pushv(&cp.args, state->git_apply_opts.argv);\n-\targv_array_pushf(&cp.args, \"--build-fake-ancestor=%s\", index_file);\n-\targv_array_push(&cp.args, am_path(state, \"patch\"));\n+\tstrvec_push(&cp.args, \"apply\");\n+\tstrvec_pushv(&cp.args, state->git_apply_opts.argv);\n+\tstrvec_pushf(&cp.args, \"--build-fake-ancestor=%s\", index_file);\n+\tstrvec_push(&cp.args, am_path(state, \"patch\"));\n \n \tif (run_command(&cp))\n \t\treturn -1;\n@@ -1676,7 +1676,7 @@ static int do_interactive(struct am_state *state)\n \t\t\tif (!pager)\n \t\t\t\tpager = \"cat\";\n \t\t\tprepare_pager_args(&cp, pager);\n-\t\t\targv_array_push(&cp.args, am_path(state, \"patch\"));\n+\t\t\tstrvec_push(&cp.args, am_path(state, \"patch\"));\n \t\t\trun_command(&cp);\n \t\t}\n \t}\n@@ -2346,7 +2346,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)\n \t\tif (state.signoff == SIGNOFF_EXPLICIT)\n \t\t\tam_append_signoff(&state);\n \t} else {\n-\t\tstruct argv_array paths = ARGV_ARRAY_INIT;\n+\t\tstruct strvec paths = STRVEC_INIT;\n \t\tint i;\n \n \t\t/*\n@@ -2371,17 +2371,17 @@ int cmd_am(int argc, const char **argv, const char *prefix)\n \n \t\tfor (i = 0; i < argc; i++) {\n \t\t\tif (is_absolute_path(argv[i]) || !prefix)\n-\t\t\t\targv_array_push(&paths, argv[i]);\n+\t\t\t\tstrvec_push(&paths, argv[i]);\n \t\t\telse\n-\t\t\t\targv_array_push(&paths, mkpath(\"%s/%s\", prefix, argv[i]));\n+\t\t\t\tstrvec_push(&paths, mkpath(\"%s/%s\", prefix, argv[i]));\n \t\t}\n \n \t\tif (state.interactive && !paths.argc)\n \t\t\tdie(_(\"interactive mode requires patches on the command line\"));\n \n \t\tam_setup(&state, patch_format, paths.argv, keep_cr);\n \n-\t\targv_array_clear(&paths);\n+\t\tstrvec_clear(&paths);\n \t}\n \n \tswitch (resume.mode) {\ndiff --git a/builtin/annotate.c b/builtin/annotate.c\nindex 4353448712..7b7ecd366d 100644\n--- a/builtin/annotate.c\n+++ b/builtin/annotate.c\n@@ -9,13 +9,13 @@\n \n int cmd_annotate(int argc, const char **argv, const char *prefix)\n {\n-\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\tstruct strvec args = STRVEC_INIT;\n \tint i;\n \n-\targv_array_pushl(&args, \"annotate\", \"-c\", NULL);\n+\tstrvec_pushl(&args, \"annotate\", \"-c\", NULL);\n \n \tfor (i = 1; i < argc; i++) {\n-\t\targv_array_push(&args, argv[i]);\n+\t\tstrvec_push(&args, argv[i]);\n \t}\n \n \treturn cmd_blame(args.argc, args.argv, prefix);\ndiff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c\nindex e929315b38..9815e78871 100644\n--- a/builtin/bisect--helper.c\n+++ b/builtin/bisect--helper.c\n@@ -165,18 +165,18 @@ static int bisect_reset(const char *commit)\n \t}\n \n \tif (!file_exists(git_path_bisect_head())) {\n-\t\tstruct argv_array argv = ARGV_ARRAY_INIT;\n+\t\tstruct strvec argv = STRVEC_INIT;\n \n-\t\targv_array_pushl(&argv, \"checkout\", branch.buf, \"--\", NULL);\n+\t\tstrvec_pushl(&argv, \"checkout\", branch.buf, \"--\", NULL);\n \t\tif (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {\n \t\t\terror(_(\"could not check out original\"\n \t\t\t\t\" HEAD '%s'. Try 'git bisect\"\n \t\t\t\t\" reset <commit>'.\"), branch.buf);\n \t\t\tstrbuf_release(&branch);\n-\t\t\targv_array_clear(&argv);\n+\t\t\tstrvec_clear(&argv);\n \t\t\treturn -1;\n \t\t}\n-\t\targv_array_clear(&argv);\n+\t\tstrvec_clear(&argv);\n \t}\n \n \tstrbuf_release(&branch);\n@@ -526,9 +526,9 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout,\n \t\tstrbuf_read_file(&start_head, git_path_bisect_start(), 0);\n \t\tstrbuf_trim(&start_head);\n \t\tif (!no_checkout) {\n-\t\t\tstruct argv_array argv = ARGV_ARRAY_INIT;\n+\t\t\tstruct strvec argv = STRVEC_INIT;\n \n-\t\t\targv_array_pushl(&argv, \"checkout\", start_head.buf,\n+\t\t\tstrvec_pushl(&argv, \"checkout\", start_head.buf,\n \t\t\t\t\t \"--\", NULL);\n \t\t\tif (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {\n \t\t\t\tres = error(_(\"checking out '%s' failed.\"\ndiff --git a/builtin/bundle.c b/builtin/bundle.c\nindex 51fc6d9739..750630bdd9 100644\n--- a/builtin/bundle.c\n+++ b/builtin/bundle.c\n@@ -59,7 +59,7 @@ static int parse_options_cmd_bundle(int argc,\n static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {\n \tint all_progress_implied = 0;\n \tint progress = isatty(STDERR_FILENO);\n-\tstruct argv_array pack_opts;\n+\tstruct strvec pack_opts;\n \n \tstruct option options[] = {\n \t\tOPT_SET_INT('q', \"quiet\", &progress,\n@@ -79,15 +79,15 @@ static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {\n \t\t\tbuiltin_bundle_create_usage, options, &bundle_file);\n \t/* bundle internals use argv[1] as further parameters */\n \n-\targv_array_init(&pack_opts);\n+\tstrvec_init(&pack_opts);\n \tif (progress == 0)\n-\t\targv_array_push(&pack_opts, \"--quiet\");\n+\t\tstrvec_push(&pack_opts, \"--quiet\");\n \telse if (progress == 1)\n-\t\targv_array_push(&pack_opts, \"--progress\");\n+\t\tstrvec_push(&pack_opts, \"--progress\");\n \telse if (progress == 2)\n-\t\targv_array_push(&pack_opts, \"--all-progress\");\n+\t\tstrvec_push(&pack_opts, \"--all-progress\");\n \tif (progress && all_progress_implied)\n-\t\targv_array_push(&pack_opts, \"--all-progress-implied\");\n+\t\tstrvec_push(&pack_opts, \"--all-progress-implied\");\n \n \tif (!startup_info->have_repository)\n \t\tdie(_(\"Need a repository to create a bundle.\"));\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex bef70745c0..e26bd82dc4 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -742,9 +742,9 @@ static void update_head(const struct ref *our, const struct ref *remote,\n \n static int git_sparse_checkout_init(const char *repo)\n {\n-\tstruct argv_array argv = ARGV_ARRAY_INIT;\n+\tstruct strvec argv = STRVEC_INIT;\n \tint result = 0;\n-\targv_array_pushl(&argv, \"-C\", repo, \"sparse-checkout\", \"init\", NULL);\n+\tstrvec_pushl(&argv, \"-C\", repo, \"sparse-checkout\", \"init\", NULL);\n \n \t/*\n \t * We must apply the setting in the current process\n@@ -757,7 +757,7 @@ static int git_sparse_checkout_init(const char *repo)\n \t\tresult = 1;\n \t}\n \n-\targv_array_clear(&argv);\n+\tstrvec_clear(&argv);\n \treturn result;\n }\n \n@@ -819,33 +819,33 @@ static int checkout(int submodule_progress)\n \t\t\t   oid_to_hex(&oid), \"1\", NULL);\n \n \tif (!err && (option_recurse_submodules.nr > 0)) {\n-\t\tstruct argv_array args = ARGV_ARRAY_INIT;\n-\t\targv_array_pushl(&args, \"submodule\", \"update\", \"--require-init\", \"--recursive\", NULL);\n+\t\tstruct strvec args = STRVEC_INIT;\n+\t\tstrvec_pushl(&args, \"submodule\", \"update\", \"--require-init\", \"--recursive\", NULL);\n \n \t\tif (option_shallow_submodules == 1)\n-\t\t\targv_array_push(&args, \"--depth=1\");\n+\t\t\tstrvec_push(&args, \"--depth=1\");\n \n \t\tif (max_jobs != -1)\n-\t\t\targv_array_pushf(&args, \"--jobs=%d\", max_jobs);\n+\t\t\tstrvec_pushf(&args, \"--jobs=%d\", max_jobs);\n \n \t\tif (submodule_progress)\n-\t\t\targv_array_push(&args, \"--progress\");\n+\t\t\tstrvec_push(&args, \"--progress\");\n \n \t\tif (option_verbosity < 0)\n-\t\t\targv_array_push(&args, \"--quiet\");\n+\t\t\tstrvec_push(&args, \"--quiet\");\n \n \t\tif (option_remote_submodules) {\n-\t\t\targv_array_push(&args, \"--remote\");\n-\t\t\targv_array_push(&args, \"--no-fetch\");\n+\t\t\tstrvec_push(&args, \"--remote\");\n+\t\t\tstrvec_push(&args, \"--no-fetch\");\n \t\t}\n \n \t\tif (option_single_branch >= 0)\n-\t\t\targv_array_push(&args, option_single_branch ?\n+\t\t\tstrvec_push(&args, option_single_branch ?\n \t\t\t\t\t       \"--single-branch\" :\n \t\t\t\t\t       \"--no-single-branch\");\n \n \t\terr = run_command_v_opt(args.argv, RUN_GIT_CMD);\n-\t\targv_array_clear(&args);\n+\t\tstrvec_clear(&args);\n \t}\n \n \treturn err;\n@@ -961,7 +961,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \tint err = 0, complete_refs_before_fetch = 1;\n \tint submodule_progress;\n \n-\tstruct argv_array ref_prefixes = ARGV_ARRAY_INIT;\n+\tstruct strvec ref_prefixes = STRVEC_INIT;\n \n \tpacket_trace_identity(\"clone\");\n \targc = parse_options(argc, argv, prefix, builtin_clone_options,\n@@ -1211,12 +1211,12 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\ttransport->smart_options->check_self_contained_and_connected = 1;\n \n \n-\targv_array_push(&ref_prefixes, \"HEAD\");\n+\tstrvec_push(&ref_prefixes, \"HEAD\");\n \trefspec_ref_prefixes(&remote->fetch, &ref_prefixes);\n \tif (option_branch)\n \t\texpand_ref_prefix(&ref_prefixes, option_branch);\n \tif (!option_no_tags)\n-\t\targv_array_push(&ref_prefixes, \"refs/tags/\");\n+\t\tstrvec_push(&ref_prefixes, \"refs/tags/\");\n \n \trefs = transport_get_remote_refs(transport, &ref_prefixes);\n \n@@ -1327,6 +1327,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \tstrbuf_release(&default_refspec);\n \tjunk_mode = JUNK_LEAVE_ALL;\n \n-\targv_array_clear(&ref_prefixes);\n+\tstrvec_clear(&ref_prefixes);\n \treturn err;\n }\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex d1b7396052..c3f4067537 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1005,15 +1005,15 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\treturn 0;\n \n \tif (use_editor) {\n-\t\tstruct argv_array env = ARGV_ARRAY_INIT;\n+\t\tstruct strvec env = STRVEC_INIT;\n \n-\t\targv_array_pushf(&env, \"GIT_INDEX_FILE=%s\", index_file);\n+\t\tstrvec_pushf(&env, \"GIT_INDEX_FILE=%s\", index_file);\n \t\tif (launch_editor(git_path_commit_editmsg(), NULL, env.argv)) {\n \t\t\tfprintf(stderr,\n \t\t\t_(\"Please supply the message using either -m or -F option.\\n\"));\n \t\t\texit(1);\n \t\t}\n-\t\targv_array_clear(&env);\n+\t\tstrvec_clear(&env);\n \t}\n \n \tif (!no_verify &&\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex 32ad6822f7..ff3c169fa9 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -501,10 +501,10 @@ static void process_object(struct object *obj, const char *path, void *data)\n static void describe_blob(struct object_id oid, struct strbuf *dst)\n {\n \tstruct rev_info revs;\n-\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\tstruct strvec args = STRVEC_INIT;\n \tstruct process_commit_data pcd = { null_oid, oid, dst, &revs};\n \n-\targv_array_pushl(&args, \"internal: The first arg is not parsed\",\n+\tstrvec_pushl(&args, \"internal: The first arg is not parsed\",\n \t\t\"--objects\", \"--in-commit-order\", \"--reverse\", \"HEAD\",\n \t\tNULL);\n \n@@ -594,25 +594,25 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \n \tif (contains) {\n \t\tstruct string_list_item *item;\n-\t\tstruct argv_array args;\n+\t\tstruct strvec args;\n \n-\t\targv_array_init(&args);\n-\t\targv_array_pushl(&args, \"name-rev\",\n+\t\tstrvec_init(&args);\n+\t\tstrvec_pushl(&args, \"name-rev\",\n \t\t\t\t \"--peel-tag\", \"--name-only\", \"--no-undefined\",\n \t\t\t\t NULL);\n \t\tif (always)\n-\t\t\targv_array_push(&args, \"--always\");\n+\t\t\tstrvec_push(&args, \"--always\");\n \t\tif (!all) {\n-\t\t\targv_array_push(&args, \"--tags\");\n+\t\t\tstrvec_push(&args, \"--tags\");\n \t\t\tfor_each_string_list_item(item, &patterns)\n-\t\t\t\targv_array_pushf(&args, \"--refs=refs/tags/%s\", item->string);\n+\t\t\t\tstrvec_pushf(&args, \"--refs=refs/tags/%s\", item->string);\n \t\t\tfor_each_string_list_item(item, &exclude_patterns)\n-\t\t\t\targv_array_pushf(&args, \"--exclude=refs/tags/%s\", item->string);\n+\t\t\t\tstrvec_pushf(&args, \"--exclude=refs/tags/%s\", item->string);\n \t\t}\n \t\tif (argc)\n-\t\t\targv_array_pushv(&args, argv);\n+\t\t\tstrvec_pushv(&args, argv);\n \t\telse\n-\t\t\targv_array_push(&args, \"HEAD\");\n+\t\t\tstrvec_push(&args, \"HEAD\");\n \t\treturn cmd_name_rev(args.argc, args.argv, prefix);\n \t}\n \n@@ -624,7 +624,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \tif (argc == 0) {\n \t\tif (broken) {\n \t\t\tstruct child_process cp = CHILD_PROCESS_INIT;\n-\t\t\targv_array_pushv(&cp.args, diff_index_args);\n+\t\t\tstrvec_pushv(&cp.args, diff_index_args);\n \t\t\tcp.git_cmd = 1;\n \t\t\tcp.no_stdin = 1;\n \t\t\tcp.no_stdout = 1;\n@@ -646,7 +646,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \t\t} else if (dirty) {\n \t\t\tstruct lock_file index_lock = LOCK_INIT;\n \t\t\tstruct rev_info revs;\n-\t\t\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\t\t\tstruct strvec args = STRVEC_INIT;\n \t\t\tint fd, result;\n \n \t\t\tsetup_work_tree();\n@@ -658,7 +658,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \t\t\t\trepo_update_index_if_able(the_repository, &index_lock);\n \n \t\t\trepo_init_revisions(the_repository, &revs, prefix);\n-\t\t\targv_array_pushv(&args, diff_index_args);\n+\t\t\tstrvec_pushv(&args, diff_index_args);\n \t\t\tif (setup_revisions(args.argc, args.argv, &revs, NULL) != 1)\n \t\t\t\tBUG(\"malformed internal diff-index command line\");\n \t\t\tresult = run_diff_index(&revs, 0);\ndiff --git a/builtin/difftool.c b/builtin/difftool.c\nindex c0608a78d9..40c4d7b6b6 100644\n--- a/builtin/difftool.c\n+++ b/builtin/difftool.c\n@@ -210,7 +210,7 @@ static void changed_files(struct hashmap *result, const char *index_path,\n \tstrbuf_addf(&index_env, \"GIT_INDEX_FILE=%s\", index_path);\n \tenv[0] = index_env.buf;\n \n-\targv_array_pushl(&update_index.args,\n+\tstrvec_pushl(&update_index.args,\n \t\t\t \"--git-dir\", git_dir, \"--work-tree\", workdir,\n \t\t\t \"update-index\", \"--really-refresh\", \"-q\",\n \t\t\t \"--unmerged\", NULL);\n@@ -225,7 +225,7 @@ static void changed_files(struct hashmap *result, const char *index_path,\n \t/* Ignore any errors of update-index */\n \trun_command(&update_index);\n \n-\targv_array_pushl(&diff_files.args,\n+\tstrvec_pushl(&diff_files.args,\n \t\t\t \"--git-dir\", git_dir, \"--work-tree\", workdir,\n \t\t\t \"diff-files\", \"--name-only\", \"-z\", NULL);\n \tdiff_files.no_stdin = 1;\n@@ -393,10 +393,10 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,\n \tchild.clean_on_exit = 1;\n \tchild.dir = prefix;\n \tchild.out = -1;\n-\targv_array_pushl(&child.args, \"diff\", \"--raw\", \"--no-abbrev\", \"-z\",\n+\tstrvec_pushl(&child.args, \"diff\", \"--raw\", \"--no-abbrev\", \"-z\",\n \t\t\t NULL);\n \tfor (i = 0; i < argc; i++)\n-\t\targv_array_push(&child.args, argv[i]);\n+\t\tstrvec_push(&child.args, argv[i]);\n \tif (start_command(&child))\n \t\tdie(\"could not obtain raw diff\");\n \tfp = xfdopen(child.out, \"r\");\n@@ -667,7 +667,7 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,\n static int run_file_diff(int prompt, const char *prefix,\n \t\t\t int argc, const char **argv)\n {\n-\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\tstruct strvec args = STRVEC_INIT;\n \tconst char *env[] = {\n \t\t\"GIT_PAGER=\", \"GIT_EXTERNAL_DIFF=git-difftool--helper\", NULL,\n \t\tNULL\n@@ -680,9 +680,9 @@ static int run_file_diff(int prompt, const char *prefix,\n \t\tenv[2] = \"GIT_DIFFTOOL_NO_PROMPT=true\";\n \n \n-\targv_array_push(&args, \"diff\");\n+\tstrvec_push(&args, \"diff\");\n \tfor (i = 0; i < argc; i++)\n-\t\targv_array_push(&args, argv[i]);\n+\t\tstrvec_push(&args, argv[i]);\n \tret = run_command_v_opt_cd_env(args.argv, RUN_GIT_CMD, prefix, env);\n \texit(ret);\n }\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex b183b55ee9..cc636188ad 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -1316,7 +1316,7 @@ static int do_fetch(struct transport *transport,\n \tint autotags = (transport->remote->fetch_tags == 1);\n \tint retcode = 0;\n \tconst struct ref *remote_refs;\n-\tstruct argv_array ref_prefixes = ARGV_ARRAY_INIT;\n+\tstruct strvec ref_prefixes = STRVEC_INIT;\n \tint must_list_refs = 1;\n \n \tif (tags == TAGS_DEFAULT) {\n@@ -1355,7 +1355,7 @@ static int do_fetch(struct transport *transport,\n \tif (tags == TAGS_SET || tags == TAGS_DEFAULT) {\n \t\tmust_list_refs = 1;\n \t\tif (ref_prefixes.argc)\n-\t\t\targv_array_push(&ref_prefixes, \"refs/tags/\");\n+\t\t\tstrvec_push(&ref_prefixes, \"refs/tags/\");\n \t}\n \n \tif (must_list_refs) {\n@@ -1365,7 +1365,7 @@ static int do_fetch(struct transport *transport,\n \t} else\n \t\tremote_refs = NULL;\n \n-\targv_array_clear(&ref_prefixes);\n+\tstrvec_clear(&ref_prefixes);\n \n \tref_map = get_ref_map(transport->remote, remote_refs, rs,\n \t\t\t      tags, &autotags);\n@@ -1503,34 +1503,34 @@ static int add_remote_or_group(const char *name, struct string_list *list)\n \treturn 1;\n }\n \n-static void add_options_to_argv(struct argv_array *argv)\n+static void add_options_to_argv(struct strvec *argv)\n {\n \tif (dry_run)\n-\t\targv_array_push(argv, \"--dry-run\");\n+\t\tstrvec_push(argv, \"--dry-run\");\n \tif (prune != -1)\n-\t\targv_array_push(argv, prune ? \"--prune\" : \"--no-prune\");\n+\t\tstrvec_push(argv, prune ? \"--prune\" : \"--no-prune\");\n \tif (prune_tags != -1)\n-\t\targv_array_push(argv, prune_tags ? \"--prune-tags\" : \"--no-prune-tags\");\n+\t\tstrvec_push(argv, prune_tags ? \"--prune-tags\" : \"--no-prune-tags\");\n \tif (update_head_ok)\n-\t\targv_array_push(argv, \"--update-head-ok\");\n+\t\tstrvec_push(argv, \"--update-head-ok\");\n \tif (force)\n-\t\targv_array_push(argv, \"--force\");\n+\t\tstrvec_push(argv, \"--force\");\n \tif (keep)\n-\t\targv_array_push(argv, \"--keep\");\n+\t\tstrvec_push(argv, \"--keep\");\n \tif (recurse_submodules == RECURSE_SUBMODULES_ON)\n-\t\targv_array_push(argv, \"--recurse-submodules\");\n+\t\tstrvec_push(argv, \"--recurse-submodules\");\n \telse if (recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND)\n-\t\targv_array_push(argv, \"--recurse-submodules=on-demand\");\n+\t\tstrvec_push(argv, \"--recurse-submodules=on-demand\");\n \tif (tags == TAGS_SET)\n-\t\targv_array_push(argv, \"--tags\");\n+\t\tstrvec_push(argv, \"--tags\");\n \telse if (tags == TAGS_UNSET)\n-\t\targv_array_push(argv, \"--no-tags\");\n+\t\tstrvec_push(argv, \"--no-tags\");\n \tif (verbosity >= 2)\n-\t\targv_array_push(argv, \"-v\");\n+\t\tstrvec_push(argv, \"-v\");\n \tif (verbosity >= 1)\n-\t\targv_array_push(argv, \"-v\");\n+\t\tstrvec_push(argv, \"-v\");\n \telse if (verbosity < 0)\n-\t\targv_array_push(argv, \"-q\");\n+\t\tstrvec_push(argv, \"-q\");\n \n }\n \n@@ -1554,8 +1554,8 @@ static int fetch_next_remote(struct child_process *cp, struct strbuf *out,\n \tremote = state->remotes->items[state->next++].string;\n \t*task_cb = remote;\n \n-\targv_array_pushv(&cp->args, state->argv);\n-\targv_array_push(&cp->args, remote);\n+\tstrvec_pushv(&cp->args, state->argv);\n+\tstrvec_push(&cp->args, remote);\n \tcp->git_cmd = 1;\n \n \tif (verbosity >= 0)\n@@ -1592,22 +1592,22 @@ static int fetch_finished(int result, struct strbuf *out,\n static int fetch_multiple(struct string_list *list, int max_children)\n {\n \tint i, result = 0;\n-\tstruct argv_array argv = ARGV_ARRAY_INIT;\n+\tstruct strvec argv = STRVEC_INIT;\n \n \tif (!append && !dry_run) {\n \t\tint errcode = truncate_fetch_head();\n \t\tif (errcode)\n \t\t\treturn errcode;\n \t}\n \n-\targv_array_pushl(&argv, \"fetch\", \"--append\", \"--no-auto-gc\",\n+\tstrvec_pushl(&argv, \"fetch\", \"--append\", \"--no-auto-gc\",\n \t\t\t\"--no-write-commit-graph\", NULL);\n \tadd_options_to_argv(&argv);\n \n \tif (max_children != 1 && list->nr != 1) {\n \t\tstruct parallel_fetch_state state = { argv.argv, list, 0, 0 };\n \n-\t\targv_array_push(&argv, \"--end-of-options\");\n+\t\tstrvec_push(&argv, \"--end-of-options\");\n \t\tresult = run_processes_parallel_tr2(max_children,\n \t\t\t\t\t\t    &fetch_next_remote,\n \t\t\t\t\t\t    &fetch_failed_to_start,\n@@ -1620,17 +1620,17 @@ static int fetch_multiple(struct string_list *list, int max_children)\n \t} else\n \t\tfor (i = 0; i < list->nr; i++) {\n \t\t\tconst char *name = list->items[i].string;\n-\t\t\targv_array_push(&argv, name);\n+\t\t\tstrvec_push(&argv, name);\n \t\t\tif (verbosity >= 0)\n \t\t\t\tprintf(_(\"Fetching %s\\n\"), name);\n \t\t\tif (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {\n \t\t\t\terror(_(\"Could not fetch %s\"), name);\n \t\t\t\tresult = 1;\n \t\t\t}\n-\t\t\targv_array_pop(&argv);\n+\t\t\tstrvec_pop(&argv);\n \t\t}\n \n-\targv_array_clear(&argv);\n+\tstrvec_clear(&argv);\n \treturn !!result;\n }\n \n@@ -1844,7 +1844,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (!result && (recurse_submodules != RECURSE_SUBMODULES_OFF)) {\n-\t\tstruct argv_array options = ARGV_ARRAY_INIT;\n+\t\tstruct strvec options = STRVEC_INIT;\n \t\tint max_children = max_jobs;\n \n \t\tif (max_children < 0)\n@@ -1860,7 +1860,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n \t\t\t\t\t\t    recurse_submodules_default,\n \t\t\t\t\t\t    verbosity < 0,\n \t\t\t\t\t\t    max_children);\n-\t\targv_array_clear(&options);\n+\t\tstrvec_clear(&options);\n \t}\n \n \tstring_list_clear(&list, 0);\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 27951ee061..89742e159e 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -50,12 +50,12 @@ static const char *prune_worktrees_expire = \"3.months.ago\";\n static unsigned long big_pack_threshold;\n static unsigned long max_delta_cache_size = DEFAULT_DELTA_CACHE_SIZE;\n \n-static struct argv_array pack_refs_cmd = ARGV_ARRAY_INIT;\n-static struct argv_array reflog = ARGV_ARRAY_INIT;\n-static struct argv_array repack = ARGV_ARRAY_INIT;\n-static struct argv_array prune = ARGV_ARRAY_INIT;\n-static struct argv_array prune_worktrees = ARGV_ARRAY_INIT;\n-static struct argv_array rerere = ARGV_ARRAY_INIT;\n+static struct strvec pack_refs_cmd = STRVEC_INIT;\n+static struct strvec reflog = STRVEC_INIT;\n+static struct strvec repack = STRVEC_INIT;\n+static struct strvec prune = STRVEC_INIT;\n+static struct strvec prune_worktrees = STRVEC_INIT;\n+static struct strvec rerere = STRVEC_INIT;\n \n static struct tempfile *pidfile;\n static struct lock_file log_lock;\n@@ -311,18 +311,18 @@ static uint64_t estimate_repack_memory(struct packed_git *pack)\n \n static int keep_one_pack(struct string_list_item *item, void *data)\n {\n-\targv_array_pushf(&repack, \"--keep-pack=%s\", basename(item->string));\n+\tstrvec_pushf(&repack, \"--keep-pack=%s\", basename(item->string));\n \treturn 0;\n }\n \n static void add_repack_all_option(struct string_list *keep_pack)\n {\n \tif (prune_expire && !strcmp(prune_expire, \"now\"))\n-\t\targv_array_push(&repack, \"-a\");\n+\t\tstrvec_push(&repack, \"-a\");\n \telse {\n-\t\targv_array_push(&repack, \"-A\");\n+\t\tstrvec_push(&repack, \"-A\");\n \t\tif (prune_expire)\n-\t\t\targv_array_pushf(&repack, \"--unpack-unreachable=%s\", prune_expire);\n+\t\t\tstrvec_pushf(&repack, \"--unpack-unreachable=%s\", prune_expire);\n \t}\n \n \tif (keep_pack)\n@@ -331,7 +331,7 @@ static void add_repack_all_option(struct string_list *keep_pack)\n \n static void add_repack_incremental_option(void)\n {\n-\targv_array_push(&repack, \"--no-write-bitmap-index\");\n+\tstrvec_push(&repack, \"--no-write-bitmap-index\");\n }\n \n static int need_to_gc(void)\n@@ -552,12 +552,12 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \tif (argc == 2 && !strcmp(argv[1], \"-h\"))\n \t\tusage_with_options(builtin_gc_usage, builtin_gc_options);\n \n-\targv_array_pushl(&pack_refs_cmd, \"pack-refs\", \"--all\", \"--prune\", NULL);\n-\targv_array_pushl(&reflog, \"reflog\", \"expire\", \"--all\", NULL);\n-\targv_array_pushl(&repack, \"repack\", \"-d\", \"-l\", NULL);\n-\targv_array_pushl(&prune, \"prune\", \"--expire\", NULL);\n-\targv_array_pushl(&prune_worktrees, \"worktree\", \"prune\", \"--expire\", NULL);\n-\targv_array_pushl(&rerere, \"rerere\", \"gc\", NULL);\n+\tstrvec_pushl(&pack_refs_cmd, \"pack-refs\", \"--all\", \"--prune\", NULL);\n+\tstrvec_pushl(&reflog, \"reflog\", \"expire\", \"--all\", NULL);\n+\tstrvec_pushl(&repack, \"repack\", \"-d\", \"-l\", NULL);\n+\tstrvec_pushl(&prune, \"prune\", \"--expire\", NULL);\n+\tstrvec_pushl(&prune_worktrees, \"worktree\", \"prune\", \"--expire\", NULL);\n+\tstrvec_pushl(&rerere, \"rerere\", \"gc\", NULL);\n \n \t/* default expiry time, overwritten in gc_config */\n \tgc_config();\n@@ -576,14 +576,14 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \t\tdie(_(\"failed to parse prune expiry value %s\"), prune_expire);\n \n \tif (aggressive) {\n-\t\targv_array_push(&repack, \"-f\");\n+\t\tstrvec_push(&repack, \"-f\");\n \t\tif (aggressive_depth > 0)\n-\t\t\targv_array_pushf(&repack, \"--depth=%d\", aggressive_depth);\n+\t\t\tstrvec_pushf(&repack, \"--depth=%d\", aggressive_depth);\n \t\tif (aggressive_window > 0)\n-\t\t\targv_array_pushf(&repack, \"--window=%d\", aggressive_window);\n+\t\t\tstrvec_pushf(&repack, \"--window=%d\", aggressive_window);\n \t}\n \tif (quiet)\n-\t\targv_array_push(&repack, \"-q\");\n+\t\tstrvec_push(&repack, \"-q\");\n \n \tif (auto_gc) {\n \t\t/*\n@@ -657,19 +657,19 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \t\t\tdie(FAILED_RUN, repack.argv[0]);\n \n \t\tif (prune_expire) {\n-\t\t\targv_array_push(&prune, prune_expire);\n+\t\t\tstrvec_push(&prune, prune_expire);\n \t\t\tif (quiet)\n-\t\t\t\targv_array_push(&prune, \"--no-progress\");\n+\t\t\t\tstrvec_push(&prune, \"--no-progress\");\n \t\t\tif (has_promisor_remote())\n-\t\t\t\targv_array_push(&prune,\n+\t\t\t\tstrvec_push(&prune,\n \t\t\t\t\t\t\"--exclude-promisor-objects\");\n \t\t\tif (run_command_v_opt(prune.argv, RUN_GIT_CMD))\n \t\t\t\tdie(FAILED_RUN, prune.argv[0]);\n \t\t}\n \t}\n \n \tif (prune_worktrees_expire) {\n-\t\targv_array_push(&prune_worktrees, prune_worktrees_expire);\n+\t\tstrvec_push(&prune_worktrees, prune_worktrees_expire);\n \t\tif (run_command_v_opt(prune_worktrees.argv, RUN_GIT_CMD))\n \t\t\tdie(FAILED_RUN, prune_worktrees.argv[0]);\n \t}\ndiff --git a/builtin/grep.c b/builtin/grep.c\nindex a5056f395a..2ae77eb8b3 100644\n--- a/builtin/grep.c\n+++ b/builtin/grep.c\n@@ -397,7 +397,7 @@ static void run_pager(struct grep_opt *opt, const char *prefix)\n \tint i, status;\n \n \tfor (i = 0; i < path_list->nr; i++)\n-\t\targv_array_push(&child.args, path_list->items[i].string);\n+\t\tstrvec_push(&child.args, path_list->items[i].string);\n \tchild.dir = prefix;\n \tchild.use_shell = 1;\n \ndiff --git a/builtin/log.c b/builtin/log.c\nindex d104d5c688..33528fefa9 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -1128,18 +1128,18 @@ static void prepare_cover_text(struct pretty_print_context *pp,\n \n static int get_notes_refs(struct string_list_item *item, void *arg)\n {\n-\targv_array_pushf(arg, \"--notes=%s\", item->string);\n+\tstrvec_pushf(arg, \"--notes=%s\", item->string);\n \treturn 0;\n }\n \n-static void get_notes_args(struct argv_array *arg, struct rev_info *rev)\n+static void get_notes_args(struct strvec *arg, struct rev_info *rev)\n {\n \tif (!rev->show_notes) {\n-\t\targv_array_push(arg, \"--no-notes\");\n+\t\tstrvec_push(arg, \"--no-notes\");\n \t} else if (rev->notes_opt.use_default_notes > 0 ||\n \t\t   (rev->notes_opt.use_default_notes == -1 &&\n \t\t    !rev->notes_opt.extra_notes_refs.nr)) {\n-\t\targv_array_push(arg, \"--notes\");\n+\t\tstrvec_push(arg, \"--notes\");\n \t} else {\n \t\tfor_each_string_list(&rev->notes_opt.extra_notes_refs, get_notes_refs, arg);\n \t}\n@@ -1217,7 +1217,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,\n \t\t * can be added later if deemed desirable.\n \t\t */\n \t\tstruct diff_options opts;\n-\t\tstruct argv_array other_arg = ARGV_ARRAY_INIT;\n+\t\tstruct strvec other_arg = STRVEC_INIT;\n \t\tdiff_setup(&opts);\n \t\topts.file = rev->diffopt.file;\n \t\topts.use_color = rev->diffopt.use_color;\n@@ -1226,7 +1226,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,\n \t\tget_notes_args(&other_arg, rev);\n \t\tshow_range_diff(rev->rdiff1, rev->rdiff2,\n \t\t\t\trev->creation_factor, 1, &opts, &other_arg);\n-\t\targv_array_clear(&other_arg);\n+\t\tstrvec_clear(&other_arg);\n \t}\n }\n \ndiff --git a/builtin/ls-remote.c b/builtin/ls-remote.c\nindex 3a4dd12903..ea91679f33 100644\n--- a/builtin/ls-remote.c\n+++ b/builtin/ls-remote.c\n@@ -45,7 +45,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)\n \tint show_symref_target = 0;\n \tconst char *uploadpack = NULL;\n \tconst char **pattern = NULL;\n-\tstruct argv_array ref_prefixes = ARGV_ARRAY_INIT;\n+\tstruct strvec ref_prefixes = STRVEC_INIT;\n \tint i;\n \tstruct string_list server_options = STRING_LIST_INIT_DUP;\n \n@@ -92,9 +92,9 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (flags & REF_TAGS)\n-\t\targv_array_push(&ref_prefixes, \"refs/tags/\");\n+\t\tstrvec_push(&ref_prefixes, \"refs/tags/\");\n \tif (flags & REF_HEADS)\n-\t\targv_array_push(&ref_prefixes, \"refs/heads/\");\n+\t\tstrvec_push(&ref_prefixes, \"refs/heads/\");\n \n \tremote = remote_get(dest);\n \tif (!remote) {\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 5f18f0ee9d..323f8bce80 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -3439,7 +3439,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)\n \tint use_internal_rev_list = 0;\n \tint shallow = 0;\n \tint all_progress_implied = 0;\n-\tstruct argv_array rp = ARGV_ARRAY_INIT;\n+\tstruct strvec rp = STRVEC_INIT;\n \tint rev_list_unpacked = 0, rev_list_all = 0, rev_list_reflog = 0;\n \tint rev_list_index = 0;\n \tstruct string_list keep_pack_list = STRING_LIST_INIT_NODUP;\n@@ -3575,36 +3575,36 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)\n \t\tcache_max_small_delta_size = (1U << OE_Z_DELTA_BITS) - 1;\n \t}\n \n-\targv_array_push(&rp, \"pack-objects\");\n+\tstrvec_push(&rp, \"pack-objects\");\n \tif (thin) {\n \t\tuse_internal_rev_list = 1;\n-\t\targv_array_push(&rp, shallow\n+\t\tstrvec_push(&rp, shallow\n \t\t\t\t? \"--objects-edge-aggressive\"\n \t\t\t\t: \"--objects-edge\");\n \t} else\n-\t\targv_array_push(&rp, \"--objects\");\n+\t\tstrvec_push(&rp, \"--objects\");\n \n \tif (rev_list_all) {\n \t\tuse_internal_rev_list = 1;\n-\t\targv_array_push(&rp, \"--all\");\n+\t\tstrvec_push(&rp, \"--all\");\n \t}\n \tif (rev_list_reflog) {\n \t\tuse_internal_rev_list = 1;\n-\t\targv_array_push(&rp, \"--reflog\");\n+\t\tstrvec_push(&rp, \"--reflog\");\n \t}\n \tif (rev_list_index) {\n \t\tuse_internal_rev_list = 1;\n-\t\targv_array_push(&rp, \"--indexed-objects\");\n+\t\tstrvec_push(&rp, \"--indexed-objects\");\n \t}\n \tif (rev_list_unpacked) {\n \t\tuse_internal_rev_list = 1;\n-\t\targv_array_push(&rp, \"--unpacked\");\n+\t\tstrvec_push(&rp, \"--unpacked\");\n \t}\n \n \tif (exclude_promisor_objects) {\n \t\tuse_internal_rev_list = 1;\n \t\tfetch_if_missing = 0;\n-\t\targv_array_push(&rp, \"--exclude-promisor-objects\");\n+\t\tstrvec_push(&rp, \"--exclude-promisor-objects\");\n \t}\n \tif (unpack_unreachable || keep_unreachable || pack_loose_unreachable)\n \t\tuse_internal_rev_list = 1;\n@@ -3666,7 +3666,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)\n \t\twrite_bitmap_index = 0;\n \n \tif (use_delta_islands)\n-\t\targv_array_push(&rp, \"--topo-order\");\n+\t\tstrvec_push(&rp, \"--topo-order\");\n \n \tif (progress && all_progress_implied)\n \t\tprogress = 2;\n@@ -3705,7 +3705,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)\n \t\tread_object_list_from_stdin();\n \telse {\n \t\tget_object_list(rp.argc, rp.argv);\n-\t\targv_array_clear(&rp);\n+\t\tstrvec_clear(&rp);\n \t}\n \tcleanup_preferred_base();\n \tif (include_tag && nr_result)\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex 8159c5d7c9..8a8d30e1dc 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -87,8 +87,8 @@ static char *opt_verify_signatures;\n static int opt_autostash = -1;\n static int config_autostash;\n static int check_trust_level = 1;\n-static struct argv_array opt_strategies = ARGV_ARRAY_INIT;\n-static struct argv_array opt_strategy_opts = ARGV_ARRAY_INIT;\n+static struct strvec opt_strategies = STRVEC_INIT;\n+static struct strvec opt_strategy_opts = STRVEC_INIT;\n static char *opt_gpg_sign;\n static int opt_allow_unrelated_histories;\n \n@@ -110,7 +110,7 @@ static char *opt_ipv4;\n static char *opt_ipv6;\n static int opt_show_forced_updates = -1;\n static char *set_upstream;\n-static struct argv_array opt_fetch = ARGV_ARRAY_INIT;\n+static struct strvec opt_fetch = STRVEC_INIT;\n \n static struct option pull_options[] = {\n \t/* Shared options */\n@@ -251,25 +251,25 @@ static struct option pull_options[] = {\n /**\n  * Pushes \"-q\" or \"-v\" switches into arr to match the opt_verbosity level.\n  */\n-static void argv_push_verbosity(struct argv_array *arr)\n+static void argv_push_verbosity(struct strvec *arr)\n {\n \tint verbosity;\n \n \tfor (verbosity = opt_verbosity; verbosity > 0; verbosity--)\n-\t\targv_array_push(arr, \"-v\");\n+\t\tstrvec_push(arr, \"-v\");\n \n \tfor (verbosity = opt_verbosity; verbosity < 0; verbosity++)\n-\t\targv_array_push(arr, \"-q\");\n+\t\tstrvec_push(arr, \"-q\");\n }\n \n /**\n  * Pushes \"-f\" switches into arr to match the opt_force level.\n  */\n-static void argv_push_force(struct argv_array *arr)\n+static void argv_push_force(struct strvec *arr)\n {\n \tint force = opt_force;\n \twhile (force-- > 0)\n-\t\targv_array_push(arr, \"-f\");\n+\t\tstrvec_push(arr, \"-f\");\n }\n \n /**\n@@ -524,75 +524,75 @@ static void parse_repo_refspecs(int argc, const char **argv, const char **repo,\n  */\n static int run_fetch(const char *repo, const char **refspecs)\n {\n-\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\tstruct strvec args = STRVEC_INIT;\n \tint ret;\n \n-\targv_array_pushl(&args, \"fetch\", \"--update-head-ok\", NULL);\n+\tstrvec_pushl(&args, \"fetch\", \"--update-head-ok\", NULL);\n \n \t/* Shared options */\n \targv_push_verbosity(&args);\n \tif (opt_progress)\n-\t\targv_array_push(&args, opt_progress);\n+\t\tstrvec_push(&args, opt_progress);\n \n \t/* Options passed to git-fetch */\n \tif (opt_all)\n-\t\targv_array_push(&args, opt_all);\n+\t\tstrvec_push(&args, opt_all);\n \tif (opt_append)\n-\t\targv_array_push(&args, opt_append);\n+\t\tstrvec_push(&args, opt_append);\n \tif (opt_upload_pack)\n-\t\targv_array_push(&args, opt_upload_pack);\n+\t\tstrvec_push(&args, opt_upload_pack);\n \targv_push_force(&args);\n \tif (opt_tags)\n-\t\targv_array_push(&args, opt_tags);\n+\t\tstrvec_push(&args, opt_tags);\n \tif (opt_prune)\n-\t\targv_array_push(&args, opt_prune);\n+\t\tstrvec_push(&args, opt_prune);\n \tif (recurse_submodules != RECURSE_SUBMODULES_DEFAULT)\n \t\tswitch (recurse_submodules) {\n \t\tcase RECURSE_SUBMODULES_ON:\n-\t\t\targv_array_push(&args, \"--recurse-submodules=on\");\n+\t\t\tstrvec_push(&args, \"--recurse-submodules=on\");\n \t\t\tbreak;\n \t\tcase RECURSE_SUBMODULES_OFF:\n-\t\t\targv_array_push(&args, \"--recurse-submodules=no\");\n+\t\t\tstrvec_push(&args, \"--recurse-submodules=no\");\n \t\t\tbreak;\n \t\tcase RECURSE_SUBMODULES_ON_DEMAND:\n-\t\t\targv_array_push(&args, \"--recurse-submodules=on-demand\");\n+\t\t\tstrvec_push(&args, \"--recurse-submodules=on-demand\");\n \t\t\tbreak;\n \t\tdefault:\n \t\t\tBUG(\"submodule recursion option not understood\");\n \t\t}\n \tif (max_children)\n-\t\targv_array_push(&args, max_children);\n+\t\tstrvec_push(&args, max_children);\n \tif (opt_dry_run)\n-\t\targv_array_push(&args, \"--dry-run\");\n+\t\tstrvec_push(&args, \"--dry-run\");\n \tif (opt_keep)\n-\t\targv_array_push(&args, opt_keep);\n+\t\tstrvec_push(&args, opt_keep);\n \tif (opt_depth)\n-\t\targv_array_push(&args, opt_depth);\n+\t\tstrvec_push(&args, opt_depth);\n \tif (opt_unshallow)\n-\t\targv_array_push(&args, opt_unshallow);\n+\t\tstrvec_push(&args, opt_unshallow);\n \tif (opt_update_shallow)\n-\t\targv_array_push(&args, opt_update_shallow);\n+\t\tstrvec_push(&args, opt_update_shallow);\n \tif (opt_refmap)\n-\t\targv_array_push(&args, opt_refmap);\n+\t\tstrvec_push(&args, opt_refmap);\n \tif (opt_ipv4)\n-\t\targv_array_push(&args, opt_ipv4);\n+\t\tstrvec_push(&args, opt_ipv4);\n \tif (opt_ipv6)\n-\t\targv_array_push(&args, opt_ipv6);\n+\t\tstrvec_push(&args, opt_ipv6);\n \tif (opt_show_forced_updates > 0)\n-\t\targv_array_push(&args, \"--show-forced-updates\");\n+\t\tstrvec_push(&args, \"--show-forced-updates\");\n \telse if (opt_show_forced_updates == 0)\n-\t\targv_array_push(&args, \"--no-show-forced-updates\");\n+\t\tstrvec_push(&args, \"--no-show-forced-updates\");\n \tif (set_upstream)\n-\t\targv_array_push(&args, set_upstream);\n-\targv_array_pushv(&args, opt_fetch.argv);\n+\t\tstrvec_push(&args, set_upstream);\n+\tstrvec_pushv(&args, opt_fetch.argv);\n \n \tif (repo) {\n-\t\targv_array_push(&args, repo);\n-\t\targv_array_pushv(&args, refspecs);\n+\t\tstrvec_push(&args, repo);\n+\t\tstrvec_pushv(&args, refspecs);\n \t} else if (*refspecs)\n \t\tBUG(\"refspecs without repo?\");\n \tret = run_command_v_opt(args.argv, RUN_GIT_CMD);\n-\targv_array_clear(&args);\n+\tstrvec_clear(&args);\n \treturn ret;\n }\n \n@@ -637,7 +637,7 @@ static int rebase_submodules(void)\n \n \tcp.git_cmd = 1;\n \tcp.no_stdin = 1;\n-\targv_array_pushl(&cp.args, \"submodule\", \"update\",\n+\tstrvec_pushl(&cp.args, \"submodule\", \"update\",\n \t\t\t\t   \"--recursive\", \"--rebase\", NULL);\n \targv_push_verbosity(&cp.args);\n \n@@ -650,7 +650,7 @@ static int update_submodules(void)\n \n \tcp.git_cmd = 1;\n \tcp.no_stdin = 1;\n-\targv_array_pushl(&cp.args, \"submodule\", \"update\",\n+\tstrvec_pushl(&cp.args, \"submodule\", \"update\",\n \t\t\t\t   \"--recursive\", \"--checkout\", NULL);\n \targv_push_verbosity(&cp.args);\n \n@@ -663,48 +663,48 @@ static int update_submodules(void)\n static int run_merge(void)\n {\n \tint ret;\n-\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\tstruct strvec args = STRVEC_INIT;\n \n-\targv_array_pushl(&args, \"merge\", NULL);\n+\tstrvec_pushl(&args, \"merge\", NULL);\n \n \t/* Shared options */\n \targv_push_verbosity(&args);\n \tif (opt_progress)\n-\t\targv_array_push(&args, opt_progress);\n+\t\tstrvec_push(&args, opt_progress);\n \n \t/* Options passed to git-merge */\n \tif (opt_diffstat)\n-\t\targv_array_push(&args, opt_diffstat);\n+\t\tstrvec_push(&args, opt_diffstat);\n \tif (opt_log)\n-\t\targv_array_push(&args, opt_log);\n+\t\tstrvec_push(&args, opt_log);\n \tif (opt_signoff)\n-\t\targv_array_push(&args, opt_signoff);\n+\t\tstrvec_push(&args, opt_signoff);\n \tif (opt_squash)\n-\t\targv_array_push(&args, opt_squash);\n+\t\tstrvec_push(&args, opt_squash);\n \tif (opt_commit)\n-\t\targv_array_push(&args, opt_commit);\n+\t\tstrvec_push(&args, opt_commit);\n \tif (opt_edit)\n-\t\targv_array_push(&args, opt_edit);\n+\t\tstrvec_push(&args, opt_edit);\n \tif (cleanup_arg)\n-\t\targv_array_pushf(&args, \"--cleanup=%s\", cleanup_arg);\n+\t\tstrvec_pushf(&args, \"--cleanup=%s\", cleanup_arg);\n \tif (opt_ff)\n-\t\targv_array_push(&args, opt_ff);\n+\t\tstrvec_push(&args, opt_ff);\n \tif (opt_verify_signatures)\n-\t\targv_array_push(&args, opt_verify_signatures);\n-\targv_array_pushv(&args, opt_strategies.argv);\n-\targv_array_pushv(&args, opt_strategy_opts.argv);\n+\t\tstrvec_push(&args, opt_verify_signatures);\n+\tstrvec_pushv(&args, opt_strategies.argv);\n+\tstrvec_pushv(&args, opt_strategy_opts.argv);\n \tif (opt_gpg_sign)\n-\t\targv_array_push(&args, opt_gpg_sign);\n+\t\tstrvec_push(&args, opt_gpg_sign);\n \tif (opt_autostash == 0)\n-\t\targv_array_push(&args, \"--no-autostash\");\n+\t\tstrvec_push(&args, \"--no-autostash\");\n \telse if (opt_autostash == 1)\n-\t\targv_array_push(&args, \"--autostash\");\n+\t\tstrvec_push(&args, \"--autostash\");\n \tif (opt_allow_unrelated_histories > 0)\n-\t\targv_array_push(&args, \"--allow-unrelated-histories\");\n+\t\tstrvec_push(&args, \"--allow-unrelated-histories\");\n \n-\targv_array_push(&args, \"FETCH_HEAD\");\n+\tstrvec_push(&args, \"FETCH_HEAD\");\n \tret = run_command_v_opt(args.argv, RUN_GIT_CMD);\n-\targv_array_clear(&args);\n+\tstrvec_clear(&args);\n \treturn ret;\n }\n \n@@ -801,7 +801,7 @@ static int get_rebase_fork_point(struct object_id *fork_point, const char *repo,\n \tif (!remote_branch)\n \t\treturn -1;\n \n-\targv_array_pushl(&cp.args, \"merge-base\", \"--fork-point\",\n+\tstrvec_pushl(&cp.args, \"merge-base\", \"--fork-point\",\n \t\t\tremote_branch, curr_branch->name, NULL);\n \tcp.no_stdin = 1;\n \tcp.no_stderr = 1;\n@@ -862,48 +862,48 @@ static int run_rebase(const struct object_id *curr_head,\n {\n \tint ret;\n \tstruct object_id oct_merge_base;\n-\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\tstruct strvec args = STRVEC_INIT;\n \n \tif (!get_octopus_merge_base(&oct_merge_base, curr_head, merge_head, fork_point))\n \t\tif (!is_null_oid(fork_point) && oideq(&oct_merge_base, fork_point))\n \t\t\tfork_point = NULL;\n \n-\targv_array_push(&args, \"rebase\");\n+\tstrvec_push(&args, \"rebase\");\n \n \t/* Shared options */\n \targv_push_verbosity(&args);\n \n \t/* Options passed to git-rebase */\n \tif (opt_rebase == REBASE_MERGES)\n-\t\targv_array_push(&args, \"--rebase-merges\");\n+\t\tstrvec_push(&args, \"--rebase-merges\");\n \telse if (opt_rebase == REBASE_PRESERVE)\n-\t\targv_array_push(&args, \"--preserve-merges\");\n+\t\tstrvec_push(&args, \"--preserve-merges\");\n \telse if (opt_rebase == REBASE_INTERACTIVE)\n-\t\targv_array_push(&args, \"--interactive\");\n+\t\tstrvec_push(&args, \"--interactive\");\n \tif (opt_diffstat)\n-\t\targv_array_push(&args, opt_diffstat);\n-\targv_array_pushv(&args, opt_strategies.argv);\n-\targv_array_pushv(&args, opt_strategy_opts.argv);\n+\t\tstrvec_push(&args, opt_diffstat);\n+\tstrvec_pushv(&args, opt_strategies.argv);\n+\tstrvec_pushv(&args, opt_strategy_opts.argv);\n \tif (opt_gpg_sign)\n-\t\targv_array_push(&args, opt_gpg_sign);\n+\t\tstrvec_push(&args, opt_gpg_sign);\n \tif (opt_autostash == 0)\n-\t\targv_array_push(&args, \"--no-autostash\");\n+\t\tstrvec_push(&args, \"--no-autostash\");\n \telse if (opt_autostash == 1)\n-\t\targv_array_push(&args, \"--autostash\");\n+\t\tstrvec_push(&args, \"--autostash\");\n \tif (opt_verify_signatures &&\n \t    !strcmp(opt_verify_signatures, \"--verify-signatures\"))\n \t\twarning(_(\"ignoring --verify-signatures for rebase\"));\n \n-\targv_array_push(&args, \"--onto\");\n-\targv_array_push(&args, oid_to_hex(merge_head));\n+\tstrvec_push(&args, \"--onto\");\n+\tstrvec_push(&args, oid_to_hex(merge_head));\n \n \tif (fork_point && !is_null_oid(fork_point))\n-\t\targv_array_push(&args, oid_to_hex(fork_point));\n+\t\tstrvec_push(&args, oid_to_hex(fork_point));\n \telse\n-\t\targv_array_push(&args, oid_to_hex(merge_head));\n+\t\tstrvec_push(&args, oid_to_hex(merge_head));\n \n \tret = run_command_v_opt(args.argv, RUN_GIT_CMD);\n-\targv_array_clear(&args);\n+\tstrvec_clear(&args);\n \treturn ret;\n }\n \ndiff --git a/builtin/range-diff.c b/builtin/range-diff.c\nindex d8a4670629..24c4162f74 100644\n--- a/builtin/range-diff.c\n+++ b/builtin/range-diff.c\n@@ -15,7 +15,7 @@ int cmd_range_diff(int argc, const char **argv, const char *prefix)\n {\n \tint creation_factor = RANGE_DIFF_CREATION_FACTOR_DEFAULT;\n \tstruct diff_options diffopt = { NULL };\n-\tstruct argv_array other_arg = ARGV_ARRAY_INIT;\n+\tstruct strvec other_arg = STRVEC_INIT;\n \tint simple_color = -1;\n \tstruct option range_diff_options[] = {\n \t\tOPT_INTEGER(0, \"creation-factor\", &creation_factor,\n@@ -84,7 +84,7 @@ int cmd_range_diff(int argc, const char **argv, const char *prefix)\n \tres = show_range_diff(range1.buf, range2.buf, creation_factor,\n \t\t\t      simple_color < 1, &diffopt, &other_arg);\n \n-\targv_array_clear(&other_arg);\n+\tstrvec_clear(&other_arg);\n \tstrbuf_release(&range1);\n \tstrbuf_release(&range2);\n \ndiff --git a/builtin/rebase.c b/builtin/rebase.c\nindex 38145a66ed..fb56b9e263 100644\n--- a/builtin/rebase.c\n+++ b/builtin/rebase.c\n@@ -84,7 +84,7 @@ struct rebase_options {\n \t\tREBASE_FORCE = 1<<3,\n \t\tREBASE_INTERACTIVE_EXPLICIT = 1<<4,\n \t} flags;\n-\tstruct argv_array git_am_opts;\n+\tstruct strvec git_am_opts;\n \tconst char *action;\n \tint signoff;\n \tint allow_rerere_autoupdate;\n@@ -108,7 +108,7 @@ struct rebase_options {\n \t\t.keep_empty = 1,\t\t\t\\\n \t\t.default_backend = \"merge\",\t  \t\\\n \t\t.flags = REBASE_NO_QUIET, \t\t\\\n-\t\t.git_am_opts = ARGV_ARRAY_INIT,\t\t\\\n+\t\t.git_am_opts = STRVEC_INIT,\t\t\\\n \t\t.git_format_patch_opt = STRBUF_INIT\t\\\n \t}\n \n@@ -323,7 +323,7 @@ static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)\n \tint ret;\n \tconst char *head_hash = NULL;\n \tchar *revisions = NULL, *shortrevisions = NULL;\n-\tstruct argv_array make_script_args = ARGV_ARRAY_INIT;\n+\tstruct strvec make_script_args = STRVEC_INIT;\n \tstruct todo_list todo_list = TODO_LIST_INIT;\n \tstruct replay_opts replay = get_replay_opts(opts);\n \tstruct string_list commands = STRING_LIST_INIT_DUP;\n@@ -345,9 +345,9 @@ static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)\n \t\twrite_file(path_squash_onto(), \"%s\\n\",\n \t\t\t   oid_to_hex(opts->squash_onto));\n \n-\targv_array_pushl(&make_script_args, \"\", revisions, NULL);\n+\tstrvec_pushl(&make_script_args, \"\", revisions, NULL);\n \tif (opts->restrict_revision)\n-\t\targv_array_pushf(&make_script_args, \"^%s\",\n+\t\tstrvec_pushf(&make_script_args, \"^%s\",\n \t\t\t\t oid_to_hex(&opts->restrict_revision->object.oid));\n \n \tret = sequencer_make_script(the_repository, &todo_list.buf,\n@@ -372,7 +372,7 @@ static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)\n \tfree(revisions);\n \tfree(shortrevisions);\n \ttodo_list_release(&todo_list);\n-\targv_array_clear(&make_script_args);\n+\tstrvec_clear(&make_script_args);\n \n \treturn ret;\n }\n@@ -420,7 +420,7 @@ static int run_sequencer_rebase(struct rebase_options *opts,\n \t\tstruct child_process cmd = CHILD_PROCESS_INIT;\n \n \t\tcmd.git_cmd = 1;\n-\t\targv_array_pushl(&cmd.args, \"show\", \"REBASE_HEAD\", \"--\", NULL);\n+\t\tstrvec_pushl(&cmd.args, \"show\", \"REBASE_HEAD\", \"--\", NULL);\n \t\tret = run_command(&cmd);\n \n \t\tbreak;\n@@ -811,30 +811,30 @@ static int run_am(struct rebase_options *opts)\n \tchar *rebased_patches;\n \n \tam.git_cmd = 1;\n-\targv_array_push(&am.args, \"am\");\n+\tstrvec_push(&am.args, \"am\");\n \n \tif (opts->action && !strcmp(\"continue\", opts->action)) {\n-\t\targv_array_push(&am.args, \"--resolved\");\n-\t\targv_array_pushf(&am.args, \"--resolvemsg=%s\", resolvemsg);\n+\t\tstrvec_push(&am.args, \"--resolved\");\n+\t\tstrvec_pushf(&am.args, \"--resolvemsg=%s\", resolvemsg);\n \t\tif (opts->gpg_sign_opt)\n-\t\t\targv_array_push(&am.args, opts->gpg_sign_opt);\n+\t\t\tstrvec_push(&am.args, opts->gpg_sign_opt);\n \t\tstatus = run_command(&am);\n \t\tif (status)\n \t\t\treturn status;\n \n \t\treturn move_to_original_branch(opts);\n \t}\n \tif (opts->action && !strcmp(\"skip\", opts->action)) {\n-\t\targv_array_push(&am.args, \"--skip\");\n-\t\targv_array_pushf(&am.args, \"--resolvemsg=%s\", resolvemsg);\n+\t\tstrvec_push(&am.args, \"--skip\");\n+\t\tstrvec_pushf(&am.args, \"--resolvemsg=%s\", resolvemsg);\n \t\tstatus = run_command(&am);\n \t\tif (status)\n \t\t\treturn status;\n \n \t\treturn move_to_original_branch(opts);\n \t}\n \tif (opts->action && !strcmp(\"show-current-patch\", opts->action)) {\n-\t\targv_array_push(&am.args, \"--show-current-patch\");\n+\t\tstrvec_push(&am.args, \"--show-current-patch\");\n \t\treturn run_command(&am);\n \t}\n \n@@ -852,29 +852,29 @@ static int run_am(struct rebase_options *opts)\n \t\tstatus = error_errno(_(\"could not open '%s' for writing\"),\n \t\t\t\t     rebased_patches);\n \t\tfree(rebased_patches);\n-\t\targv_array_clear(&am.args);\n+\t\tstrvec_clear(&am.args);\n \t\treturn status;\n \t}\n \n \tformat_patch.git_cmd = 1;\n-\targv_array_pushl(&format_patch.args, \"format-patch\", \"-k\", \"--stdout\",\n+\tstrvec_pushl(&format_patch.args, \"format-patch\", \"-k\", \"--stdout\",\n \t\t\t \"--full-index\", \"--cherry-pick\", \"--right-only\",\n \t\t\t \"--src-prefix=a/\", \"--dst-prefix=b/\", \"--no-renames\",\n \t\t\t \"--no-cover-letter\", \"--pretty=mboxrd\", \"--topo-order\",\n \t\t\t \"--no-base\", NULL);\n \tif (opts->git_format_patch_opt.len)\n-\t\targv_array_split(&format_patch.args,\n+\t\tstrvec_split(&format_patch.args,\n \t\t\t\t opts->git_format_patch_opt.buf);\n-\targv_array_push(&format_patch.args, revisions.buf);\n+\tstrvec_push(&format_patch.args, revisions.buf);\n \tif (opts->restrict_revision)\n-\t\targv_array_pushf(&format_patch.args, \"^%s\",\n+\t\tstrvec_pushf(&format_patch.args, \"^%s\",\n \t\t\t\t oid_to_hex(&opts->restrict_revision->object.oid));\n \n \tstatus = run_command(&format_patch);\n \tif (status) {\n \t\tunlink(rebased_patches);\n \t\tfree(rebased_patches);\n-\t\targv_array_clear(&am.args);\n+\t\tstrvec_clear(&am.args);\n \n \t\treset_head(the_repository, &opts->orig_head, \"checkout\",\n \t\t\t   opts->head_name, 0,\n@@ -896,20 +896,20 @@ static int run_am(struct rebase_options *opts)\n \t\tstatus = error_errno(_(\"could not open '%s' for reading\"),\n \t\t\t\t     rebased_patches);\n \t\tfree(rebased_patches);\n-\t\targv_array_clear(&am.args);\n+\t\tstrvec_clear(&am.args);\n \t\treturn status;\n \t}\n \n-\targv_array_pushv(&am.args, opts->git_am_opts.argv);\n-\targv_array_push(&am.args, \"--rebasing\");\n-\targv_array_pushf(&am.args, \"--resolvemsg=%s\", resolvemsg);\n-\targv_array_push(&am.args, \"--patch-format=mboxrd\");\n+\tstrvec_pushv(&am.args, opts->git_am_opts.argv);\n+\tstrvec_push(&am.args, \"--rebasing\");\n+\tstrvec_pushf(&am.args, \"--resolvemsg=%s\", resolvemsg);\n+\tstrvec_push(&am.args, \"--patch-format=mboxrd\");\n \tif (opts->allow_rerere_autoupdate == RERERE_AUTOUPDATE)\n-\t\targv_array_push(&am.args, \"--rerere-autoupdate\");\n+\t\tstrvec_push(&am.args, \"--rerere-autoupdate\");\n \telse if (opts->allow_rerere_autoupdate == RERERE_NOAUTOUPDATE)\n-\t\targv_array_push(&am.args, \"--no-rerere-autoupdate\");\n+\t\tstrvec_push(&am.args, \"--no-rerere-autoupdate\");\n \tif (opts->gpg_sign_opt)\n-\t\targv_array_push(&am.args, opts->gpg_sign_opt);\n+\t\tstrvec_push(&am.args, opts->gpg_sign_opt);\n \tstatus = run_command(&am);\n \tunlink(rebased_patches);\n \tfree(rebased_patches);\n@@ -1649,7 +1649,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)\n \t\t\texit(1);\n \n \tif (!(options.flags & REBASE_NO_QUIET))\n-\t\targv_array_push(&options.git_am_opts, \"-q\");\n+\t\tstrvec_push(&options.git_am_opts, \"-q\");\n \n \tif (options.empty != EMPTY_UNSPECIFIED)\n \t\timply_merge(&options, \"--empty\");\n@@ -1776,7 +1776,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)\n \t\tif (options.type == REBASE_PRESERVE_MERGES)\n \t\t\tdie(\"cannot combine '--signoff' with \"\n \t\t\t    \"'--preserve-merges'\");\n-\t\targv_array_push(&options.git_am_opts, \"--signoff\");\n+\t\tstrvec_push(&options.git_am_opts, \"--signoff\");\n \t\toptions.flags |= REBASE_FORCE;\n \t}\n \ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex 1285631481..71274231aa 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -667,23 +667,23 @@ static void prepare_push_cert_sha1(struct child_process *proc)\n \t\tnonce_status = check_nonce(push_cert.buf, bogs);\n \t}\n \tif (!is_null_oid(&push_cert_oid)) {\n-\t\targv_array_pushf(&proc->env_array, \"GIT_PUSH_CERT=%s\",\n+\t\tstrvec_pushf(&proc->env_array, \"GIT_PUSH_CERT=%s\",\n \t\t\t\t oid_to_hex(&push_cert_oid));\n-\t\targv_array_pushf(&proc->env_array, \"GIT_PUSH_CERT_SIGNER=%s\",\n+\t\tstrvec_pushf(&proc->env_array, \"GIT_PUSH_CERT_SIGNER=%s\",\n \t\t\t\t sigcheck.signer ? sigcheck.signer : \"\");\n-\t\targv_array_pushf(&proc->env_array, \"GIT_PUSH_CERT_KEY=%s\",\n+\t\tstrvec_pushf(&proc->env_array, \"GIT_PUSH_CERT_KEY=%s\",\n \t\t\t\t sigcheck.key ? sigcheck.key : \"\");\n-\t\targv_array_pushf(&proc->env_array, \"GIT_PUSH_CERT_STATUS=%c\",\n+\t\tstrvec_pushf(&proc->env_array, \"GIT_PUSH_CERT_STATUS=%c\",\n \t\t\t\t sigcheck.result);\n \t\tif (push_cert_nonce) {\n-\t\t\targv_array_pushf(&proc->env_array,\n+\t\t\tstrvec_pushf(&proc->env_array,\n \t\t\t\t\t \"GIT_PUSH_CERT_NONCE=%s\",\n \t\t\t\t\t push_cert_nonce);\n-\t\t\targv_array_pushf(&proc->env_array,\n+\t\t\tstrvec_pushf(&proc->env_array,\n \t\t\t\t\t \"GIT_PUSH_CERT_NONCE_STATUS=%s\",\n \t\t\t\t\t nonce_status);\n \t\t\tif (nonce_status == NONCE_SLOP)\n-\t\t\t\targv_array_pushf(&proc->env_array,\n+\t\t\t\tstrvec_pushf(&proc->env_array,\n \t\t\t\t\t\t \"GIT_PUSH_CERT_NONCE_SLOP=%ld\",\n \t\t\t\t\t\t nonce_stamp_slop);\n \t\t}\n@@ -720,16 +720,16 @@ static int run_and_feed_hook(const char *hook_name, feed_fn feed,\n \tif (feed_state->push_options) {\n \t\tint i;\n \t\tfor (i = 0; i < feed_state->push_options->nr; i++)\n-\t\t\targv_array_pushf(&proc.env_array,\n+\t\t\tstrvec_pushf(&proc.env_array,\n \t\t\t\t\"GIT_PUSH_OPTION_%d=%s\", i,\n \t\t\t\tfeed_state->push_options->items[i].string);\n-\t\targv_array_pushf(&proc.env_array, \"GIT_PUSH_OPTION_COUNT=%d\",\n+\t\tstrvec_pushf(&proc.env_array, \"GIT_PUSH_OPTION_COUNT=%d\",\n \t\t\t\t feed_state->push_options->nr);\n \t} else\n-\t\targv_array_pushf(&proc.env_array, \"GIT_PUSH_OPTION_COUNT\");\n+\t\tstrvec_pushf(&proc.env_array, \"GIT_PUSH_OPTION_COUNT\");\n \n \tif (tmp_objdir)\n-\t\targv_array_pushv(&proc.env_array, tmp_objdir_env(tmp_objdir));\n+\t\tstrvec_pushv(&proc.env_array, tmp_objdir_env(tmp_objdir));\n \n \tif (use_sideband) {\n \t\tmemset(&muxer, 0, sizeof(muxer));\n@@ -931,7 +931,7 @@ static int head_has_history(void)\n }\n \n static const char *push_to_deploy(unsigned char *sha1,\n-\t\t\t\t  struct argv_array *env,\n+\t\t\t\t  struct strvec *env,\n \t\t\t\t  const char *work_tree)\n {\n \tconst char *update_refresh[] = {\n@@ -1000,10 +1000,10 @@ static const char *push_to_deploy(unsigned char *sha1,\n static const char *push_to_checkout_hook = \"push-to-checkout\";\n \n static const char *push_to_checkout(unsigned char *hash,\n-\t\t\t\t    struct argv_array *env,\n+\t\t\t\t    struct strvec *env,\n \t\t\t\t    const char *work_tree)\n {\n-\targv_array_pushf(env, \"GIT_WORK_TREE=%s\", absolute_path(work_tree));\n+\tstrvec_pushf(env, \"GIT_WORK_TREE=%s\", absolute_path(work_tree));\n \tif (run_hook_le(env->argv, push_to_checkout_hook,\n \t\t\thash_to_hex(hash), NULL))\n \t\treturn \"push-to-checkout hook declined\";\n@@ -1014,7 +1014,7 @@ static const char *push_to_checkout(unsigned char *hash,\n static const char *update_worktree(unsigned char *sha1, const struct worktree *worktree)\n {\n \tconst char *retval, *work_tree, *git_dir = NULL;\n-\tstruct argv_array env = ARGV_ARRAY_INIT;\n+\tstruct strvec env = STRVEC_INIT;\n \n \tif (worktree && worktree->path)\n \t\twork_tree = worktree->path;\n@@ -1030,14 +1030,14 @@ static const char *update_worktree(unsigned char *sha1, const struct worktree *w\n \tif (!git_dir)\n \t\tgit_dir = get_git_dir();\n \n-\targv_array_pushf(&env, \"GIT_DIR=%s\", absolute_path(git_dir));\n+\tstrvec_pushf(&env, \"GIT_DIR=%s\", absolute_path(git_dir));\n \n \tif (!find_hook(push_to_checkout_hook))\n \t\tretval = push_to_deploy(sha1, &env, work_tree);\n \telse\n \t\tretval = push_to_checkout(sha1, &env, work_tree);\n \n-\targv_array_clear(&env);\n+\tstrvec_clear(&env);\n \treturn retval;\n }\n \n@@ -1206,8 +1206,8 @@ static void run_update_post_hook(struct command *commands)\n \t\tif (cmd->error_string || cmd->did_not_exist)\n \t\t\tcontinue;\n \t\tif (!proc.args.argc)\n-\t\t\targv_array_push(&proc.args, hook);\n-\t\targv_array_push(&proc.args, cmd->ref_name);\n+\t\t\tstrvec_push(&proc.args, hook);\n+\t\tstrvec_push(&proc.args, cmd->ref_name);\n \t}\n \tif (!proc.args.argc)\n \t\treturn;\n@@ -1715,9 +1715,9 @@ static const char *parse_pack_header(struct pack_header *hdr)\n \n static const char *pack_lockfile;\n \n-static void push_header_arg(struct argv_array *args, struct pack_header *hdr)\n+static void push_header_arg(struct strvec *args, struct pack_header *hdr)\n {\n-\targv_array_pushf(args, \"--pack_header=%\"PRIu32\",%\"PRIu32,\n+\tstrvec_pushf(args, \"--pack_header=%\"PRIu32\",%\"PRIu32,\n \t\t\tntohl(hdr->hdr_version), ntohl(hdr->hdr_entries));\n }\n \n@@ -1742,8 +1742,8 @@ static const char *unpack(int err_fd, struct shallow_info *si)\n \n \tif (si->nr_ours || si->nr_theirs) {\n \t\talt_shallow_file = setup_temporary_shallow(si->shallow);\n-\t\targv_array_push(&child.args, \"--shallow-file\");\n-\t\targv_array_push(&child.args, alt_shallow_file);\n+\t\tstrvec_push(&child.args, \"--shallow-file\");\n+\t\tstrvec_push(&child.args, alt_shallow_file);\n \t}\n \n \ttmp_objdir = tmp_objdir_create();\n@@ -1762,15 +1762,15 @@ static const char *unpack(int err_fd, struct shallow_info *si)\n \ttmp_objdir_add_as_alternate(tmp_objdir);\n \n \tif (ntohl(hdr.hdr_entries) < unpack_limit) {\n-\t\targv_array_push(&child.args, \"unpack-objects\");\n+\t\tstrvec_push(&child.args, \"unpack-objects\");\n \t\tpush_header_arg(&child.args, &hdr);\n \t\tif (quiet)\n-\t\t\targv_array_push(&child.args, \"-q\");\n+\t\t\tstrvec_push(&child.args, \"-q\");\n \t\tif (fsck_objects)\n-\t\t\targv_array_pushf(&child.args, \"--strict%s\",\n+\t\t\tstrvec_pushf(&child.args, \"--strict%s\",\n \t\t\t\tfsck_msg_types.buf);\n \t\tif (max_input_size)\n-\t\t\targv_array_pushf(&child.args, \"--max-input-size=%\"PRIuMAX,\n+\t\t\tstrvec_pushf(&child.args, \"--max-input-size=%\"PRIuMAX,\n \t\t\t\t(uintmax_t)max_input_size);\n \t\tchild.no_stdout = 1;\n \t\tchild.err = err_fd;\n@@ -1781,27 +1781,27 @@ static const char *unpack(int err_fd, struct shallow_info *si)\n \t} else {\n \t\tchar hostname[HOST_NAME_MAX + 1];\n \n-\t\targv_array_pushl(&child.args, \"index-pack\", \"--stdin\", NULL);\n+\t\tstrvec_pushl(&child.args, \"index-pack\", \"--stdin\", NULL);\n \t\tpush_header_arg(&child.args, &hdr);\n \n \t\tif (xgethostname(hostname, sizeof(hostname)))\n \t\t\txsnprintf(hostname, sizeof(hostname), \"localhost\");\n-\t\targv_array_pushf(&child.args,\n+\t\tstrvec_pushf(&child.args,\n \t\t\t\t \"--keep=receive-pack %\"PRIuMAX\" on %s\",\n \t\t\t\t (uintmax_t)getpid(),\n \t\t\t\t hostname);\n \n \t\tif (!quiet && err_fd)\n-\t\t\targv_array_push(&child.args, \"--show-resolving-progress\");\n+\t\t\tstrvec_push(&child.args, \"--show-resolving-progress\");\n \t\tif (use_sideband)\n-\t\t\targv_array_push(&child.args, \"--report-end-of-input\");\n+\t\t\tstrvec_push(&child.args, \"--report-end-of-input\");\n \t\tif (fsck_objects)\n-\t\t\targv_array_pushf(&child.args, \"--strict%s\",\n+\t\t\tstrvec_pushf(&child.args, \"--strict%s\",\n \t\t\t\tfsck_msg_types.buf);\n \t\tif (!reject_thin)\n-\t\t\targv_array_push(&child.args, \"--fix-thin\");\n+\t\t\tstrvec_push(&child.args, \"--fix-thin\");\n \t\tif (max_input_size)\n-\t\t\targv_array_pushf(&child.args, \"--max-input-size=%\"PRIuMAX,\n+\t\t\tstrvec_pushf(&child.args, \"--max-input-size=%\"PRIuMAX,\n \t\t\t\t(uintmax_t)max_input_size);\n \t\tchild.out = -1;\n \t\tchild.err = err_fd;\ndiff --git a/builtin/remote-ext.c b/builtin/remote-ext.c\nindex 6a9127a33c..fd3538d4f0 100644\n--- a/builtin/remote-ext.c\n+++ b/builtin/remote-ext.c\n@@ -117,12 +117,12 @@ static char *strip_escapes(const char *str, const char *service,\n \t}\n }\n \n-static void parse_argv(struct argv_array *out, const char *arg, const char *service)\n+static void parse_argv(struct strvec *out, const char *arg, const char *service)\n {\n \twhile (*arg) {\n \t\tchar *expanded = strip_escapes(arg, service, &arg);\n \t\tif (expanded)\n-\t\t\targv_array_push(out, expanded);\n+\t\t\tstrvec_push(out, expanded);\n \t\tfree(expanded);\n \t}\n }\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex a9f35ba855..a3b33c2c88 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -1451,35 +1451,35 @@ static int update(int argc, const char **argv)\n \t\t\t N_(\"prune remotes after fetching\")),\n \t\tOPT_END()\n \t};\n-\tstruct argv_array fetch_argv = ARGV_ARRAY_INIT;\n+\tstruct strvec fetch_argv = STRVEC_INIT;\n \tint default_defined = 0;\n \tint retval;\n \n \targc = parse_options(argc, argv, NULL, options, builtin_remote_update_usage,\n \t\t\t     PARSE_OPT_KEEP_ARGV0);\n \n-\targv_array_push(&fetch_argv, \"fetch\");\n+\tstrvec_push(&fetch_argv, \"fetch\");\n \n \tif (prune != -1)\n-\t\targv_array_push(&fetch_argv, prune ? \"--prune\" : \"--no-prune\");\n+\t\tstrvec_push(&fetch_argv, prune ? \"--prune\" : \"--no-prune\");\n \tif (verbose)\n-\t\targv_array_push(&fetch_argv, \"-v\");\n-\targv_array_push(&fetch_argv, \"--multiple\");\n+\t\tstrvec_push(&fetch_argv, \"-v\");\n+\tstrvec_push(&fetch_argv, \"--multiple\");\n \tif (argc < 2)\n-\t\targv_array_push(&fetch_argv, \"default\");\n+\t\tstrvec_push(&fetch_argv, \"default\");\n \tfor (i = 1; i < argc; i++)\n-\t\targv_array_push(&fetch_argv, argv[i]);\n+\t\tstrvec_push(&fetch_argv, argv[i]);\n \n \tif (strcmp(fetch_argv.argv[fetch_argv.argc-1], \"default\") == 0) {\n \t\tgit_config(get_remote_default, &default_defined);\n \t\tif (!default_defined) {\n-\t\t\targv_array_pop(&fetch_argv);\n-\t\t\targv_array_push(&fetch_argv, \"--all\");\n+\t\t\tstrvec_pop(&fetch_argv);\n+\t\t\tstrvec_push(&fetch_argv, \"--all\");\n \t\t}\n \t}\n \n \tretval = run_command_v_opt(fetch_argv.argv, RUN_GIT_CMD);\n-\targv_array_clear(&fetch_argv);\n+\tstrvec_clear(&fetch_argv);\n \treturn retval;\n }\n \ndiff --git a/builtin/repack.c b/builtin/repack.c\nindex 8bccb38a28..7435ee9af1 100644\n--- a/builtin/repack.c\n+++ b/builtin/repack.c\n@@ -153,28 +153,28 @@ struct pack_objects_args {\n static void prepare_pack_objects(struct child_process *cmd,\n \t\t\t\t const struct pack_objects_args *args)\n {\n-\targv_array_push(&cmd->args, \"pack-objects\");\n+\tstrvec_push(&cmd->args, \"pack-objects\");\n \tif (args->window)\n-\t\targv_array_pushf(&cmd->args, \"--window=%s\", args->window);\n+\t\tstrvec_pushf(&cmd->args, \"--window=%s\", args->window);\n \tif (args->window_memory)\n-\t\targv_array_pushf(&cmd->args, \"--window-memory=%s\", args->window_memory);\n+\t\tstrvec_pushf(&cmd->args, \"--window-memory=%s\", args->window_memory);\n \tif (args->depth)\n-\t\targv_array_pushf(&cmd->args, \"--depth=%s\", args->depth);\n+\t\tstrvec_pushf(&cmd->args, \"--depth=%s\", args->depth);\n \tif (args->threads)\n-\t\targv_array_pushf(&cmd->args, \"--threads=%s\", args->threads);\n+\t\tstrvec_pushf(&cmd->args, \"--threads=%s\", args->threads);\n \tif (args->max_pack_size)\n-\t\targv_array_pushf(&cmd->args, \"--max-pack-size=%s\", args->max_pack_size);\n+\t\tstrvec_pushf(&cmd->args, \"--max-pack-size=%s\", args->max_pack_size);\n \tif (args->no_reuse_delta)\n-\t\targv_array_pushf(&cmd->args, \"--no-reuse-delta\");\n+\t\tstrvec_pushf(&cmd->args, \"--no-reuse-delta\");\n \tif (args->no_reuse_object)\n-\t\targv_array_pushf(&cmd->args, \"--no-reuse-object\");\n+\t\tstrvec_pushf(&cmd->args, \"--no-reuse-object\");\n \tif (args->local)\n-\t\targv_array_push(&cmd->args,  \"--local\");\n+\t\tstrvec_push(&cmd->args,  \"--local\");\n \tif (args->quiet)\n-\t\targv_array_push(&cmd->args,  \"--quiet\");\n+\t\tstrvec_push(&cmd->args,  \"--quiet\");\n \tif (delta_base_offset)\n-\t\targv_array_push(&cmd->args,  \"--delta-base-offset\");\n-\targv_array_push(&cmd->args, packtmp);\n+\t\tstrvec_push(&cmd->args,  \"--delta-base-offset\");\n+\tstrvec_push(&cmd->args, packtmp);\n \tcmd->git_cmd = 1;\n \tcmd->out = -1;\n }\n@@ -361,24 +361,24 @@ int cmd_repack(int argc, const char **argv, const char *prefix)\n \n \tprepare_pack_objects(&cmd, &po_args);\n \n-\targv_array_push(&cmd.args, \"--keep-true-parents\");\n+\tstrvec_push(&cmd.args, \"--keep-true-parents\");\n \tif (!pack_kept_objects)\n-\t\targv_array_push(&cmd.args, \"--honor-pack-keep\");\n+\t\tstrvec_push(&cmd.args, \"--honor-pack-keep\");\n \tfor (i = 0; i < keep_pack_list.nr; i++)\n-\t\targv_array_pushf(&cmd.args, \"--keep-pack=%s\",\n+\t\tstrvec_pushf(&cmd.args, \"--keep-pack=%s\",\n \t\t\t\t keep_pack_list.items[i].string);\n-\targv_array_push(&cmd.args, \"--non-empty\");\n-\targv_array_push(&cmd.args, \"--all\");\n-\targv_array_push(&cmd.args, \"--reflog\");\n-\targv_array_push(&cmd.args, \"--indexed-objects\");\n+\tstrvec_push(&cmd.args, \"--non-empty\");\n+\tstrvec_push(&cmd.args, \"--all\");\n+\tstrvec_push(&cmd.args, \"--reflog\");\n+\tstrvec_push(&cmd.args, \"--indexed-objects\");\n \tif (has_promisor_remote())\n-\t\targv_array_push(&cmd.args, \"--exclude-promisor-objects\");\n+\t\tstrvec_push(&cmd.args, \"--exclude-promisor-objects\");\n \tif (write_bitmaps > 0)\n-\t\targv_array_push(&cmd.args, \"--write-bitmap-index\");\n+\t\tstrvec_push(&cmd.args, \"--write-bitmap-index\");\n \telse if (write_bitmaps < 0)\n-\t\targv_array_push(&cmd.args, \"--write-bitmap-index-quiet\");\n+\t\tstrvec_push(&cmd.args, \"--write-bitmap-index-quiet\");\n \tif (use_delta_islands)\n-\t\targv_array_push(&cmd.args, \"--delta-islands\");\n+\t\tstrvec_push(&cmd.args, \"--delta-islands\");\n \n \tif (pack_everything & ALL_INTO_ONE) {\n \t\tget_non_kept_pack_filenames(&existing_packs, &keep_pack_list);\n@@ -387,23 +387,23 @@ int cmd_repack(int argc, const char **argv, const char *prefix)\n \n \t\tif (existing_packs.nr && delete_redundant) {\n \t\t\tif (unpack_unreachable) {\n-\t\t\t\targv_array_pushf(&cmd.args,\n+\t\t\t\tstrvec_pushf(&cmd.args,\n \t\t\t\t\t\t\"--unpack-unreachable=%s\",\n \t\t\t\t\t\tunpack_unreachable);\n-\t\t\t\targv_array_push(&cmd.env_array, \"GIT_REF_PARANOIA=1\");\n+\t\t\t\tstrvec_push(&cmd.env_array, \"GIT_REF_PARANOIA=1\");\n \t\t\t} else if (pack_everything & LOOSEN_UNREACHABLE) {\n-\t\t\t\targv_array_push(&cmd.args,\n+\t\t\t\tstrvec_push(&cmd.args,\n \t\t\t\t\t\t\"--unpack-unreachable\");\n \t\t\t} else if (keep_unreachable) {\n-\t\t\t\targv_array_push(&cmd.args, \"--keep-unreachable\");\n-\t\t\t\targv_array_push(&cmd.args, \"--pack-loose-unreachable\");\n+\t\t\t\tstrvec_push(&cmd.args, \"--keep-unreachable\");\n+\t\t\t\tstrvec_push(&cmd.args, \"--pack-loose-unreachable\");\n \t\t\t} else {\n-\t\t\t\targv_array_push(&cmd.env_array, \"GIT_REF_PARANOIA=1\");\n+\t\t\t\tstrvec_push(&cmd.env_array, \"GIT_REF_PARANOIA=1\");\n \t\t\t}\n \t\t}\n \t} else {\n-\t\targv_array_push(&cmd.args, \"--unpacked\");\n-\t\targv_array_push(&cmd.args, \"--incremental\");\n+\t\tstrvec_push(&cmd.args, \"--unpacked\");\n+\t\tstrvec_push(&cmd.args, \"--incremental\");\n \t}\n \n \tcmd.no_stdin = 1;\ndiff --git a/builtin/replace.c b/builtin/replace.c\nindex b36d17a657..7bc5d66ed9 100644\n--- a/builtin/replace.c\n+++ b/builtin/replace.c\n@@ -228,13 +228,13 @@ static int export_object(const struct object_id *oid, enum object_type type,\n \tif (fd < 0)\n \t\treturn error_errno(_(\"unable to open %s for writing\"), filename);\n \n-\targv_array_push(&cmd.args, \"--no-replace-objects\");\n-\targv_array_push(&cmd.args, \"cat-file\");\n+\tstrvec_push(&cmd.args, \"--no-replace-objects\");\n+\tstrvec_push(&cmd.args, \"cat-file\");\n \tif (raw)\n-\t\targv_array_push(&cmd.args, type_name(type));\n+\t\tstrvec_push(&cmd.args, type_name(type));\n \telse\n-\t\targv_array_push(&cmd.args, \"-p\");\n-\targv_array_push(&cmd.args, oid_to_hex(oid));\n+\t\tstrvec_push(&cmd.args, \"-p\");\n+\tstrvec_push(&cmd.args, oid_to_hex(oid));\n \tcmd.git_cmd = 1;\n \tcmd.out = fd;\n \n@@ -502,7 +502,7 @@ static int convert_graft_file(int force)\n \tconst char *graft_file = get_graft_file(the_repository);\n \tFILE *fp = fopen_or_warn(graft_file, \"r\");\n \tstruct strbuf buf = STRBUF_INIT, err = STRBUF_INIT;\n-\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\tstruct strvec args = STRVEC_INIT;\n \n \tif (!fp)\n \t\treturn -1;\n@@ -512,10 +512,10 @@ static int convert_graft_file(int force)\n \t\tif (*buf.buf == '#')\n \t\t\tcontinue;\n \n-\t\targv_array_split(&args, buf.buf);\n+\t\tstrvec_split(&args, buf.buf);\n \t\tif (args.argc && create_graft(args.argc, args.argv, force, 1))\n \t\t\tstrbuf_addf(&err, \"\\n\\t%s\", buf.buf);\n-\t\targv_array_clear(&args);\n+\t\tstrvec_clear(&args);\n \t}\n \tfclose(fp);\n \ndiff --git a/builtin/show-branch.c b/builtin/show-branch.c\nindex f0a70538c3..4c918ce90d 100644\n--- a/builtin/show-branch.c\n+++ b/builtin/show-branch.c\n@@ -20,7 +20,7 @@ static const char* show_branch_usage[] = {\n \n static int showbranch_use_color = -1;\n \n-static struct argv_array default_args = ARGV_ARRAY_INIT;\n+static struct strvec default_args = STRVEC_INIT;\n \n /*\n  * TODO: convert this use of commit->object.flags to commit-slab\n@@ -562,8 +562,8 @@ static int git_show_branch_config(const char *var, const char *value, void *cb)\n \t\t * mimic the real argv a bit better.\n \t\t */\n \t\tif (!default_args.argc)\n-\t\t\targv_array_push(&default_args, \"show-branch\");\n-\t\targv_array_push(&default_args, value);\n+\t\t\tstrvec_push(&default_args, \"show-branch\");\n+\t\tstrvec_push(&default_args, value);\n \t\treturn 0;\n \t}\n \ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex 1acf216254..05c086e54c 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -277,8 +277,8 @@ static int diff_tree_binary(struct strbuf *out, struct object_id *w_commit)\n \t * however it should be done together with apply_cached.\n \t */\n \tcp.git_cmd = 1;\n-\targv_array_pushl(&cp.args, \"diff-tree\", \"--binary\", NULL);\n-\targv_array_pushf(&cp.args, \"%s^2^..%s^2\", w_commit_hex, w_commit_hex);\n+\tstrvec_pushl(&cp.args, \"diff-tree\", \"--binary\", NULL);\n+\tstrvec_pushf(&cp.args, \"%s^2^..%s^2\", w_commit_hex, w_commit_hex);\n \n \treturn pipe_command(&cp, NULL, 0, out, 0, NULL, 0);\n }\n@@ -293,7 +293,7 @@ static int apply_cached(struct strbuf *out)\n \t * buffer.\n \t */\n \tcp.git_cmd = 1;\n-\targv_array_pushl(&cp.args, \"apply\", \"--cached\", NULL);\n+\tstrvec_pushl(&cp.args, \"apply\", \"--cached\", NULL);\n \treturn pipe_command(&cp, out->buf, out->len, NULL, 0, NULL, 0);\n }\n \n@@ -306,7 +306,7 @@ static int reset_head(void)\n \t * API for resetting.\n \t */\n \tcp.git_cmd = 1;\n-\targv_array_push(&cp.args, \"reset\");\n+\tstrvec_push(&cp.args, \"reset\");\n \n \treturn run_command(&cp);\n }\n@@ -335,9 +335,9 @@ static int get_newly_staged(struct strbuf *out, struct object_id *c_tree)\n \t * converted together with update_index.\n \t */\n \tcp.git_cmd = 1;\n-\targv_array_pushl(&cp.args, \"diff-index\", \"--cached\", \"--name-only\",\n+\tstrvec_pushl(&cp.args, \"diff-index\", \"--cached\", \"--name-only\",\n \t\t\t \"--diff-filter=A\", NULL);\n-\targv_array_push(&cp.args, c_tree_hex);\n+\tstrvec_push(&cp.args, c_tree_hex);\n \treturn pipe_command(&cp, NULL, 0, out, 0, NULL, 0);\n }\n \n@@ -350,7 +350,7 @@ static int update_index(struct strbuf *out)\n \t * function exposed in order to remove this forking.\n \t */\n \tcp.git_cmd = 1;\n-\targv_array_pushl(&cp.args, \"update-index\", \"--add\", \"--stdin\", NULL);\n+\tstrvec_pushl(&cp.args, \"update-index\", \"--add\", \"--stdin\", NULL);\n \treturn pipe_command(&cp, out->buf, out->len, NULL, 0, NULL, 0);\n }\n \n@@ -365,9 +365,9 @@ static int restore_untracked(struct object_id *u_tree)\n \t * run_command to fork processes that will not interfere.\n \t */\n \tcp.git_cmd = 1;\n-\targv_array_push(&cp.args, \"read-tree\");\n-\targv_array_push(&cp.args, oid_to_hex(u_tree));\n-\targv_array_pushf(&cp.env_array, \"GIT_INDEX_FILE=%s\",\n+\tstrvec_push(&cp.args, \"read-tree\");\n+\tstrvec_push(&cp.args, oid_to_hex(u_tree));\n+\tstrvec_pushf(&cp.env_array, \"GIT_INDEX_FILE=%s\",\n \t\t\t stash_index_path.buf);\n \tif (run_command(&cp)) {\n \t\tremove_path(stash_index_path.buf);\n@@ -376,8 +376,8 @@ static int restore_untracked(struct object_id *u_tree)\n \n \tchild_process_init(&cp);\n \tcp.git_cmd = 1;\n-\targv_array_pushl(&cp.args, \"checkout-index\", \"--all\", NULL);\n-\targv_array_pushf(&cp.env_array, \"GIT_INDEX_FILE=%s\",\n+\tstrvec_pushl(&cp.args, \"checkout-index\", \"--all\", NULL);\n+\tstrvec_pushf(&cp.env_array, \"GIT_INDEX_FILE=%s\",\n \t\t\t stash_index_path.buf);\n \n \tres = run_command(&cp);\n@@ -499,11 +499,11 @@ static int do_apply_stash(const char *prefix, struct stash_info *info,\n \t\t */\n \t\tcp.git_cmd = 1;\n \t\tcp.dir = prefix;\n-\t\targv_array_pushf(&cp.env_array, GIT_WORK_TREE_ENVIRONMENT\"=%s\",\n+\t\tstrvec_pushf(&cp.env_array, GIT_WORK_TREE_ENVIRONMENT\"=%s\",\n \t\t\t\t absolute_path(get_git_work_tree()));\n-\t\targv_array_pushf(&cp.env_array, GIT_DIR_ENVIRONMENT\"=%s\",\n+\t\tstrvec_pushf(&cp.env_array, GIT_DIR_ENVIRONMENT\"=%s\",\n \t\t\t\t absolute_path(get_git_dir()));\n-\t\targv_array_push(&cp.args, \"status\");\n+\t\tstrvec_push(&cp.args, \"status\");\n \t\trun_command(&cp);\n \t}\n \n@@ -546,9 +546,9 @@ static int do_drop_stash(struct stash_info *info, int quiet)\n \t */\n \n \tcp_reflog.git_cmd = 1;\n-\targv_array_pushl(&cp_reflog.args, \"reflog\", \"delete\", \"--updateref\",\n+\tstrvec_pushl(&cp_reflog.args, \"reflog\", \"delete\", \"--updateref\",\n \t\t\t \"--rewrite\", NULL);\n-\targv_array_push(&cp_reflog.args, info->revision.buf);\n+\tstrvec_push(&cp_reflog.args, info->revision.buf);\n \tret = run_command(&cp_reflog);\n \tif (!ret) {\n \t\tif (!quiet)\n@@ -566,8 +566,8 @@ static int do_drop_stash(struct stash_info *info, int quiet)\n \tcp.git_cmd = 1;\n \t/* Even though --quiet is specified, rev-parse still outputs the hash */\n \tcp.no_stdout = 1;\n-\targv_array_pushl(&cp.args, \"rev-parse\", \"--verify\", \"--quiet\", NULL);\n-\targv_array_pushf(&cp.args, \"%s@{0}\", ref_stash);\n+\tstrvec_pushl(&cp.args, \"rev-parse\", \"--verify\", \"--quiet\", NULL);\n+\tstrvec_pushf(&cp.args, \"%s@{0}\", ref_stash);\n \tret = run_command(&cp);\n \n \t/* do_clear_stash if we just dropped the last stash entry */\n@@ -663,9 +663,9 @@ static int branch_stash(int argc, const char **argv, const char *prefix)\n \t\treturn -1;\n \n \tcp.git_cmd = 1;\n-\targv_array_pushl(&cp.args, \"checkout\", \"-b\", NULL);\n-\targv_array_push(&cp.args, branch);\n-\targv_array_push(&cp.args, oid_to_hex(&info.b_commit));\n+\tstrvec_pushl(&cp.args, \"checkout\", \"-b\", NULL);\n+\tstrvec_push(&cp.args, branch);\n+\tstrvec_push(&cp.args, oid_to_hex(&info.b_commit));\n \tret = run_command(&cp);\n \tif (!ret)\n \t\tret = do_apply_stash(prefix, &info, 1, 0);\n@@ -692,11 +692,11 @@ static int list_stash(int argc, const char **argv, const char *prefix)\n \t\treturn 0;\n \n \tcp.git_cmd = 1;\n-\targv_array_pushl(&cp.args, \"log\", \"--format=%gd: %gs\", \"-g\",\n+\tstrvec_pushl(&cp.args, \"log\", \"--format=%gd: %gs\", \"-g\",\n \t\t\t \"--first-parent\", \"-m\", NULL);\n-\targv_array_pushv(&cp.args, argv);\n-\targv_array_push(&cp.args, ref_stash);\n-\targv_array_push(&cp.args, \"--\");\n+\tstrvec_pushv(&cp.args, argv);\n+\tstrvec_push(&cp.args, ref_stash);\n+\tstrvec_push(&cp.args, \"--\");\n \treturn run_command(&cp);\n }\n \n@@ -727,8 +727,8 @@ static int show_stash(int argc, const char **argv, const char *prefix)\n \tint ret = 0;\n \tstruct stash_info info;\n \tstruct rev_info rev;\n-\tstruct argv_array stash_args = ARGV_ARRAY_INIT;\n-\tstruct argv_array revision_args = ARGV_ARRAY_INIT;\n+\tstruct strvec stash_args = STRVEC_INIT;\n+\tstruct strvec revision_args = STRVEC_INIT;\n \tstruct option options[] = {\n \t\tOPT_END()\n \t};\n@@ -737,16 +737,16 @@ static int show_stash(int argc, const char **argv, const char *prefix)\n \tgit_config(git_diff_ui_config, NULL);\n \tinit_revisions(&rev, prefix);\n \n-\targv_array_push(&revision_args, argv[0]);\n+\tstrvec_push(&revision_args, argv[0]);\n \tfor (i = 1; i < argc; i++) {\n \t\tif (argv[i][0] != '-')\n-\t\t\targv_array_push(&stash_args, argv[i]);\n+\t\t\tstrvec_push(&stash_args, argv[i]);\n \t\telse\n-\t\t\targv_array_push(&revision_args, argv[i]);\n+\t\t\tstrvec_push(&revision_args, argv[i]);\n \t}\n \n \tret = get_stash_info(&info, stash_args.argc, stash_args.argv);\n-\targv_array_clear(&stash_args);\n+\tstrvec_clear(&stash_args);\n \tif (ret)\n \t\treturn -1;\n \n@@ -842,12 +842,12 @@ static int store_stash(int argc, const char **argv, const char *prefix)\n \treturn do_store_stash(&obj, stash_msg, quiet);\n }\n \n-static void add_pathspecs(struct argv_array *args,\n+static void add_pathspecs(struct strvec *args,\n \t\t\t  const struct pathspec *ps) {\n \tint i;\n \n \tfor (i = 0; i < ps->nr; i++)\n-\t\targv_array_push(args, ps->items[i].original);\n+\t\tstrvec_push(args, ps->items[i].original);\n }\n \n /*\n@@ -960,9 +960,9 @@ static int save_untracked_files(struct stash_info *info, struct strbuf *msg,\n \tstruct index_state istate = { NULL };\n \n \tcp_upd_index.git_cmd = 1;\n-\targv_array_pushl(&cp_upd_index.args, \"update-index\", \"-z\", \"--add\",\n+\tstrvec_pushl(&cp_upd_index.args, \"update-index\", \"-z\", \"--add\",\n \t\t\t \"--remove\", \"--stdin\", NULL);\n-\targv_array_pushf(&cp_upd_index.env_array, \"GIT_INDEX_FILE=%s\",\n+\tstrvec_pushf(&cp_upd_index.env_array, \"GIT_INDEX_FILE=%s\",\n \t\t\t stash_index_path.buf);\n \n \tstrbuf_addf(&untracked_msg, \"untracked files on %s\\n\", msg->buf);\n@@ -1003,8 +1003,8 @@ static int stash_patch(struct stash_info *info, const struct pathspec *ps,\n \tremove_path(stash_index_path.buf);\n \n \tcp_read_tree.git_cmd = 1;\n-\targv_array_pushl(&cp_read_tree.args, \"read-tree\", \"HEAD\", NULL);\n-\targv_array_pushf(&cp_read_tree.env_array, \"GIT_INDEX_FILE=%s\",\n+\tstrvec_pushl(&cp_read_tree.args, \"read-tree\", \"HEAD\", NULL);\n+\tstrvec_pushf(&cp_read_tree.env_array, \"GIT_INDEX_FILE=%s\",\n \t\t\t stash_index_path.buf);\n \tif (run_command(&cp_read_tree)) {\n \t\tret = -1;\n@@ -1034,7 +1034,7 @@ static int stash_patch(struct stash_info *info, const struct pathspec *ps,\n \t}\n \n \tcp_diff_tree.git_cmd = 1;\n-\targv_array_pushl(&cp_diff_tree.args, \"diff-tree\", \"-p\", \"-U1\", \"HEAD\",\n+\tstrvec_pushl(&cp_diff_tree.args, \"diff-tree\", \"-p\", \"-U1\", \"HEAD\",\n \t\t\t oid_to_hex(&info->w_tree), \"--\", NULL);\n \tif (pipe_command(&cp_diff_tree, NULL, 0, out_patch, 0, NULL, 0)) {\n \t\tret = -1;\n@@ -1088,10 +1088,10 @@ static int stash_working_tree(struct stash_info *info, const struct pathspec *ps\n \t}\n \n \tcp_upd_index.git_cmd = 1;\n-\targv_array_pushl(&cp_upd_index.args, \"update-index\",\n+\tstrvec_pushl(&cp_upd_index.args, \"update-index\",\n \t\t\t \"--ignore-skip-worktree-entries\",\n \t\t\t \"-z\", \"--add\", \"--remove\", \"--stdin\", NULL);\n-\targv_array_pushf(&cp_upd_index.env_array, \"GIT_INDEX_FILE=%s\",\n+\tstrvec_pushf(&cp_upd_index.env_array, \"GIT_INDEX_FILE=%s\",\n \t\t\t stash_index_path.buf);\n \n \tif (pipe_command(&cp_upd_index, diff_output.buf, diff_output.len,\n@@ -1342,10 +1342,10 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n \t\t\tstruct child_process cp = CHILD_PROCESS_INIT;\n \n \t\t\tcp.git_cmd = 1;\n-\t\t\targv_array_pushl(&cp.args, \"clean\", \"--force\",\n+\t\t\tstrvec_pushl(&cp.args, \"clean\", \"--force\",\n \t\t\t\t\t \"--quiet\", \"-d\", NULL);\n \t\t\tif (include_untracked == INCLUDE_ALL_FILES)\n-\t\t\t\targv_array_push(&cp.args, \"-x\");\n+\t\t\t\tstrvec_push(&cp.args, \"-x\");\n \t\t\tif (run_command(&cp)) {\n \t\t\t\tret = -1;\n \t\t\t\tgoto done;\n@@ -1359,20 +1359,20 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n \t\t\tstruct strbuf out = STRBUF_INIT;\n \n \t\t\tcp_add.git_cmd = 1;\n-\t\t\targv_array_push(&cp_add.args, \"add\");\n+\t\t\tstrvec_push(&cp_add.args, \"add\");\n \t\t\tif (!include_untracked)\n-\t\t\t\targv_array_push(&cp_add.args, \"-u\");\n+\t\t\t\tstrvec_push(&cp_add.args, \"-u\");\n \t\t\tif (include_untracked == INCLUDE_ALL_FILES)\n-\t\t\t\targv_array_push(&cp_add.args, \"--force\");\n-\t\t\targv_array_push(&cp_add.args, \"--\");\n+\t\t\t\tstrvec_push(&cp_add.args, \"--force\");\n+\t\t\tstrvec_push(&cp_add.args, \"--\");\n \t\t\tadd_pathspecs(&cp_add.args, ps);\n \t\t\tif (run_command(&cp_add)) {\n \t\t\t\tret = -1;\n \t\t\t\tgoto done;\n \t\t\t}\n \n \t\t\tcp_diff.git_cmd = 1;\n-\t\t\targv_array_pushl(&cp_diff.args, \"diff-index\", \"-p\",\n+\t\t\tstrvec_pushl(&cp_diff.args, \"diff-index\", \"-p\",\n \t\t\t\t\t \"--cached\", \"--binary\", \"HEAD\", \"--\",\n \t\t\t\t\t NULL);\n \t\t\tadd_pathspecs(&cp_diff.args, ps);\n@@ -1382,7 +1382,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n \t\t\t}\n \n \t\t\tcp_apply.git_cmd = 1;\n-\t\t\targv_array_pushl(&cp_apply.args, \"apply\", \"--index\",\n+\t\t\tstrvec_pushl(&cp_apply.args, \"apply\", \"--index\",\n \t\t\t\t\t \"-R\", NULL);\n \t\t\tif (pipe_command(&cp_apply, out.buf, out.len, NULL, 0,\n \t\t\t\t\t NULL, 0)) {\n@@ -1392,7 +1392,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n \t\t} else {\n \t\t\tstruct child_process cp = CHILD_PROCESS_INIT;\n \t\t\tcp.git_cmd = 1;\n-\t\t\targv_array_pushl(&cp.args, \"reset\", \"--hard\", \"-q\",\n+\t\t\tstrvec_pushl(&cp.args, \"reset\", \"--hard\", \"-q\",\n \t\t\t\t\t \"--no-recurse-submodules\", NULL);\n \t\t\tif (run_command(&cp)) {\n \t\t\t\tret = -1;\n@@ -1404,10 +1404,10 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n \t\t\tstruct child_process cp = CHILD_PROCESS_INIT;\n \n \t\t\tcp.git_cmd = 1;\n-\t\t\targv_array_pushl(&cp.args, \"checkout\", \"--no-overlay\",\n+\t\t\tstrvec_pushl(&cp.args, \"checkout\", \"--no-overlay\",\n \t\t\t\t\t oid_to_hex(&info.i_tree), \"--\", NULL);\n \t\t\tif (!ps->nr)\n-\t\t\t\targv_array_push(&cp.args, \":/\");\n+\t\t\t\tstrvec_push(&cp.args, \":/\");\n \t\t\telse\n \t\t\t\tadd_pathspecs(&cp.args, ps);\n \t\t\tif (run_command(&cp)) {\n@@ -1420,7 +1420,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n \t\tstruct child_process cp = CHILD_PROCESS_INIT;\n \n \t\tcp.git_cmd = 1;\n-\t\targv_array_pushl(&cp.args, \"apply\", \"-R\", NULL);\n+\t\tstrvec_pushl(&cp.args, \"apply\", \"-R\", NULL);\n \n \t\tif (pipe_command(&cp, patch.buf, patch.len, NULL, 0, NULL, 0)) {\n \t\t\tif (!quiet)\n@@ -1434,7 +1434,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n \t\t\tstruct child_process cp = CHILD_PROCESS_INIT;\n \n \t\t\tcp.git_cmd = 1;\n-\t\t\targv_array_pushl(&cp.args, \"reset\", \"-q\", \"--\", NULL);\n+\t\t\tstrvec_pushl(&cp.args, \"reset\", \"-q\", \"--\", NULL);\n \t\t\tadd_pathspecs(&cp.args, ps);\n \t\t\tif (run_command(&cp)) {\n \t\t\t\tret = -1;\n@@ -1560,7 +1560,7 @@ int cmd_stash(int argc, const char **argv, const char *prefix)\n {\n \tpid_t pid = getpid();\n \tconst char *index_file;\n-\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\tstruct strvec args = STRVEC_INIT;\n \n \tstruct option options[] = {\n \t\tOPT_END()\n@@ -1609,7 +1609,7 @@ int cmd_stash(int argc, const char **argv, const char *prefix)\n \t\t\t      git_stash_usage, options);\n \n \t/* Assume 'stash push' */\n-\targv_array_push(&args, \"push\");\n-\targv_array_pushv(&args, argv);\n+\tstrvec_push(&args, \"push\");\n+\tstrvec_pushv(&args, argv);\n \treturn !!push_stash(args.argc, args.argv, prefix, 1);\n }\ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex a1c75607c7..7705e8eabf 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -294,9 +294,9 @@ static char *compute_rev_name(const char *sub_path, const char* object_id)\n \t\tcp.git_cmd = 1;\n \t\tcp.no_stderr = 1;\n \n-\t\targv_array_push(&cp.args, \"describe\");\n-\t\targv_array_pushv(&cp.args, *d);\n-\t\targv_array_push(&cp.args, object_id);\n+\t\tstrvec_push(&cp.args, \"describe\");\n+\t\tstrvec_pushv(&cp.args, *d);\n+\t\tstrvec_push(&cp.args, object_id);\n \n \t\tif (!capture_command(&cp, &sb, 0)) {\n \t\t\tstrbuf_strip_suffix(&sb, \"\\n\");\n@@ -495,12 +495,12 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,\n \t\tchar *toplevel = xgetcwd();\n \t\tstruct strbuf sb = STRBUF_INIT;\n \n-\t\targv_array_pushf(&cp.env_array, \"name=%s\", sub->name);\n-\t\targv_array_pushf(&cp.env_array, \"sm_path=%s\", path);\n-\t\targv_array_pushf(&cp.env_array, \"displaypath=%s\", displaypath);\n-\t\targv_array_pushf(&cp.env_array, \"sha1=%s\",\n+\t\tstrvec_pushf(&cp.env_array, \"name=%s\", sub->name);\n+\t\tstrvec_pushf(&cp.env_array, \"sm_path=%s\", path);\n+\t\tstrvec_pushf(&cp.env_array, \"displaypath=%s\", displaypath);\n+\t\tstrvec_pushf(&cp.env_array, \"sha1=%s\",\n \t\t\t\toid_to_hex(ce_oid));\n-\t\targv_array_pushf(&cp.env_array, \"toplevel=%s\", toplevel);\n+\t\tstrvec_pushf(&cp.env_array, \"toplevel=%s\", toplevel);\n \n \t\t/*\n \t\t * Since the path variable was accessible from the script\n@@ -509,15 +509,15 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,\n \t\t * on windows. And since environment variables are\n \t\t * case-insensitive in windows, it interferes with the\n \t\t * existing PATH variable. Hence, to avoid that, we expose\n-\t\t * path via the args argv_array and not via env_array.\n+\t\t * path via the args strvec and not via env_array.\n \t\t */\n \t\tsq_quote_buf(&sb, path);\n-\t\targv_array_pushf(&cp.args, \"path=%s; %s\",\n+\t\tstrvec_pushf(&cp.args, \"path=%s; %s\",\n \t\t\t\t sb.buf, info->argv[0]);\n \t\tstrbuf_release(&sb);\n \t\tfree(toplevel);\n \t} else {\n-\t\targv_array_pushv(&cp.args, info->argv);\n+\t\tstrvec_pushv(&cp.args, info->argv);\n \t}\n \n \tif (!info->quiet)\n@@ -534,16 +534,16 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,\n \t\tcpr.dir = path;\n \t\tprepare_submodule_repo_env(&cpr.env_array);\n \n-\t\targv_array_pushl(&cpr.args, \"--super-prefix\", NULL);\n-\t\targv_array_pushf(&cpr.args, \"%s/\", displaypath);\n-\t\targv_array_pushl(&cpr.args, \"submodule--helper\", \"foreach\", \"--recursive\",\n+\t\tstrvec_pushl(&cpr.args, \"--super-prefix\", NULL);\n+\t\tstrvec_pushf(&cpr.args, \"%s/\", displaypath);\n+\t\tstrvec_pushl(&cpr.args, \"submodule--helper\", \"foreach\", \"--recursive\",\n \t\t\t\tNULL);\n \n \t\tif (info->quiet)\n-\t\t\targv_array_push(&cpr.args, \"--quiet\");\n+\t\t\tstrvec_push(&cpr.args, \"--quiet\");\n \n-\t\targv_array_push(&cpr.args, \"--\");\n-\t\targv_array_pushv(&cpr.args, info->argv);\n+\t\tstrvec_push(&cpr.args, \"--\");\n+\t\tstrvec_pushv(&cpr.args, info->argv);\n \n \t\tif (run_command(&cpr))\n \t\t\tdie(_(\"run_command returned non-zero status while \"\n@@ -779,7 +779,7 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,\n \t\t\t     unsigned int flags)\n {\n \tchar *displaypath;\n-\tstruct argv_array diff_files_args = ARGV_ARRAY_INIT;\n+\tstruct strvec diff_files_args = STRVEC_INIT;\n \tstruct rev_info rev;\n \tint diff_files_result;\n \tstruct strbuf buf = STRBUF_INIT;\n@@ -809,7 +809,7 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,\n \t}\n \tstrbuf_release(&buf);\n \n-\targv_array_pushl(&diff_files_args, \"diff-files\",\n+\tstrvec_pushl(&diff_files_args, \"diff-files\",\n \t\t\t \"--ignore-submodules=dirty\", \"--quiet\", \"--\",\n \t\t\t path, NULL);\n \n@@ -849,23 +849,23 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,\n \t\tcpr.dir = path;\n \t\tprepare_submodule_repo_env(&cpr.env_array);\n \n-\t\targv_array_push(&cpr.args, \"--super-prefix\");\n-\t\targv_array_pushf(&cpr.args, \"%s/\", displaypath);\n-\t\targv_array_pushl(&cpr.args, \"submodule--helper\", \"status\",\n+\t\tstrvec_push(&cpr.args, \"--super-prefix\");\n+\t\tstrvec_pushf(&cpr.args, \"%s/\", displaypath);\n+\t\tstrvec_pushl(&cpr.args, \"submodule--helper\", \"status\",\n \t\t\t\t \"--recursive\", NULL);\n \n \t\tif (flags & OPT_CACHED)\n-\t\t\targv_array_push(&cpr.args, \"--cached\");\n+\t\t\tstrvec_push(&cpr.args, \"--cached\");\n \n \t\tif (flags & OPT_QUIET)\n-\t\t\targv_array_push(&cpr.args, \"--quiet\");\n+\t\t\tstrvec_push(&cpr.args, \"--quiet\");\n \n \t\tif (run_command(&cpr))\n \t\t\tdie(_(\"failed to recurse into submodule '%s'\"), path);\n \t}\n \n cleanup:\n-\targv_array_clear(&diff_files_args);\n+\tstrvec_clear(&diff_files_args);\n \tfree(displaypath);\n }\n \n@@ -995,7 +995,7 @@ static void sync_submodule(const char *path, const char *prefix,\n \tprepare_submodule_repo_env(&cp.env_array);\n \tcp.git_cmd = 1;\n \tcp.dir = path;\n-\targv_array_pushl(&cp.args, \"submodule--helper\",\n+\tstrvec_pushl(&cp.args, \"submodule--helper\",\n \t\t\t \"print-default-remote\", NULL);\n \n \tstrbuf_reset(&sb);\n@@ -1021,13 +1021,13 @@ static void sync_submodule(const char *path, const char *prefix,\n \t\tcpr.dir = path;\n \t\tprepare_submodule_repo_env(&cpr.env_array);\n \n-\t\targv_array_push(&cpr.args, \"--super-prefix\");\n-\t\targv_array_pushf(&cpr.args, \"%s/\", displaypath);\n-\t\targv_array_pushl(&cpr.args, \"submodule--helper\", \"sync\",\n+\t\tstrvec_push(&cpr.args, \"--super-prefix\");\n+\t\tstrvec_pushf(&cpr.args, \"%s/\", displaypath);\n+\t\tstrvec_pushl(&cpr.args, \"submodule--helper\", \"sync\",\n \t\t\t\t \"--recursive\", NULL);\n \n \t\tif (flags & OPT_QUIET)\n-\t\t\targv_array_push(&cpr.args, \"--quiet\");\n+\t\t\tstrvec_push(&cpr.args, \"--quiet\");\n \n \t\tif (run_command(&cpr))\n \t\t\tdie(_(\"failed to recurse into submodule '%s'\"),\n@@ -1127,7 +1127,7 @@ static void deinit_submodule(const char *path, const char *prefix,\n \t\tif (!(flags & OPT_FORCE)) {\n \t\t\tstruct child_process cp_rm = CHILD_PROCESS_INIT;\n \t\t\tcp_rm.git_cmd = 1;\n-\t\t\targv_array_pushl(&cp_rm.args, \"rm\", \"-qn\",\n+\t\t\tstrvec_pushl(&cp_rm.args, \"rm\", \"-qn\",\n \t\t\t\t\t path, NULL);\n \n \t\t\tif (run_command(&cp_rm))\n@@ -1156,8 +1156,8 @@ static void deinit_submodule(const char *path, const char *prefix,\n \t\t      displaypath);\n \n \tcp_config.git_cmd = 1;\n-\targv_array_pushl(&cp_config.args, \"config\", \"--get-regexp\", NULL);\n-\targv_array_pushf(&cp_config.args, \"submodule.%s\\\\.\", sub->name);\n+\tstrvec_pushl(&cp_config.args, \"config\", \"--get-regexp\", NULL);\n+\tstrvec_pushf(&cp_config.args, \"submodule.%s\\\\.\", sub->name);\n \n \t/* remove the .git/config entries (unless the user already did it) */\n \tif (!capture_command(&cp_config, &sb_config, 0) && sb_config.len) {\n@@ -1239,32 +1239,32 @@ static int clone_submodule(const char *path, const char *gitdir, const char *url\n {\n \tstruct child_process cp = CHILD_PROCESS_INIT;\n \n-\targv_array_push(&cp.args, \"clone\");\n-\targv_array_push(&cp.args, \"--no-checkout\");\n+\tstrvec_push(&cp.args, \"clone\");\n+\tstrvec_push(&cp.args, \"--no-checkout\");\n \tif (quiet)\n-\t\targv_array_push(&cp.args, \"--quiet\");\n+\t\tstrvec_push(&cp.args, \"--quiet\");\n \tif (progress)\n-\t\targv_array_push(&cp.args, \"--progress\");\n+\t\tstrvec_push(&cp.args, \"--progress\");\n \tif (depth && *depth)\n-\t\targv_array_pushl(&cp.args, \"--depth\", depth, NULL);\n+\t\tstrvec_pushl(&cp.args, \"--depth\", depth, NULL);\n \tif (reference->nr) {\n \t\tstruct string_list_item *item;\n \t\tfor_each_string_list_item(item, reference)\n-\t\t\targv_array_pushl(&cp.args, \"--reference\",\n+\t\t\tstrvec_pushl(&cp.args, \"--reference\",\n \t\t\t\t\t item->string, NULL);\n \t}\n \tif (dissociate)\n-\t\targv_array_push(&cp.args, \"--dissociate\");\n+\t\tstrvec_push(&cp.args, \"--dissociate\");\n \tif (gitdir && *gitdir)\n-\t\targv_array_pushl(&cp.args, \"--separate-git-dir\", gitdir, NULL);\n+\t\tstrvec_pushl(&cp.args, \"--separate-git-dir\", gitdir, NULL);\n \tif (single_branch >= 0)\n-\t\targv_array_push(&cp.args, single_branch ?\n+\t\tstrvec_push(&cp.args, single_branch ?\n \t\t\t\t\t  \"--single-branch\" :\n \t\t\t\t\t  \"--no-single-branch\");\n \n-\targv_array_push(&cp.args, \"--\");\n-\targv_array_push(&cp.args, url);\n-\targv_array_push(&cp.args, path);\n+\tstrvec_push(&cp.args, \"--\");\n+\tstrvec_push(&cp.args, url);\n+\tstrvec_push(&cp.args, path);\n \n \tcp.git_cmd = 1;\n \tprepare_submodule_repo_env(&cp.env_array);\n@@ -1717,32 +1717,32 @@ static int prepare_to_clone_next_submodule(const struct cache_entry *ce,\n \tchild->no_stdin = 1;\n \tchild->stdout_to_stderr = 1;\n \tchild->err = -1;\n-\targv_array_push(&child->args, \"submodule--helper\");\n-\targv_array_push(&child->args, \"clone\");\n+\tstrvec_push(&child->args, \"submodule--helper\");\n+\tstrvec_push(&child->args, \"clone\");\n \tif (suc->progress)\n-\t\targv_array_push(&child->args, \"--progress\");\n+\t\tstrvec_push(&child->args, \"--progress\");\n \tif (suc->quiet)\n-\t\targv_array_push(&child->args, \"--quiet\");\n+\t\tstrvec_push(&child->args, \"--quiet\");\n \tif (suc->prefix)\n-\t\targv_array_pushl(&child->args, \"--prefix\", suc->prefix, NULL);\n+\t\tstrvec_pushl(&child->args, \"--prefix\", suc->prefix, NULL);\n \tif (suc->recommend_shallow && sub->recommend_shallow == 1)\n-\t\targv_array_push(&child->args, \"--depth=1\");\n+\t\tstrvec_push(&child->args, \"--depth=1\");\n \tif (suc->require_init)\n-\t\targv_array_push(&child->args, \"--require-init\");\n-\targv_array_pushl(&child->args, \"--path\", sub->path, NULL);\n-\targv_array_pushl(&child->args, \"--name\", sub->name, NULL);\n-\targv_array_pushl(&child->args, \"--url\", url, NULL);\n+\t\tstrvec_push(&child->args, \"--require-init\");\n+\tstrvec_pushl(&child->args, \"--path\", sub->path, NULL);\n+\tstrvec_pushl(&child->args, \"--name\", sub->name, NULL);\n+\tstrvec_pushl(&child->args, \"--url\", url, NULL);\n \tif (suc->references.nr) {\n \t\tstruct string_list_item *item;\n \t\tfor_each_string_list_item(item, &suc->references)\n-\t\t\targv_array_pushl(&child->args, \"--reference\", item->string, NULL);\n+\t\t\tstrvec_pushl(&child->args, \"--reference\", item->string, NULL);\n \t}\n \tif (suc->dissociate)\n-\t\targv_array_push(&child->args, \"--dissociate\");\n+\t\tstrvec_push(&child->args, \"--dissociate\");\n \tif (suc->depth)\n-\t\targv_array_push(&child->args, suc->depth);\n+\t\tstrvec_push(&child->args, suc->depth);\n \tif (suc->single_branch >= 0)\n-\t\targv_array_push(&child->args, suc->single_branch ?\n+\t\tstrvec_push(&child->args, suc->single_branch ?\n \t\t\t\t\t      \"--single-branch\" :\n \t\t\t\t\t      \"--no-single-branch\");\n \ndiff --git a/builtin/upload-archive.c b/builtin/upload-archive.c\nindex 7fc8e0e82d..f02bb0ea15 100644\n--- a/builtin/upload-archive.c\n+++ b/builtin/upload-archive.c\n@@ -19,7 +19,7 @@ static const char deadchild[] =\n \n int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)\n {\n-\tstruct argv_array sent_argv = ARGV_ARRAY_INIT;\n+\tstruct strvec sent_argv = STRVEC_INIT;\n \tconst char *arg_cmd = \"argument \";\n \n \tif (argc != 2 || !strcmp(argv[1], \"-h\"))\n@@ -31,7 +31,7 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)\n \tinit_archivers();\n \n \t/* put received options in sent_argv[] */\n-\targv_array_push(&sent_argv, \"git-upload-archive\");\n+\tstrvec_push(&sent_argv, \"git-upload-archive\");\n \tfor (;;) {\n \t\tchar *buf = packet_read_line(0, NULL);\n \t\tif (!buf)\n@@ -41,7 +41,7 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)\n \n \t\tif (!starts_with(buf, arg_cmd))\n \t\t\tdie(\"'argument' token or flush expected\");\n-\t\targv_array_push(&sent_argv, buf + strlen(arg_cmd));\n+\t\tstrvec_push(&sent_argv, buf + strlen(arg_cmd));\n \t}\n \n \t/* parse all options sent by the client */\ndiff --git a/builtin/worktree.c b/builtin/worktree.c\nindex 35945096f6..3c483c23d4 100644\n--- a/builtin/worktree.c\n+++ b/builtin/worktree.c\n@@ -316,7 +316,7 @@ static int add_worktree(const char *path, const char *refname,\n \tstruct strbuf sb = STRBUF_INIT, realpath = STRBUF_INIT;\n \tconst char *name;\n \tstruct child_process cp = CHILD_PROCESS_INIT;\n-\tstruct argv_array child_env = ARGV_ARRAY_INIT;\n+\tstruct strvec child_env = STRVEC_INIT;\n \tunsigned int counter = 0;\n \tint len, ret;\n \tstruct strbuf symref = STRBUF_INIT;\n@@ -408,18 +408,18 @@ static int add_worktree(const char *path, const char *refname,\n \tstrbuf_addf(&sb, \"%s/commondir\", sb_repo.buf);\n \twrite_file(sb.buf, \"../..\");\n \n-\targv_array_pushf(&child_env, \"%s=%s\", GIT_DIR_ENVIRONMENT, sb_git.buf);\n-\targv_array_pushf(&child_env, \"%s=%s\", GIT_WORK_TREE_ENVIRONMENT, path);\n+\tstrvec_pushf(&child_env, \"%s=%s\", GIT_DIR_ENVIRONMENT, sb_git.buf);\n+\tstrvec_pushf(&child_env, \"%s=%s\", GIT_WORK_TREE_ENVIRONMENT, path);\n \tcp.git_cmd = 1;\n \n \tif (!is_branch)\n-\t\targv_array_pushl(&cp.args, \"update-ref\", \"HEAD\",\n+\t\tstrvec_pushl(&cp.args, \"update-ref\", \"HEAD\",\n \t\t\t\t oid_to_hex(&commit->object.oid), NULL);\n \telse {\n-\t\targv_array_pushl(&cp.args, \"symbolic-ref\", \"HEAD\",\n+\t\tstrvec_pushl(&cp.args, \"symbolic-ref\", \"HEAD\",\n \t\t\t\t symref.buf, NULL);\n \t\tif (opts->quiet)\n-\t\t\targv_array_push(&cp.args, \"--quiet\");\n+\t\t\tstrvec_push(&cp.args, \"--quiet\");\n \t}\n \n \tcp.env = child_env.argv;\n@@ -429,10 +429,10 @@ static int add_worktree(const char *path, const char *refname,\n \n \tif (opts->checkout) {\n \t\tcp.argv = NULL;\n-\t\targv_array_clear(&cp.args);\n-\t\targv_array_pushl(&cp.args, \"reset\", \"--hard\", \"--no-recurse-submodules\", NULL);\n+\t\tstrvec_clear(&cp.args);\n+\t\tstrvec_pushl(&cp.args, \"reset\", \"--hard\", \"--no-recurse-submodules\", NULL);\n \t\tif (opts->quiet)\n-\t\t\targv_array_push(&cp.args, \"--quiet\");\n+\t\t\tstrvec_push(&cp.args, \"--quiet\");\n \t\tcp.env = child_env.argv;\n \t\tret = run_command(&cp);\n \t\tif (ret)\n@@ -465,15 +465,15 @@ static int add_worktree(const char *path, const char *refname,\n \t\t\tcp.env = env;\n \t\t\tcp.argv = NULL;\n \t\t\tcp.trace2_hook_name = \"post-checkout\";\n-\t\t\targv_array_pushl(&cp.args, absolute_path(hook),\n+\t\t\tstrvec_pushl(&cp.args, absolute_path(hook),\n \t\t\t\t\t oid_to_hex(&null_oid),\n \t\t\t\t\t oid_to_hex(&commit->object.oid),\n \t\t\t\t\t \"1\", NULL);\n \t\t\tret = run_command(&cp);\n \t\t}\n \t}\n \n-\targv_array_clear(&child_env);\n+\tstrvec_clear(&child_env);\n \tstrbuf_release(&sb);\n \tstrbuf_release(&symref);\n \tstrbuf_release(&sb_repo);\n@@ -619,15 +619,15 @@ static int add(int ac, const char **av, const char *prefix)\n \tif (new_branch) {\n \t\tstruct child_process cp = CHILD_PROCESS_INIT;\n \t\tcp.git_cmd = 1;\n-\t\targv_array_push(&cp.args, \"branch\");\n+\t\tstrvec_push(&cp.args, \"branch\");\n \t\tif (new_branch_force)\n-\t\t\targv_array_push(&cp.args, \"--force\");\n+\t\t\tstrvec_push(&cp.args, \"--force\");\n \t\tif (opts.quiet)\n-\t\t\targv_array_push(&cp.args, \"--quiet\");\n-\t\targv_array_push(&cp.args, new_branch);\n-\t\targv_array_push(&cp.args, branch);\n+\t\t\tstrvec_push(&cp.args, \"--quiet\");\n+\t\tstrvec_push(&cp.args, new_branch);\n+\t\tstrvec_push(&cp.args, branch);\n \t\tif (opt_track)\n-\t\t\targv_array_push(&cp.args, opt_track);\n+\t\t\tstrvec_push(&cp.args, opt_track);\n \t\tif (run_command(&cp))\n \t\t\treturn -1;\n \t\tbranch = new_branch;\n@@ -924,7 +924,7 @@ static int move_worktree(int ac, const char **av, const char *prefix)\n static void check_clean_worktree(struct worktree *wt,\n \t\t\t\t const char *original_path)\n {\n-\tstruct argv_array child_env = ARGV_ARRAY_INIT;\n+\tstruct strvec child_env = STRVEC_INIT;\n \tstruct child_process cp;\n \tchar buf[1];\n \tint ret;\n@@ -935,12 +935,12 @@ static void check_clean_worktree(struct worktree *wt,\n \t */\n \tvalidate_no_submodules(wt);\n \n-\targv_array_pushf(&child_env, \"%s=%s/.git\",\n+\tstrvec_pushf(&child_env, \"%s=%s/.git\",\n \t\t\t GIT_DIR_ENVIRONMENT, wt->path);\n-\targv_array_pushf(&child_env, \"%s=%s\",\n+\tstrvec_pushf(&child_env, \"%s=%s\",\n \t\t\t GIT_WORK_TREE_ENVIRONMENT, wt->path);\n \tmemset(&cp, 0, sizeof(cp));\n-\targv_array_pushl(&cp.args, \"status\",\n+\tstrvec_pushl(&cp.args, \"status\",\n \t\t\t \"--porcelain\", \"--ignore-submodules=none\",\n \t\t\t NULL);\n \tcp.env = child_env.argv;\n-- \n2.28.0.rc2.475.g53c7e1c7f4\n\n"},{"id":"402235","messageId":"20200728202453.GF1021513@coredump.intra.peff.net","threadId":"53940","inReplyTo":"20200728202124.GA1021264@coredump.intra.peff.net","subject":"[PATCH 06/11] strvec: convert more callers away from argv_array name","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-28T20:24:53Z","receivedAt":"2020-07-28T20:25:01Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"We eventually want to drop the argv_array name and just use strvec\nconsistently. There's no particular reason we have to do it all at once,\nor care about interactions between converted and unconverted bits.\nBecause of our preprocessor compat layer, the names are interchangeable\nto the compiler (so even a definition and declaration using different\nnames is OK).\n\nThis patch converts remaining files from the first half of the alphabet,\nto keep the diff to a manageable size.\n\nThe conversion was done purely mechanically with:\n\n  git ls-files '*.c' '*.h' |\n  xargs perl -i -pe '\n    s/ARGV_ARRAY/STRVEC/g;\n    s/argv_array/strvec/g;\n  '\n\nand then selectively staging files with \"git add '[abcdefghjkl]*'\".\nWe'll deal with any indentation/style fallouts separately.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n add-interactive.c | 14 ++++++-------\n add-patch.c       | 28 ++++++++++++-------------\n bisect.c          | 12 +++++------\n bundle.c          | 12 +++++------\n bundle.h          |  2 +-\n column.c          | 12 +++++------\n commit.c          |  8 ++++----\n compat/mingw.c    |  4 ++--\n compat/terminal.c | 18 ++++++++--------\n connect.c         | 48 +++++++++++++++++++++----------------------\n connected.c       | 22 ++++++++++----------\n daemon.c          | 52 +++++++++++++++++++++++------------------------\n diff.c            | 28 ++++++++++++-------------\n environment.c     |  8 ++++----\n exec-cmd.c        | 10 ++++-----\n fast-import.c     |  4 ++--\n fetch-pack.c      | 34 +++++++++++++++----------------\n fsmonitor.c       |  6 +++---\n git.c             | 22 ++++++++++----------\n gpg-interface.c   |  8 ++++----\n graph.c           | 10 ++++-----\n http-backend.c    |  4 ++--\n http-push.c       | 12 +++++------\n http.c            |  6 +++---\n imap-send.c       |  2 +-\n line-log.c        |  6 +++---\n ls-refs.c         | 10 ++++-----\n 27 files changed, 201 insertions(+), 201 deletions(-)\n\ndiff --git a/add-interactive.c b/add-interactive.c\nindex 29cd2fe020..b345777d0c 100644\n--- a/add-interactive.c\n+++ b/add-interactive.c\n@@ -935,18 +935,18 @@ static int run_patch(struct add_i_state *s, const struct pathspec *ps,\n \topts->prompt = N_(\"Patch update\");\n \tcount = list_and_choose(s, files, opts);\n \tif (count > 0) {\n-\t\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\t\tstruct strvec args = STRVEC_INIT;\n \t\tstruct pathspec ps_selected = { 0 };\n \n \t\tfor (i = 0; i < files->items.nr; i++)\n \t\t\tif (files->selected[i])\n-\t\t\t\targv_array_push(&args,\n+\t\t\t\tstrvec_push(&args,\n \t\t\t\t\t\tfiles->items.items[i].string);\n \t\tparse_pathspec(&ps_selected,\n \t\t\t       PATHSPEC_ALL_MAGIC & ~PATHSPEC_LITERAL,\n \t\t\t       PATHSPEC_LITERAL_PATH, \"\", args.argv);\n \t\tres = run_add_p(s->r, ADD_P_ADD, NULL, &ps_selected);\n-\t\targv_array_clear(&args);\n+\t\tstrvec_clear(&args);\n \t\tclear_pathspec(&ps_selected);\n \t}\n \n@@ -976,18 +976,18 @@ static int run_diff(struct add_i_state *s, const struct pathspec *ps,\n \tcount = list_and_choose(s, files, opts);\n \topts->flags = 0;\n \tif (count > 0) {\n-\t\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\t\tstruct strvec args = STRVEC_INIT;\n \n-\t\targv_array_pushl(&args, \"git\", \"diff\", \"-p\", \"--cached\",\n+\t\tstrvec_pushl(&args, \"git\", \"diff\", \"-p\", \"--cached\",\n \t\t\t\t oid_to_hex(!is_initial ? &oid :\n \t\t\t\t\t    s->r->hash_algo->empty_tree),\n \t\t\t\t \"--\", NULL);\n \t\tfor (i = 0; i < files->items.nr; i++)\n \t\t\tif (files->selected[i])\n-\t\t\t\targv_array_push(&args,\n+\t\t\t\tstrvec_push(&args,\n \t\t\t\t\t\tfiles->items.items[i].string);\n \t\tres = run_command_v_opt(args.argv, 0);\n-\t\targv_array_clear(&args);\n+\t\tstrvec_clear(&args);\n \t}\n \n \tputchar('\\n');\ndiff --git a/add-patch.c b/add-patch.c\nindex 09d00c5574..3c91ae52ae 100644\n--- a/add-patch.c\n+++ b/add-patch.c\n@@ -286,11 +286,11 @@ static void setup_child_process(struct add_p_state *s,\n \n \tva_start(ap, cp);\n \twhile ((arg = va_arg(ap, const char *)))\n-\t\targv_array_push(&cp->args, arg);\n+\t\tstrvec_push(&cp->args, arg);\n \tva_end(ap);\n \n \tcp->git_cmd = 1;\n-\targv_array_pushf(&cp->env_array,\n+\tstrvec_pushf(&cp->env_array,\n \t\t\t INDEX_ENVIRONMENT \"=%s\", s->s.r->index_file);\n }\n \n@@ -370,7 +370,7 @@ static int is_octal(const char *p, size_t len)\n \n static int parse_diff(struct add_p_state *s, const struct pathspec *ps)\n {\n-\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\tstruct strvec args = STRVEC_INIT;\n \tconst char *diff_algorithm = s->s.interactive_diff_algorithm;\n \tstruct strbuf *plain = &s->plain, *colored = NULL;\n \tstruct child_process cp = CHILD_PROCESS_INIT;\n@@ -380,32 +380,32 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)\n \tstruct hunk *hunk = NULL;\n \tint res;\n \n-\targv_array_pushv(&args, s->mode->diff_cmd);\n+\tstrvec_pushv(&args, s->mode->diff_cmd);\n \tif (diff_algorithm)\n-\t\targv_array_pushf(&args, \"--diff-algorithm=%s\", diff_algorithm);\n+\t\tstrvec_pushf(&args, \"--diff-algorithm=%s\", diff_algorithm);\n \tif (s->revision) {\n \t\tstruct object_id oid;\n-\t\targv_array_push(&args,\n+\t\tstrvec_push(&args,\n \t\t\t\t/* could be on an unborn branch */\n \t\t\t\t!strcmp(\"HEAD\", s->revision) &&\n \t\t\t\tget_oid(\"HEAD\", &oid) ?\n \t\t\t\tempty_tree_oid_hex() : s->revision);\n \t}\n \tcolor_arg_index = args.argc;\n \t/* Use `--no-color` explicitly, just in case `diff.color = always`. */\n-\targv_array_pushl(&args, \"--no-color\", \"-p\", \"--\", NULL);\n+\tstrvec_pushl(&args, \"--no-color\", \"-p\", \"--\", NULL);\n \tfor (i = 0; i < ps->nr; i++)\n-\t\targv_array_push(&args, ps->items[i].original);\n+\t\tstrvec_push(&args, ps->items[i].original);\n \n \tsetup_child_process(s, &cp, NULL);\n \tcp.argv = args.argv;\n \tres = capture_command(&cp, plain, 0);\n \tif (res) {\n-\t\targv_array_clear(&args);\n+\t\tstrvec_clear(&args);\n \t\treturn error(_(\"could not parse diff\"));\n \t}\n \tif (!plain->len) {\n-\t\targv_array_clear(&args);\n+\t\tstrvec_clear(&args);\n \t\treturn 0;\n \t}\n \tstrbuf_complete_line(plain);\n@@ -419,7 +419,7 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)\n \t\tcolored_cp.argv = args.argv;\n \t\tcolored = &s->colored;\n \t\tres = capture_command(&colored_cp, colored, 0);\n-\t\targv_array_clear(&args);\n+\t\tstrvec_clear(&args);\n \t\tif (res)\n \t\t\treturn error(_(\"could not parse colored diff\"));\n \n@@ -444,7 +444,7 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)\n \t\tcolored_p = colored->buf;\n \t\tcolored_pend = colored_p + colored->len;\n \t}\n-\targv_array_clear(&args);\n+\tstrvec_clear(&args);\n \n \t/* parse files and hunks */\n \tp = plain->buf;\n@@ -1158,7 +1158,7 @@ static int run_apply_check(struct add_p_state *s,\n \n \tsetup_child_process(s, &cp,\n \t\t\t    \"apply\", \"--check\", NULL);\n-\targv_array_pushv(&cp.args, s->mode->apply_check_args);\n+\tstrvec_pushv(&cp.args, s->mode->apply_check_args);\n \tif (pipe_command(&cp, s->buf.buf, s->buf.len, NULL, 0, NULL, 0))\n \t\treturn error(_(\"'git apply --cached' failed\"));\n \n@@ -1619,7 +1619,7 @@ static int patch_update_file(struct add_p_state *s,\n \t\t\t\t\t   s->mode->is_reverse);\n \t\telse {\n \t\t\tsetup_child_process(s, &cp, \"apply\", NULL);\n-\t\t\targv_array_pushv(&cp.args, s->mode->apply_args);\n+\t\t\tstrvec_pushv(&cp.args, s->mode->apply_args);\n \t\t\tif (pipe_command(&cp, s->buf.buf, s->buf.len,\n \t\t\t\t\t NULL, 0, NULL, 0))\n \t\t\t\terror(_(\"'git apply' failed\"));\ndiff --git a/bisect.c b/bisect.c\nindex 77e35ddd43..3e50b51c11 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -456,7 +456,7 @@ static GIT_PATH_FUNC(git_path_bisect_log, \"BISECT_LOG\")\n static GIT_PATH_FUNC(git_path_bisect_terms, \"BISECT_TERMS\")\n static GIT_PATH_FUNC(git_path_head_name, \"head-name\")\n \n-static void read_bisect_paths(struct argv_array *array)\n+static void read_bisect_paths(struct strvec *array)\n {\n \tstruct strbuf str = STRBUF_INIT;\n \tconst char *filename = git_path_bisect_names();\n@@ -632,20 +632,20 @@ static void bisect_rev_setup(struct repository *r, struct rev_info *revs,\n \t\t\t     const char *bad_format, const char *good_format,\n \t\t\t     int read_paths)\n {\n-\tstruct argv_array rev_argv = ARGV_ARRAY_INIT;\n+\tstruct strvec rev_argv = STRVEC_INIT;\n \tint i;\n \n \trepo_init_revisions(r, revs, prefix);\n \trevs->abbrev = 0;\n \trevs->commit_format = CMIT_FMT_UNSPECIFIED;\n \n \t/* rev_argv.argv[0] will be ignored by setup_revisions */\n-\targv_array_push(&rev_argv, \"bisect_rev_setup\");\n-\targv_array_pushf(&rev_argv, bad_format, oid_to_hex(current_bad_oid));\n+\tstrvec_push(&rev_argv, \"bisect_rev_setup\");\n+\tstrvec_pushf(&rev_argv, bad_format, oid_to_hex(current_bad_oid));\n \tfor (i = 0; i < good_revs.nr; i++)\n-\t\targv_array_pushf(&rev_argv, good_format,\n+\t\tstrvec_pushf(&rev_argv, good_format,\n \t\t\t\t oid_to_hex(good_revs.oid + i));\n-\targv_array_push(&rev_argv, \"--\");\n+\tstrvec_push(&rev_argv, \"--\");\n \tif (read_paths)\n \t\tread_bisect_paths(&rev_argv);\n \ndiff --git a/bundle.c b/bundle.c\nindex d46a387e66..709b2abc9c 100644\n--- a/bundle.c\n+++ b/bundle.c\n@@ -269,16 +269,16 @@ static int is_tag_in_date_range(struct object *tag, struct rev_info *revs)\n \n \n /* Write the pack data to bundle_fd */\n-static int write_pack_data(int bundle_fd, struct rev_info *revs, struct argv_array *pack_options)\n+static int write_pack_data(int bundle_fd, struct rev_info *revs, struct strvec *pack_options)\n {\n \tstruct child_process pack_objects = CHILD_PROCESS_INIT;\n \tint i;\n \n-\targv_array_pushl(&pack_objects.args,\n+\tstrvec_pushl(&pack_objects.args,\n \t\t\t \"pack-objects\",\n \t\t\t \"--stdout\", \"--thin\", \"--delta-base-offset\",\n \t\t\t NULL);\n-\targv_array_pushv(&pack_objects.args, pack_options->argv);\n+\tstrvec_pushv(&pack_objects.args, pack_options->argv);\n \tpack_objects.in = -1;\n \tpack_objects.out = bundle_fd;\n \tpack_objects.git_cmd = 1;\n@@ -321,11 +321,11 @@ static int compute_and_write_prerequisites(int bundle_fd,\n \tFILE *rls_fout;\n \tint i;\n \n-\targv_array_pushl(&rls.args,\n+\tstrvec_pushl(&rls.args,\n \t\t\t \"rev-list\", \"--boundary\", \"--pretty=oneline\",\n \t\t\t NULL);\n \tfor (i = 1; i < argc; i++)\n-\t\targv_array_push(&rls.args, argv[i]);\n+\t\tstrvec_push(&rls.args, argv[i]);\n \trls.out = -1;\n \trls.git_cmd = 1;\n \tif (start_command(&rls))\n@@ -449,7 +449,7 @@ static int write_bundle_refs(int bundle_fd, struct rev_info *revs)\n }\n \n int create_bundle(struct repository *r, const char *path,\n-\t\t  int argc, const char **argv, struct argv_array *pack_options)\n+\t\t  int argc, const char **argv, struct strvec *pack_options)\n {\n \tstruct lock_file lock = LOCK_INIT;\n \tint bundle_fd = -1;\ndiff --git a/bundle.h b/bundle.h\nindex 2cf1270092..3f5c9ad220 100644\n--- a/bundle.h\n+++ b/bundle.h\n@@ -21,7 +21,7 @@ struct bundle_header {\n int is_bundle(const char *path, int quiet);\n int read_bundle_header(const char *path, struct bundle_header *header);\n int create_bundle(struct repository *r, const char *path,\n-\t\t  int argc, const char **argv, struct argv_array *pack_options);\n+\t\t  int argc, const char **argv, struct strvec *pack_options);\n int verify_bundle(struct repository *r, struct bundle_header *header, int verbose);\n #define BUNDLE_VERBOSE 1\n int unbundle(struct repository *r, struct bundle_header *header,\ndiff --git a/column.c b/column.c\nindex 4a38eed322..a79c2621b0 100644\n--- a/column.c\n+++ b/column.c\n@@ -358,22 +358,22 @@ static struct child_process column_process = CHILD_PROCESS_INIT;\n \n int run_column_filter(int colopts, const struct column_options *opts)\n {\n-\tstruct argv_array *argv;\n+\tstruct strvec *argv;\n \n \tif (fd_out != -1)\n \t\treturn -1;\n \n \tchild_process_init(&column_process);\n \targv = &column_process.args;\n \n-\targv_array_push(argv, \"column\");\n-\targv_array_pushf(argv, \"--raw-mode=%d\", colopts);\n+\tstrvec_push(argv, \"column\");\n+\tstrvec_pushf(argv, \"--raw-mode=%d\", colopts);\n \tif (opts && opts->width)\n-\t\targv_array_pushf(argv, \"--width=%d\", opts->width);\n+\t\tstrvec_pushf(argv, \"--width=%d\", opts->width);\n \tif (opts && opts->indent)\n-\t\targv_array_pushf(argv, \"--indent=%s\", opts->indent);\n+\t\tstrvec_pushf(argv, \"--indent=%s\", opts->indent);\n \tif (opts && opts->padding)\n-\t\targv_array_pushf(argv, \"--padding=%d\", opts->padding);\n+\t\tstrvec_pushf(argv, \"--padding=%d\", opts->padding);\n \n \tfflush(stdout);\n \tcolumn_process.in = -1;\ndiff --git a/commit.c b/commit.c\nindex 7128895c3a..a5176a25bd 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -1630,22 +1630,22 @@ size_t ignore_non_trailer(const char *buf, size_t len)\n int run_commit_hook(int editor_is_used, const char *index_file,\n \t\t    const char *name, ...)\n {\n-\tstruct argv_array hook_env = ARGV_ARRAY_INIT;\n+\tstruct strvec hook_env = STRVEC_INIT;\n \tva_list args;\n \tint ret;\n \n-\targv_array_pushf(&hook_env, \"GIT_INDEX_FILE=%s\", index_file);\n+\tstrvec_pushf(&hook_env, \"GIT_INDEX_FILE=%s\", index_file);\n \n \t/*\n \t * Let the hook know that no editor will be launched.\n \t */\n \tif (!editor_is_used)\n-\t\targv_array_push(&hook_env, \"GIT_EDITOR=:\");\n+\t\tstrvec_push(&hook_env, \"GIT_EDITOR=:\");\n \n \tva_start(args, name);\n \tret = run_hook_ve(hook_env.argv,name, args);\n \tva_end(args);\n-\targv_array_clear(&hook_env);\n+\tstrvec_clear(&hook_env);\n \n \treturn ret;\n }\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 8ee0b6408e..4454b3e67b 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -18,8 +18,8 @@ void open_in_gdb(void)\n \tstatic struct child_process cp = CHILD_PROCESS_INIT;\n \textern char *_pgmptr;\n \n-\targv_array_pushl(&cp.args, \"mintty\", \"gdb\", NULL);\n-\targv_array_pushf(&cp.args, \"--pid=%d\", getpid());\n+\tstrvec_pushl(&cp.args, \"mintty\", \"gdb\", NULL);\n+\tstrvec_pushf(&cp.args, \"--pid=%d\", getpid());\n \tcp.clean_on_exit = 1;\n \tif (start_command(&cp) < 0)\n \t\tdie_errno(\"Could not start gdb\");\ndiff --git a/compat/terminal.c b/compat/terminal.c\nindex 35bca03d14..43b73ddc75 100644\n--- a/compat/terminal.c\n+++ b/compat/terminal.c\n@@ -86,9 +86,9 @@ static void restore_term(void)\n \t\tif (stty_restore.nr == 0)\n \t\t\treturn;\n \n-\t\targv_array_push(&cp.args, \"stty\");\n+\t\tstrvec_push(&cp.args, \"stty\");\n \t\tfor (i = 0; i < stty_restore.nr; i++)\n-\t\t\targv_array_push(&cp.args, stty_restore.items[i].string);\n+\t\t\tstrvec_push(&cp.args, stty_restore.items[i].string);\n \t\trun_command(&cp);\n \t\tstring_list_clear(&stty_restore, 0);\n \t\treturn;\n@@ -107,25 +107,25 @@ static int disable_bits(DWORD bits)\n \tif (use_stty) {\n \t\tstruct child_process cp = CHILD_PROCESS_INIT;\n \n-\t\targv_array_push(&cp.args, \"stty\");\n+\t\tstrvec_push(&cp.args, \"stty\");\n \n \t\tif (bits & ENABLE_LINE_INPUT) {\n \t\t\tstring_list_append(&stty_restore, \"icanon\");\n-\t\t\targv_array_push(&cp.args, \"-icanon\");\n+\t\t\tstrvec_push(&cp.args, \"-icanon\");\n \t\t}\n \n \t\tif (bits & ENABLE_ECHO_INPUT) {\n \t\t\tstring_list_append(&stty_restore, \"echo\");\n-\t\t\targv_array_push(&cp.args, \"-echo\");\n+\t\t\tstrvec_push(&cp.args, \"-echo\");\n \t\t}\n \n \t\tif (bits & ENABLE_PROCESSED_INPUT) {\n \t\t\tstring_list_append(&stty_restore, \"-ignbrk\");\n \t\t\tstring_list_append(&stty_restore, \"intr\");\n \t\t\tstring_list_append(&stty_restore, \"^c\");\n-\t\t\targv_array_push(&cp.args, \"ignbrk\");\n-\t\t\targv_array_push(&cp.args, \"intr\");\n-\t\t\targv_array_push(&cp.args, \"\");\n+\t\t\tstrvec_push(&cp.args, \"ignbrk\");\n+\t\t\tstrvec_push(&cp.args, \"intr\");\n+\t\t\tstrvec_push(&cp.args, \"\");\n \t\t}\n \n \t\tif (run_command(&cp) == 0)\n@@ -273,7 +273,7 @@ static int is_known_escape_sequence(const char *sequence)\n \t\thashmap_init(&sequences, (hashmap_cmp_fn)sequence_entry_cmp,\n \t\t\t     NULL, 0);\n \n-\t\targv_array_pushl(&cp.args, \"infocmp\", \"-L\", \"-1\", NULL);\n+\t\tstrvec_pushl(&cp.args, \"infocmp\", \"-L\", \"-1\", NULL);\n \t\tif (pipe_command(&cp, NULL, 0, &buf, 0, NULL, 0))\n \t\t\tstrbuf_setlen(&buf, 0);\n \ndiff --git a/connect.c b/connect.c\nindex e0d5b9fee0..9b453fe792 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -17,7 +17,7 @@\n #include \"alias.h\"\n \n static char *server_capabilities_v1;\n-static struct argv_array server_capabilities_v2 = ARGV_ARRAY_INIT;\n+static struct strvec server_capabilities_v2 = STRVEC_INIT;\n static const char *next_server_feature_value(const char *feature, int *len, int *offset);\n \n static int check_ref(const char *name, unsigned int flags)\n@@ -123,7 +123,7 @@ int server_supports_feature(const char *c, const char *feature,\n static void process_capabilities_v2(struct packet_reader *reader)\n {\n \twhile (packet_reader_read(reader) == PACKET_READ_NORMAL)\n-\t\targv_array_push(&server_capabilities_v2, reader->line);\n+\t\tstrvec_push(&server_capabilities_v2, reader->line);\n \n \tif (reader->status != PACKET_READ_FLUSH)\n \t\tdie(_(\"expected flush after capabilities\"));\n@@ -453,7 +453,7 @@ void check_stateless_delimiter(int stateless_rpc,\n \n struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,\n \t\t\t     struct ref **list, int for_push,\n-\t\t\t     const struct argv_array *ref_prefixes,\n+\t\t\t     const struct strvec *ref_prefixes,\n \t\t\t     const struct string_list *server_options,\n \t\t\t     int stateless_rpc)\n {\n@@ -944,9 +944,9 @@ static struct child_process *git_proxy_connect(int fd[2], char *host)\n \n \tproxy = xmalloc(sizeof(*proxy));\n \tchild_process_init(proxy);\n-\targv_array_push(&proxy->args, git_proxy_command);\n-\targv_array_push(&proxy->args, host);\n-\targv_array_push(&proxy->args, port);\n+\tstrvec_push(&proxy->args, git_proxy_command);\n+\tstrvec_push(&proxy->args, host);\n+\tstrvec_push(&proxy->args, port);\n \tproxy->in = -1;\n \tproxy->out = -1;\n \tif (start_command(proxy))\n@@ -1199,15 +1199,15 @@ static struct child_process *git_connect_git(int fd[2], char *hostandport,\n  * Append the appropriate environment variables to `env` and options to\n  * `args` for running ssh in Git's SSH-tunneled transport.\n  */\n-static void push_ssh_options(struct argv_array *args, struct argv_array *env,\n+static void push_ssh_options(struct strvec *args, struct strvec *env,\n \t\t\t     enum ssh_variant variant, const char *port,\n \t\t\t     enum protocol_version version, int flags)\n {\n \tif (variant == VARIANT_SSH &&\n \t    version > 0) {\n-\t\targv_array_push(args, \"-o\");\n-\t\targv_array_push(args, \"SendEnv=\" GIT_PROTOCOL_ENVIRONMENT);\n-\t\targv_array_pushf(env, GIT_PROTOCOL_ENVIRONMENT \"=version=%d\",\n+\t\tstrvec_push(args, \"-o\");\n+\t\tstrvec_push(args, \"SendEnv=\" GIT_PROTOCOL_ENVIRONMENT);\n+\t\tstrvec_pushf(env, GIT_PROTOCOL_ENVIRONMENT \"=version=%d\",\n \t\t\t\t version);\n \t}\n \n@@ -1221,7 +1221,7 @@ static void push_ssh_options(struct argv_array *args, struct argv_array *env,\n \t\tcase VARIANT_PLINK:\n \t\tcase VARIANT_PUTTY:\n \t\tcase VARIANT_TORTOISEPLINK:\n-\t\t\targv_array_push(args, \"-4\");\n+\t\t\tstrvec_push(args, \"-4\");\n \t\t}\n \t} else if (flags & CONNECT_IPV6) {\n \t\tswitch (variant) {\n@@ -1233,12 +1233,12 @@ static void push_ssh_options(struct argv_array *args, struct argv_array *env,\n \t\tcase VARIANT_PLINK:\n \t\tcase VARIANT_PUTTY:\n \t\tcase VARIANT_TORTOISEPLINK:\n-\t\t\targv_array_push(args, \"-6\");\n+\t\t\tstrvec_push(args, \"-6\");\n \t\t}\n \t}\n \n \tif (variant == VARIANT_TORTOISEPLINK)\n-\t\targv_array_push(args, \"-batch\");\n+\t\tstrvec_push(args, \"-batch\");\n \n \tif (port) {\n \t\tswitch (variant) {\n@@ -1247,15 +1247,15 @@ static void push_ssh_options(struct argv_array *args, struct argv_array *env,\n \t\tcase VARIANT_SIMPLE:\n \t\t\tdie(_(\"ssh variant 'simple' does not support setting port\"));\n \t\tcase VARIANT_SSH:\n-\t\t\targv_array_push(args, \"-p\");\n+\t\t\tstrvec_push(args, \"-p\");\n \t\t\tbreak;\n \t\tcase VARIANT_PLINK:\n \t\tcase VARIANT_PUTTY:\n \t\tcase VARIANT_TORTOISEPLINK:\n-\t\t\targv_array_push(args, \"-P\");\n+\t\t\tstrvec_push(args, \"-P\");\n \t\t}\n \n-\t\targv_array_push(args, port);\n+\t\tstrvec_push(args, port);\n \t}\n }\n \n@@ -1293,18 +1293,18 @@ static void fill_ssh_args(struct child_process *conn, const char *ssh_host,\n \t\tdetect.use_shell = conn->use_shell;\n \t\tdetect.no_stdin = detect.no_stdout = detect.no_stderr = 1;\n \n-\t\targv_array_push(&detect.args, ssh);\n-\t\targv_array_push(&detect.args, \"-G\");\n+\t\tstrvec_push(&detect.args, ssh);\n+\t\tstrvec_push(&detect.args, \"-G\");\n \t\tpush_ssh_options(&detect.args, &detect.env_array,\n \t\t\t\t VARIANT_SSH, port, version, flags);\n-\t\targv_array_push(&detect.args, ssh_host);\n+\t\tstrvec_push(&detect.args, ssh_host);\n \n \t\tvariant = run_command(&detect) ? VARIANT_SIMPLE : VARIANT_SSH;\n \t}\n \n-\targv_array_push(&conn->args, ssh);\n+\tstrvec_push(&conn->args, ssh);\n \tpush_ssh_options(&conn->args, &conn->env_array, variant, port, version, flags);\n-\targv_array_push(&conn->args, ssh_host);\n+\tstrvec_push(&conn->args, ssh_host);\n }\n \n /*\n@@ -1365,7 +1365,7 @@ struct child_process *git_connect(int fd[2], const char *url,\n \n \t\t/* remove repo-local variables from the environment */\n \t\tfor (var = local_repo_env; *var; var++)\n-\t\t\targv_array_push(&conn->env_array, *var);\n+\t\t\tstrvec_push(&conn->env_array, *var);\n \n \t\tconn->use_shell = 1;\n \t\tconn->in = conn->out = -1;\n@@ -1397,11 +1397,11 @@ struct child_process *git_connect(int fd[2], const char *url,\n \t\t\ttransport_check_allowed(\"file\");\n \t\t\tconn->trace2_child_class = \"transport/file\";\n \t\t\tif (version > 0) {\n-\t\t\t\targv_array_pushf(&conn->env_array, GIT_PROTOCOL_ENVIRONMENT \"=version=%d\",\n+\t\t\t\tstrvec_pushf(&conn->env_array, GIT_PROTOCOL_ENVIRONMENT \"=version=%d\",\n \t\t\t\t\t\t version);\n \t\t\t}\n \t\t}\n-\t\targv_array_push(&conn->args, cmd.buf);\n+\t\tstrvec_push(&conn->args, cmd.buf);\n \n \t\tif (start_command(conn))\n \t\t\tdie(_(\"unable to fork\"));\ndiff --git a/connected.c b/connected.c\nindex 937b4bae38..96b47879d3 100644\n--- a/connected.c\n+++ b/connected.c\n@@ -90,22 +90,22 @@ int check_connected(oid_iterate_fn fn, void *cb_data,\n \n no_promisor_pack_found:\n \tif (opt->shallow_file) {\n-\t\targv_array_push(&rev_list.args, \"--shallow-file\");\n-\t\targv_array_push(&rev_list.args, opt->shallow_file);\n+\t\tstrvec_push(&rev_list.args, \"--shallow-file\");\n+\t\tstrvec_push(&rev_list.args, opt->shallow_file);\n \t}\n-\targv_array_push(&rev_list.args,\"rev-list\");\n-\targv_array_push(&rev_list.args, \"--objects\");\n-\targv_array_push(&rev_list.args, \"--stdin\");\n+\tstrvec_push(&rev_list.args,\"rev-list\");\n+\tstrvec_push(&rev_list.args, \"--objects\");\n+\tstrvec_push(&rev_list.args, \"--stdin\");\n \tif (has_promisor_remote())\n-\t\targv_array_push(&rev_list.args, \"--exclude-promisor-objects\");\n+\t\tstrvec_push(&rev_list.args, \"--exclude-promisor-objects\");\n \tif (!opt->is_deepening_fetch) {\n-\t\targv_array_push(&rev_list.args, \"--not\");\n-\t\targv_array_push(&rev_list.args, \"--all\");\n+\t\tstrvec_push(&rev_list.args, \"--not\");\n+\t\tstrvec_push(&rev_list.args, \"--all\");\n \t}\n-\targv_array_push(&rev_list.args, \"--quiet\");\n-\targv_array_push(&rev_list.args, \"--alternate-refs\");\n+\tstrvec_push(&rev_list.args, \"--quiet\");\n+\tstrvec_push(&rev_list.args, \"--alternate-refs\");\n \tif (opt->progress)\n-\t\targv_array_pushf(&rev_list.args, \"--progress=%s\",\n+\t\tstrvec_pushf(&rev_list.args, \"--progress=%s\",\n \t\t\t\t _(\"Checking connectivity\"));\n \n \trev_list.git_cmd = 1;\ndiff --git a/daemon.c b/daemon.c\nindex fd669ed3b4..cea5f5354f 100644\n--- a/daemon.c\n+++ b/daemon.c\n@@ -296,7 +296,7 @@ static const char *path_ok(const char *directory, struct hostinfo *hi)\n \treturn NULL;\t\t/* Fallthrough. Deny by default */\n }\n \n-typedef int (*daemon_service_fn)(const struct argv_array *env);\n+typedef int (*daemon_service_fn)(const struct strvec *env);\n struct daemon_service {\n \tconst char *name;\n \tconst char *config_name;\n@@ -377,7 +377,7 @@ static int run_access_hook(struct daemon_service *service, const char *dir,\n }\n \n static int run_service(const char *dir, struct daemon_service *service,\n-\t\t       struct hostinfo *hi, const struct argv_array *env)\n+\t\t       struct hostinfo *hi, const struct strvec *env)\n {\n \tconst char *path;\n \tint enabled = service->enabled;\n@@ -462,7 +462,7 @@ static void copy_to_log(int fd)\n \n static int run_service_command(struct child_process *cld)\n {\n-\targv_array_push(&cld->args, \".\");\n+\tstrvec_push(&cld->args, \".\");\n \tcld->git_cmd = 1;\n \tcld->err = -1;\n \tif (start_command(cld))\n@@ -476,33 +476,33 @@ static int run_service_command(struct child_process *cld)\n \treturn finish_command(cld);\n }\n \n-static int upload_pack(const struct argv_array *env)\n+static int upload_pack(const struct strvec *env)\n {\n \tstruct child_process cld = CHILD_PROCESS_INIT;\n-\targv_array_pushl(&cld.args, \"upload-pack\", \"--strict\", NULL);\n-\targv_array_pushf(&cld.args, \"--timeout=%u\", timeout);\n+\tstrvec_pushl(&cld.args, \"upload-pack\", \"--strict\", NULL);\n+\tstrvec_pushf(&cld.args, \"--timeout=%u\", timeout);\n \n-\targv_array_pushv(&cld.env_array, env->argv);\n+\tstrvec_pushv(&cld.env_array, env->argv);\n \n \treturn run_service_command(&cld);\n }\n \n-static int upload_archive(const struct argv_array *env)\n+static int upload_archive(const struct strvec *env)\n {\n \tstruct child_process cld = CHILD_PROCESS_INIT;\n-\targv_array_push(&cld.args, \"upload-archive\");\n+\tstrvec_push(&cld.args, \"upload-archive\");\n \n-\targv_array_pushv(&cld.env_array, env->argv);\n+\tstrvec_pushv(&cld.env_array, env->argv);\n \n \treturn run_service_command(&cld);\n }\n \n-static int receive_pack(const struct argv_array *env)\n+static int receive_pack(const struct strvec *env)\n {\n \tstruct child_process cld = CHILD_PROCESS_INIT;\n-\targv_array_push(&cld.args, \"receive-pack\");\n+\tstrvec_push(&cld.args, \"receive-pack\");\n \n-\targv_array_pushv(&cld.env_array, env->argv);\n+\tstrvec_pushv(&cld.env_array, env->argv);\n \n \treturn run_service_command(&cld);\n }\n@@ -633,7 +633,7 @@ static char *parse_host_arg(struct hostinfo *hi, char *extra_args, int buflen)\n \treturn extra_args;\n }\n \n-static void parse_extra_args(struct hostinfo *hi, struct argv_array *env,\n+static void parse_extra_args(struct hostinfo *hi, struct strvec *env,\n \t\t\t     char *extra_args, int buflen)\n {\n \tconst char *end = extra_args + buflen;\n@@ -664,7 +664,7 @@ static void parse_extra_args(struct hostinfo *hi, struct argv_array *env,\n \n \tif (git_protocol.len > 0) {\n \t\tloginfo(\"Extended attribute \\\"protocol\\\": %s\", git_protocol.buf);\n-\t\targv_array_pushf(env, GIT_PROTOCOL_ENVIRONMENT \"=%s\",\n+\t\tstrvec_pushf(env, GIT_PROTOCOL_ENVIRONMENT \"=%s\",\n \t\t\t\t git_protocol.buf);\n \t}\n \tstrbuf_release(&git_protocol);\n@@ -761,7 +761,7 @@ static int execute(void)\n \tint pktlen, len, i;\n \tchar *addr = getenv(\"REMOTE_ADDR\"), *port = getenv(\"REMOTE_PORT\");\n \tstruct hostinfo hi;\n-\tstruct argv_array env = ARGV_ARRAY_INIT;\n+\tstruct strvec env = STRVEC_INIT;\n \n \thostinfo_init(&hi);\n \n@@ -794,13 +794,13 @@ static int execute(void)\n \t\t\t */\n \t\t\tint rc = run_service(arg, s, &hi, &env);\n \t\t\thostinfo_clear(&hi);\n-\t\t\targv_array_clear(&env);\n+\t\t\tstrvec_clear(&env);\n \t\t\treturn rc;\n \t\t}\n \t}\n \n \thostinfo_clear(&hi);\n-\targv_array_clear(&env);\n+\tstrvec_clear(&env);\n \tlogerror(\"Protocol error: '%s'\", line);\n \treturn -1;\n }\n@@ -893,7 +893,7 @@ static void check_dead_children(void)\n \t\t\tcradle = &blanket->next;\n }\n \n-static struct argv_array cld_argv = ARGV_ARRAY_INIT;\n+static struct strvec cld_argv = STRVEC_INIT;\n static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)\n {\n \tstruct child_process cld = CHILD_PROCESS_INIT;\n@@ -913,16 +913,16 @@ static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)\n \t\tchar buf[128] = \"\";\n \t\tstruct sockaddr_in *sin_addr = (void *) addr;\n \t\tinet_ntop(addr->sa_family, &sin_addr->sin_addr, buf, sizeof(buf));\n-\t\targv_array_pushf(&cld.env_array, \"REMOTE_ADDR=%s\", buf);\n-\t\targv_array_pushf(&cld.env_array, \"REMOTE_PORT=%d\",\n+\t\tstrvec_pushf(&cld.env_array, \"REMOTE_ADDR=%s\", buf);\n+\t\tstrvec_pushf(&cld.env_array, \"REMOTE_PORT=%d\",\n \t\t\t\t ntohs(sin_addr->sin_port));\n #ifndef NO_IPV6\n \t} else if (addr->sa_family == AF_INET6) {\n \t\tchar buf[128] = \"\";\n \t\tstruct sockaddr_in6 *sin6_addr = (void *) addr;\n \t\tinet_ntop(AF_INET6, &sin6_addr->sin6_addr, buf, sizeof(buf));\n-\t\targv_array_pushf(&cld.env_array, \"REMOTE_ADDR=[%s]\", buf);\n-\t\targv_array_pushf(&cld.env_array, \"REMOTE_PORT=%d\",\n+\t\tstrvec_pushf(&cld.env_array, \"REMOTE_ADDR=[%s]\", buf);\n+\t\tstrvec_pushf(&cld.env_array, \"REMOTE_PORT=%d\",\n \t\t\t\t ntohs(sin6_addr->sin6_port));\n #endif\n \t}\n@@ -1476,10 +1476,10 @@ int cmd_main(int argc, const char **argv)\n \t\twrite_file(pid_file, \"%\"PRIuMAX, (uintmax_t) getpid());\n \n \t/* prepare argv for serving-processes */\n-\targv_array_push(&cld_argv, argv[0]); /* git-daemon */\n-\targv_array_push(&cld_argv, \"--serve\");\n+\tstrvec_push(&cld_argv, argv[0]); /* git-daemon */\n+\tstrvec_push(&cld_argv, \"--serve\");\n \tfor (i = 1; i < argc; ++i)\n-\t\targv_array_push(&cld_argv, argv[i]);\n+\t\tstrvec_push(&cld_argv, argv[i]);\n \n \treturn serve(&listen_addr, listen_port, cred);\n }\ndiff --git a/diff.c b/diff.c\nindex ee008155e4..f1a3758922 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -4192,14 +4192,14 @@ static struct diff_tempfile *prepare_temp_file(struct repository *r,\n }\n \n static void add_external_diff_name(struct repository *r,\n-\t\t\t\t   struct argv_array *argv,\n+\t\t\t\t   struct strvec *argv,\n \t\t\t\t   const char *name,\n \t\t\t\t   struct diff_filespec *df)\n {\n \tstruct diff_tempfile *temp = prepare_temp_file(r, name, df);\n-\targv_array_push(argv, temp->name);\n-\targv_array_push(argv, temp->hex);\n-\targv_array_push(argv, temp->mode);\n+\tstrvec_push(argv, temp->name);\n+\tstrvec_push(argv, temp->hex);\n+\tstrvec_push(argv, temp->mode);\n }\n \n /* An external diff command takes:\n@@ -4216,35 +4216,35 @@ static void run_external_diff(const char *pgm,\n \t\t\t      const char *xfrm_msg,\n \t\t\t      struct diff_options *o)\n {\n-\tstruct argv_array argv = ARGV_ARRAY_INIT;\n-\tstruct argv_array env = ARGV_ARRAY_INIT;\n+\tstruct strvec argv = STRVEC_INIT;\n+\tstruct strvec env = STRVEC_INIT;\n \tstruct diff_queue_struct *q = &diff_queued_diff;\n \n-\targv_array_push(&argv, pgm);\n-\targv_array_push(&argv, name);\n+\tstrvec_push(&argv, pgm);\n+\tstrvec_push(&argv, name);\n \n \tif (one && two) {\n \t\tadd_external_diff_name(o->repo, &argv, name, one);\n \t\tif (!other)\n \t\t\tadd_external_diff_name(o->repo, &argv, name, two);\n \t\telse {\n \t\t\tadd_external_diff_name(o->repo, &argv, other, two);\n-\t\t\targv_array_push(&argv, other);\n-\t\t\targv_array_push(&argv, xfrm_msg);\n+\t\t\tstrvec_push(&argv, other);\n+\t\t\tstrvec_push(&argv, xfrm_msg);\n \t\t}\n \t}\n \n-\targv_array_pushf(&env, \"GIT_DIFF_PATH_COUNTER=%d\", ++o->diff_path_counter);\n-\targv_array_pushf(&env, \"GIT_DIFF_PATH_TOTAL=%d\", q->nr);\n+\tstrvec_pushf(&env, \"GIT_DIFF_PATH_COUNTER=%d\", ++o->diff_path_counter);\n+\tstrvec_pushf(&env, \"GIT_DIFF_PATH_TOTAL=%d\", q->nr);\n \n \tdiff_free_filespec_data(one);\n \tdiff_free_filespec_data(two);\n \tif (run_command_v_opt_cd_env(argv.argv, RUN_USING_SHELL, NULL, env.argv))\n \t\tdie(_(\"external diff died, stopping at %s\"), name);\n \n \tremove_tempfile();\n-\targv_array_clear(&argv);\n-\targv_array_clear(&env);\n+\tstrvec_clear(&argv);\n+\tstrvec_clear(&env);\n }\n \n static int similarity_index(struct diff_filepair *p)\ndiff --git a/environment.c b/environment.c\nindex 75fe5f4c56..00fe20e496 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -156,14 +156,14 @@ static char *expand_namespace(const char *raw_namespace)\n  * Wrapper of getenv() that returns a strdup value. This value is kept\n  * in argv to be freed later.\n  */\n-static const char *getenv_safe(struct argv_array *argv, const char *name)\n+static const char *getenv_safe(struct strvec *argv, const char *name)\n {\n \tconst char *value = getenv(name);\n \n \tif (!value)\n \t\treturn NULL;\n \n-\targv_array_push(argv, value);\n+\tstrvec_push(argv, value);\n \treturn argv->argv[argv->argc - 1];\n }\n \n@@ -172,15 +172,15 @@ void setup_git_env(const char *git_dir)\n \tconst char *shallow_file;\n \tconst char *replace_ref_base;\n \tstruct set_gitdir_args args = { NULL };\n-\tstruct argv_array to_free = ARGV_ARRAY_INIT;\n+\tstruct strvec to_free = STRVEC_INIT;\n \n \targs.commondir = getenv_safe(&to_free, GIT_COMMON_DIR_ENVIRONMENT);\n \targs.object_dir = getenv_safe(&to_free, DB_ENVIRONMENT);\n \targs.graft_file = getenv_safe(&to_free, GRAFT_ENVIRONMENT);\n \targs.index_file = getenv_safe(&to_free, INDEX_ENVIRONMENT);\n \targs.alternate_db = getenv_safe(&to_free, ALTERNATE_DB_ENVIRONMENT);\n \trepo_set_gitdir(the_repository, git_dir, &args);\n-\targv_array_clear(&to_free);\n+\tstrvec_clear(&to_free);\n \n \tif (getenv(NO_REPLACE_OBJECTS_ENVIRONMENT))\n \t\tread_replace_refs = 0;\ndiff --git a/exec-cmd.c b/exec-cmd.c\nindex bb24c2f3bc..0f8e888424 100644\n--- a/exec-cmd.c\n+++ b/exec-cmd.c\n@@ -320,16 +320,16 @@ void setup_path(void)\n \tstrbuf_release(&new_path);\n }\n \n-const char **prepare_git_cmd(struct argv_array *out, const char **argv)\n+const char **prepare_git_cmd(struct strvec *out, const char **argv)\n {\n-\targv_array_push(out, \"git\");\n-\targv_array_pushv(out, argv);\n+\tstrvec_push(out, \"git\");\n+\tstrvec_pushv(out, argv);\n \treturn out->argv;\n }\n \n int execv_git_cmd(const char **argv)\n {\n-\tstruct argv_array nargv = ARGV_ARRAY_INIT;\n+\tstruct strvec nargv = STRVEC_INIT;\n \n \tprepare_git_cmd(&nargv, argv);\n \ttrace_argv_printf(nargv.argv, \"trace: exec:\");\n@@ -339,7 +339,7 @@ int execv_git_cmd(const char **argv)\n \n \ttrace_printf(\"trace: exec failed: %s\\n\", strerror(errno));\n \n-\targv_array_clear(&nargv);\n+\tstrvec_clear(&nargv);\n \treturn -1;\n }\n \ndiff --git a/fast-import.c b/fast-import.c\nindex 0dfa14dc8c..ce47794db6 100644\n--- a/fast-import.c\n+++ b/fast-import.c\n@@ -843,9 +843,9 @@ static int loosen_small_pack(const struct packed_git *p)\n \tunpack.in = p->pack_fd;\n \tunpack.git_cmd = 1;\n \tunpack.stdout_to_stderr = 1;\n-\targv_array_push(&unpack.args, \"unpack-objects\");\n+\tstrvec_push(&unpack.args, \"unpack-objects\");\n \tif (!show_stats)\n-\t\targv_array_push(&unpack.args, \"-q\");\n+\t\tstrvec_push(&unpack.args, \"-q\");\n \n \treturn run_command(&unpack);\n }\ndiff --git a/fetch-pack.c b/fetch-pack.c\nindex 80fb3bd899..7aa5dfbdad 100644\n--- a/fetch-pack.c\n+++ b/fetch-pack.c\n@@ -835,30 +835,30 @@ static int get_pack(struct fetch_pack_args *args,\n \t}\n \n \tif (alternate_shallow_file) {\n-\t\targv_array_push(&cmd.args, \"--shallow-file\");\n-\t\targv_array_push(&cmd.args, alternate_shallow_file);\n+\t\tstrvec_push(&cmd.args, \"--shallow-file\");\n+\t\tstrvec_push(&cmd.args, alternate_shallow_file);\n \t}\n \n \tif (do_keep || args->from_promisor) {\n \t\tif (pack_lockfiles)\n \t\t\tcmd.out = -1;\n \t\tcmd_name = \"index-pack\";\n-\t\targv_array_push(&cmd.args, cmd_name);\n-\t\targv_array_push(&cmd.args, \"--stdin\");\n+\t\tstrvec_push(&cmd.args, cmd_name);\n+\t\tstrvec_push(&cmd.args, \"--stdin\");\n \t\tif (!args->quiet && !args->no_progress)\n-\t\t\targv_array_push(&cmd.args, \"-v\");\n+\t\t\tstrvec_push(&cmd.args, \"-v\");\n \t\tif (args->use_thin_pack)\n-\t\t\targv_array_push(&cmd.args, \"--fix-thin\");\n+\t\t\tstrvec_push(&cmd.args, \"--fix-thin\");\n \t\tif (do_keep && (args->lock_pack || unpack_limit)) {\n \t\t\tchar hostname[HOST_NAME_MAX + 1];\n \t\t\tif (xgethostname(hostname, sizeof(hostname)))\n \t\t\t\txsnprintf(hostname, sizeof(hostname), \"localhost\");\n-\t\t\targv_array_pushf(&cmd.args,\n+\t\t\tstrvec_pushf(&cmd.args,\n \t\t\t\t\t\"--keep=fetch-pack %\"PRIuMAX \" on %s\",\n \t\t\t\t\t(uintmax_t)getpid(), hostname);\n \t\t}\n \t\tif (only_packfile && args->check_self_contained_and_connected)\n-\t\t\targv_array_push(&cmd.args, \"--check-self-contained-and-connected\");\n+\t\t\tstrvec_push(&cmd.args, \"--check-self-contained-and-connected\");\n \t\telse\n \t\t\t/*\n \t\t\t * We cannot perform any connectivity checks because\n@@ -873,18 +873,18 @@ static int get_pack(struct fetch_pack_args *args,\n \t\t * us.\n \t\t */\n \t\tif (!(do_keep && pack_lockfiles) && args->from_promisor)\n-\t\t\targv_array_push(&cmd.args, \"--promisor\");\n+\t\t\tstrvec_push(&cmd.args, \"--promisor\");\n \t}\n \telse {\n \t\tcmd_name = \"unpack-objects\";\n-\t\targv_array_push(&cmd.args, cmd_name);\n+\t\tstrvec_push(&cmd.args, cmd_name);\n \t\tif (args->quiet || args->no_progress)\n-\t\t\targv_array_push(&cmd.args, \"-q\");\n+\t\t\tstrvec_push(&cmd.args, \"-q\");\n \t\targs->check_self_contained_and_connected = 0;\n \t}\n \n \tif (pass_header)\n-\t\targv_array_pushf(&cmd.args, \"--pack_header=%\"PRIu32\",%\"PRIu32,\n+\t\tstrvec_pushf(&cmd.args, \"--pack_header=%\"PRIu32\",%\"PRIu32,\n \t\t\t\t ntohl(header.hdr_version),\n \t\t\t\t ntohl(header.hdr_entries));\n \tif (fetch_fsck_objects >= 0\n@@ -898,9 +898,9 @@ static int get_pack(struct fetch_pack_args *args,\n \t\t\t * checks both broken objects and links, but we only\n \t\t\t * want to check for broken objects.\n \t\t\t */\n-\t\t\targv_array_push(&cmd.args, \"--fsck-objects\");\n+\t\t\tstrvec_push(&cmd.args, \"--fsck-objects\");\n \t\telse\n-\t\t\targv_array_pushf(&cmd.args, \"--strict%s\",\n+\t\t\tstrvec_pushf(&cmd.args, \"--strict%s\",\n \t\t\t\t\t fsck_msg_types.buf);\n \t}\n \n@@ -1652,11 +1652,11 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,\n \t\tconst char *uri = packfile_uris.items[i].string +\n \t\t\tthe_hash_algo->hexsz + 1;\n \n-\t\targv_array_push(&cmd.args, \"http-fetch\");\n-\t\targv_array_pushf(&cmd.args, \"--packfile=%.*s\",\n+\t\tstrvec_push(&cmd.args, \"http-fetch\");\n+\t\tstrvec_pushf(&cmd.args, \"--packfile=%.*s\",\n \t\t\t\t (int) the_hash_algo->hexsz,\n \t\t\t\t packfile_uris.items[i].string);\n-\t\targv_array_push(&cmd.args, uri);\n+\t\tstrvec_push(&cmd.args, uri);\n \t\tcmd.git_cmd = 1;\n \t\tcmd.no_stdin = 1;\n \t\tcmd.out = -1;\ndiff --git a/fsmonitor.c b/fsmonitor.c\nindex 932bd9012d..e3c982e814 100644\n--- a/fsmonitor.c\n+++ b/fsmonitor.c\n@@ -146,9 +146,9 @@ static int query_fsmonitor(int version, const char *last_update, struct strbuf *\n \tif (!core_fsmonitor)\n \t\treturn -1;\n \n-\targv_array_push(&cp.args, core_fsmonitor);\n-\targv_array_pushf(&cp.args, \"%d\", version);\n-\targv_array_pushf(&cp.args, \"%s\", last_update);\n+\tstrvec_push(&cp.args, core_fsmonitor);\n+\tstrvec_pushf(&cp.args, \"%d\", version);\n+\tstrvec_pushf(&cp.args, \"%s\", last_update);\n \tcp.use_shell = 1;\n \tcp.dir = get_git_work_tree();\n \ndiff --git a/git.c b/git.c\nindex 6cd887bb0c..258035cfb1 100644\n--- a/git.c\n+++ b/git.c\n@@ -349,8 +349,8 @@ static int handle_alias(int *argcp, const char ***argv)\n \t\t\tchild.clean_on_exit = 1;\n \t\t\tchild.wait_after_clean = 1;\n \t\t\tchild.trace2_child_class = \"shell_alias\";\n-\t\t\targv_array_push(&child.args, alias_string + 1);\n-\t\t\targv_array_pushv(&child.args, (*argv) + 1);\n+\t\t\tstrvec_push(&child.args, alias_string + 1);\n+\t\t\tstrvec_pushv(&child.args, (*argv) + 1);\n \n \t\t\ttrace2_cmd_alias(alias_command, child.args.argv);\n \t\t\ttrace2_cmd_list_config();\n@@ -646,7 +646,7 @@ static void strip_extension(const char **argv)\n \n static void handle_builtin(int argc, const char **argv)\n {\n-\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\tstruct strvec args = STRVEC_INIT;\n \tconst char *cmd;\n \tstruct cmd_struct *builtin;\n \n@@ -661,9 +661,9 @@ static void handle_builtin(int argc, const char **argv)\n \t\targv[0] = cmd = \"help\";\n \n \t\tfor (i = 0; i < argc; i++) {\n-\t\t\targv_array_push(&args, argv[i]);\n+\t\t\tstrvec_push(&args, argv[i]);\n \t\t\tif (!i)\n-\t\t\t\targv_array_push(&args, \"--exclude-guides\");\n+\t\t\t\tstrvec_push(&args, \"--exclude-guides\");\n \t\t}\n \n \t\targc++;\n@@ -673,7 +673,7 @@ static void handle_builtin(int argc, const char **argv)\n \tbuiltin = get_builtin(cmd);\n \tif (builtin)\n \t\texit(run_builtin(builtin, argc, argv));\n-\targv_array_clear(&args);\n+\tstrvec_clear(&args);\n }\n \n static void execv_dashed_external(const char **argv)\n@@ -688,8 +688,8 @@ static void execv_dashed_external(const char **argv)\n \t\tuse_pager = check_pager_config(argv[0]);\n \tcommit_pager_choice();\n \n-\targv_array_pushf(&cmd.args, \"git-%s\", argv[0]);\n-\targv_array_pushv(&cmd.args, argv + 1);\n+\tstrvec_pushf(&cmd.args, \"git-%s\", argv[0]);\n+\tstrvec_pushv(&cmd.args, argv + 1);\n \tcmd.clean_on_exit = 1;\n \tcmd.wait_after_clean = 1;\n \tcmd.silent_exec_failure = 1;\n@@ -741,7 +741,7 @@ static int run_argv(int *argcp, const char ***argv)\n \t\tif (!done_alias)\n \t\t\thandle_builtin(*argcp, *argv);\n \t\telse if (get_builtin(**argv)) {\n-\t\t\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\t\t\tstruct strvec args = STRVEC_INIT;\n \t\t\tint i;\n \n \t\t\t/*\n@@ -758,9 +758,9 @@ static int run_argv(int *argcp, const char ***argv)\n \n \t\t\tcommit_pager_choice();\n \n-\t\t\targv_array_push(&args, \"git\");\n+\t\t\tstrvec_push(&args, \"git\");\n \t\t\tfor (i = 0; i < *argcp; i++)\n-\t\t\t\targv_array_push(&args, (*argv)[i]);\n+\t\t\t\tstrvec_push(&args, (*argv)[i]);\n \n \t\t\ttrace_argv_printf(args.argv, \"trace: exec:\");\n \ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex 2d538bcd6e..cf56fe838f 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -282,9 +282,9 @@ static int verify_signed_buffer(const char *payload, size_t payload_size,\n \tif (!fmt)\n \t\tBUG(\"bad signature '%s'\", signature);\n \n-\targv_array_push(&gpg.args, fmt->program);\n-\targv_array_pushv(&gpg.args, fmt->verify_args);\n-\targv_array_pushl(&gpg.args,\n+\tstrvec_push(&gpg.args, fmt->program);\n+\tstrvec_pushv(&gpg.args, fmt->verify_args);\n+\tstrvec_pushl(&gpg.args,\n \t\t\t \"--status-fd=1\",\n \t\t\t \"--verify\", temp->filename.buf, \"-\",\n \t\t\t NULL);\n@@ -434,7 +434,7 @@ int sign_buffer(struct strbuf *buffer, struct strbuf *signature, const char *sig\n \tsize_t i, j, bottom;\n \tstruct strbuf gpg_status = STRBUF_INIT;\n \n-\targv_array_pushl(&gpg.args,\n+\tstrvec_pushl(&gpg.args,\n \t\t\t use_format->program,\n \t\t\t \"--status-fd=2\",\n \t\t\t \"-bsau\", signing_key,\ndiff --git a/graph.c b/graph.c\nindex 96af8f605a..09c9cc968c 100644\n--- a/graph.c\n+++ b/graph.c\n@@ -82,7 +82,7 @@ static void graph_show_line_prefix(const struct diff_options *diffopt)\n static const char **column_colors;\n static unsigned short column_colors_max;\n \n-static void parse_graph_colors_config(struct argv_array *colors, const char *string)\n+static void parse_graph_colors_config(struct strvec *colors, const char *string)\n {\n \tconst char *end, *start;\n \n@@ -93,13 +93,13 @@ static void parse_graph_colors_config(struct argv_array *colors, const char *str\n \t\tchar color[COLOR_MAXLEN];\n \n \t\tif (!color_parse_mem(start, comma - start, color))\n-\t\t\targv_array_push(colors, color);\n+\t\t\tstrvec_push(colors, color);\n \t\telse\n \t\t\twarning(_(\"ignore invalid color '%.*s' in log.graphColors\"),\n \t\t\t\t(int)(comma - start), start);\n \t\tstart = comma + 1;\n \t}\n-\targv_array_push(colors, GIT_COLOR_RESET);\n+\tstrvec_push(colors, GIT_COLOR_RESET);\n }\n \n void graph_set_column_colors(const char **colors, unsigned short colors_max)\n@@ -350,8 +350,8 @@ struct git_graph *graph_init(struct rev_info *opt)\n \t\t\tgraph_set_column_colors(column_colors_ansi,\n \t\t\t\t\t\tcolumn_colors_ansi_max);\n \t\t} else {\n-\t\t\tstatic struct argv_array custom_colors = ARGV_ARRAY_INIT;\n-\t\t\targv_array_clear(&custom_colors);\n+\t\t\tstatic struct strvec custom_colors = STRVEC_INIT;\n+\t\t\tstrvec_clear(&custom_colors);\n \t\t\tparse_graph_colors_config(&custom_colors, string);\n \t\t\tfree(string);\n \t\t\t/* graph_set_column_colors takes a max-index, not a count */\ndiff --git a/http-backend.c b/http-backend.c\nindex 6a42badf33..92fd62f73f 100644\n--- a/http-backend.c\n+++ b/http-backend.c\n@@ -477,9 +477,9 @@ static void run_service(const char **argv, int buffer_input)\n \t\thost = \"(none)\";\n \n \tif (!getenv(\"GIT_COMMITTER_NAME\"))\n-\t\targv_array_pushf(&cld.env_array, \"GIT_COMMITTER_NAME=%s\", user);\n+\t\tstrvec_pushf(&cld.env_array, \"GIT_COMMITTER_NAME=%s\", user);\n \tif (!getenv(\"GIT_COMMITTER_EMAIL\"))\n-\t\targv_array_pushf(&cld.env_array,\n+\t\tstrvec_pushf(&cld.env_array,\n \t\t\t\t \"GIT_COMMITTER_EMAIL=%s@http.%s\", user, host);\n \n \tcld.argv = argv;\ndiff --git a/http-push.c b/http-push.c\nindex 3a47921cc3..e1deea6fe4 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -1846,7 +1846,7 @@ int cmd_main(int argc, const char **argv)\n \n \tnew_refs = 0;\n \tfor (ref = remote_refs; ref; ref = ref->next) {\n-\t\tstruct argv_array commit_argv = ARGV_ARRAY_INIT;\n+\t\tstruct strvec commit_argv = STRVEC_INIT;\n \n \t\tif (!ref->peer_ref)\n \t\t\tcontinue;\n@@ -1924,11 +1924,11 @@ int cmd_main(int argc, const char **argv)\n \t\t}\n \n \t\t/* Set up revision info for this refspec */\n-\t\targv_array_push(&commit_argv, \"\"); /* ignored */\n-\t\targv_array_push(&commit_argv, \"--objects\");\n-\t\targv_array_push(&commit_argv, oid_to_hex(&ref->new_oid));\n+\t\tstrvec_push(&commit_argv, \"\"); /* ignored */\n+\t\tstrvec_push(&commit_argv, \"--objects\");\n+\t\tstrvec_push(&commit_argv, oid_to_hex(&ref->new_oid));\n \t\tif (!push_all && !is_null_oid(&ref->old_oid))\n-\t\t\targv_array_pushf(&commit_argv, \"^%s\",\n+\t\t\tstrvec_pushf(&commit_argv, \"^%s\",\n \t\t\t\t\t oid_to_hex(&ref->old_oid));\n \t\trepo_init_revisions(the_repository, &revs, setup_git_directory());\n \t\tsetup_revisions(commit_argv.argc, commit_argv.argv, &revs, NULL);\n@@ -1961,7 +1961,7 @@ int cmd_main(int argc, const char **argv)\n \t\t\tprintf(\"%s %s\\n\", !rc ? \"ok\" : \"error\", ref->name);\n \t\tunlock_remote(ref_lock);\n \t\tcheck_locks();\n-\t\targv_array_clear(&commit_argv);\n+\t\tstrvec_clear(&commit_argv);\n \t}\n \n \t/* Update remote server info if appropriate */\ndiff --git a/http.c b/http.c\nindex 3b12843a5b..268a1e9744 100644\n--- a/http.c\n+++ b/http.c\n@@ -2270,12 +2270,12 @@ int finish_http_pack_request(struct http_pack_request *preq)\n \n \ttmpfile_fd = xopen(preq->tmpfile.buf, O_RDONLY);\n \n-\targv_array_push(&ip.args, \"index-pack\");\n-\targv_array_push(&ip.args, \"--stdin\");\n+\tstrvec_push(&ip.args, \"index-pack\");\n+\tstrvec_push(&ip.args, \"--stdin\");\n \tip.git_cmd = 1;\n \tip.in = tmpfile_fd;\n \tif (preq->generate_keep) {\n-\t\targv_array_pushf(&ip.args, \"--keep=git %\"PRIuMAX,\n+\t\tstrvec_pushf(&ip.args, \"--keep=git %\"PRIuMAX,\n \t\t\t\t (uintmax_t)getpid());\n \t\tip.out = 0;\n \t} else {\ndiff --git a/imap-send.c b/imap-send.c\nindex 52737546f3..5764dd812c 100644\n--- a/imap-send.c\n+++ b/imap-send.c\n@@ -976,7 +976,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, char *f\n \n \t\timap_info(\"Starting tunnel '%s'... \", srvc->tunnel);\n \n-\t\targv_array_push(&tunnel.args, srvc->tunnel);\n+\t\tstrvec_push(&tunnel.args, srvc->tunnel);\n \t\ttunnel.use_shell = 1;\n \t\ttunnel.in = -1;\n \t\ttunnel.out = -1;\ndiff --git a/line-log.c b/line-log.c\nindex 05d077b8e7..bf73ea95ac 100644\n--- a/line-log.c\n+++ b/line-log.c\n@@ -758,12 +758,12 @@ static void parse_pathspec_from_ranges(struct pathspec *pathspec,\n \t\t\t\t       struct line_log_data *range)\n {\n \tstruct line_log_data *r;\n-\tstruct argv_array array = ARGV_ARRAY_INIT;\n+\tstruct strvec array = STRVEC_INIT;\n \tconst char **paths;\n \n \tfor (r = range; r; r = r->next)\n-\t\targv_array_push(&array, r->path);\n-\tpaths = argv_array_detach(&array);\n+\t\tstrvec_push(&array, r->path);\n+\tpaths = strvec_detach(&array);\n \n \tparse_pathspec(pathspec, 0, PATHSPEC_PREFER_FULL, \"\", paths);\n \t/* strings are now owned by pathspec */\ndiff --git a/ls-refs.c b/ls-refs.c\nindex 98fb19092a..8192c949f4 100644\n--- a/ls-refs.c\n+++ b/ls-refs.c\n@@ -11,7 +11,7 @@\n  * Check if one of the prefixes is a prefix of the ref.\n  * If no prefixes were provided, all refs match.\n  */\n-static int ref_match(const struct argv_array *prefixes, const char *refname)\n+static int ref_match(const struct strvec *prefixes, const char *refname)\n {\n \tint i;\n \n@@ -31,7 +31,7 @@ static int ref_match(const struct argv_array *prefixes, const char *refname)\n struct ls_refs_data {\n \tunsigned peel;\n \tunsigned symrefs;\n-\tstruct argv_array prefixes;\n+\tstruct strvec prefixes;\n };\n \n static int send_ref(const char *refname, const struct object_id *oid,\n@@ -84,7 +84,7 @@ static int ls_refs_config(const char *var, const char *value, void *data)\n \treturn parse_hide_refs_config(var, value, \"uploadpack\");\n }\n \n-int ls_refs(struct repository *r, struct argv_array *keys,\n+int ls_refs(struct repository *r, struct strvec *keys,\n \t    struct packet_reader *request)\n {\n \tstruct ls_refs_data data;\n@@ -102,7 +102,7 @@ int ls_refs(struct repository *r, struct argv_array *keys,\n \t\telse if (!strcmp(\"symrefs\", arg))\n \t\t\tdata.symrefs = 1;\n \t\telse if (skip_prefix(arg, \"ref-prefix \", &out))\n-\t\t\targv_array_push(&data.prefixes, out);\n+\t\t\tstrvec_push(&data.prefixes, out);\n \t}\n \n \tif (request->status != PACKET_READ_FLUSH)\n@@ -111,6 +111,6 @@ int ls_refs(struct repository *r, struct argv_array *keys,\n \thead_ref_namespaced(send_ref, &data);\n \tfor_each_namespaced_ref(send_ref, &data);\n \tpacket_flush(1);\n-\targv_array_clear(&data.prefixes);\n+\tstrvec_clear(&data.prefixes);\n \treturn 0;\n }\n-- \n2.28.0.rc2.475.g53c7e1c7f4\n\n"},{"id":"402236","messageId":"20200728202512.GG1021513@coredump.intra.peff.net","threadId":"53940","inReplyTo":"20200728202124.GA1021264@coredump.intra.peff.net","subject":"[PATCH 07/11] strvec: convert remaining callers away from argv_array name","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-28T20:25:12Z","receivedAt":"2020-07-28T20:25:20Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"We eventually want to drop the argv_array name and just use strvec\nconsistently. There's no particular reason we have to do it all at once,\nor care about interactions between converted and unconverted bits.\nBecause of our preprocessor compat layer, the names are interchangeable\nto the compiler (so even a definition and declaration using different\nnames is OK).\n\nThis patch converts all of the remaining files, as the resulting diff is\nreasonably sized.\n\nThe conversion was done purely mechanically with:\n\n  git ls-files '*.c' '*.h' |\n  xargs perl -i -pe '\n    s/ARGV_ARRAY/STRVEC/g;\n    s/argv_array/strvec/g;\n  '\n\nWe'll deal with any indentation/style fallouts separately.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n merge.c                     |  16 ++--\n midx.c                      |  12 +--\n pager.c                     |   8 +-\n parse-options-cb.c          |   6 +-\n pathspec.c                  |   6 +-\n quote.c                     |   4 +-\n range-diff.c                |  10 +-\n range-diff.h                |   2 +-\n ref-filter.c                |   6 +-\n refs.c                      |   6 +-\n refspec.c                   |   4 +-\n remote-curl.c               |  86 ++++++++---------\n remote-testsvn.c            |   8 +-\n remote.c                    |  12 +--\n revision.c                  |  14 +--\n run-command.c               |  50 +++++-----\n run-command.h               |  10 +-\n send-pack.c                 |  18 ++--\n sequencer.c                 | 112 +++++++++++------------\n serve.c                     |  12 +--\n sha1-file.c                 |  14 +--\n sub-process.c               |   2 +-\n submodule.c                 | 178 ++++++++++++++++++------------------\n t/helper/test-run-command.c |  36 ++++----\n tmp-objdir.c                |  16 ++--\n transport-helper.c          |  30 +++---\n transport-internal.h        |   2 +-\n transport.c                 |  12 +--\n transport.h                 |   2 +-\n unpack-trees.c              |  10 +-\n unpack-trees.h              |   2 +-\n upload-pack.c               |  48 +++++-----\n wt-status.c                 |  16 ++--\n 33 files changed, 385 insertions(+), 385 deletions(-)\n\ndiff --git a/merge.c b/merge.c\nindex aa36de2f64..a05b054faa 100644\n--- a/merge.c\n+++ b/merge.c\n@@ -19,22 +19,22 @@ int try_merge_command(struct repository *r,\n \t\t      const char **xopts, struct commit_list *common,\n \t\t      const char *head_arg, struct commit_list *remotes)\n {\n-\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\tstruct strvec args = STRVEC_INIT;\n \tint i, ret;\n \tstruct commit_list *j;\n \n-\targv_array_pushf(&args, \"merge-%s\", strategy);\n+\tstrvec_pushf(&args, \"merge-%s\", strategy);\n \tfor (i = 0; i < xopts_nr; i++)\n-\t\targv_array_pushf(&args, \"--%s\", xopts[i]);\n+\t\tstrvec_pushf(&args, \"--%s\", xopts[i]);\n \tfor (j = common; j; j = j->next)\n-\t\targv_array_push(&args, merge_argument(j->item));\n-\targv_array_push(&args, \"--\");\n-\targv_array_push(&args, head_arg);\n+\t\tstrvec_push(&args, merge_argument(j->item));\n+\tstrvec_push(&args, \"--\");\n+\tstrvec_push(&args, head_arg);\n \tfor (j = remotes; j; j = j->next)\n-\t\targv_array_push(&args, merge_argument(j->item));\n+\t\tstrvec_push(&args, merge_argument(j->item));\n \n \tret = run_command_v_opt(args.argv, RUN_GIT_CMD);\n-\targv_array_clear(&args);\n+\tstrvec_clear(&args);\n \n \tdiscard_index(r->index);\n \tif (repo_read_index(r) < 0)\ndiff --git a/midx.c b/midx.c\nindex 6d1584ca51..a5fb797ede 100644\n--- a/midx.c\n+++ b/midx.c\n@@ -1408,21 +1408,21 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,\n \trepo_config_get_bool(r, \"repack.usedeltabaseoffset\", &delta_base_offset);\n \trepo_config_get_bool(r, \"repack.usedeltaislands\", &use_delta_islands);\n \n-\targv_array_push(&cmd.args, \"pack-objects\");\n+\tstrvec_push(&cmd.args, \"pack-objects\");\n \n \tstrbuf_addstr(&base_name, object_dir);\n \tstrbuf_addstr(&base_name, \"/pack/pack\");\n-\targv_array_push(&cmd.args, base_name.buf);\n+\tstrvec_push(&cmd.args, base_name.buf);\n \n \tif (delta_base_offset)\n-\t\targv_array_push(&cmd.args, \"--delta-base-offset\");\n+\t\tstrvec_push(&cmd.args, \"--delta-base-offset\");\n \tif (use_delta_islands)\n-\t\targv_array_push(&cmd.args, \"--delta-islands\");\n+\t\tstrvec_push(&cmd.args, \"--delta-islands\");\n \n \tif (flags & MIDX_PROGRESS)\n-\t\targv_array_push(&cmd.args, \"--progress\");\n+\t\tstrvec_push(&cmd.args, \"--progress\");\n \telse\n-\t\targv_array_push(&cmd.args, \"-q\");\n+\t\tstrvec_push(&cmd.args, \"-q\");\n \n \tstrbuf_release(&base_name);\n \ndiff --git a/pager.c b/pager.c\nindex 41446d4f05..ee435de675 100644\n--- a/pager.c\n+++ b/pager.c\n@@ -68,7 +68,7 @@ const char *git_pager(int stdout_is_tty)\n \treturn pager;\n }\n \n-static void setup_pager_env(struct argv_array *env)\n+static void setup_pager_env(struct strvec *env)\n {\n \tconst char **argv;\n \tint i;\n@@ -88,7 +88,7 @@ static void setup_pager_env(struct argv_array *env)\n \t\t*cp = '\\0';\n \t\tif (!getenv(argv[i])) {\n \t\t\t*cp = '=';\n-\t\t\targv_array_push(env, argv[i]);\n+\t\t\tstrvec_push(env, argv[i]);\n \t\t}\n \t}\n \tfree(pager_env);\n@@ -97,7 +97,7 @@ static void setup_pager_env(struct argv_array *env)\n \n void prepare_pager_args(struct child_process *pager_process, const char *pager)\n {\n-\targv_array_push(&pager_process->args, pager);\n+\tstrvec_push(&pager_process->args, pager);\n \tpager_process->use_shell = 1;\n \tsetup_pager_env(&pager_process->env_array);\n \tpager_process->trace2_child_class = \"pager\";\n@@ -126,7 +126,7 @@ void setup_pager(void)\n \t/* spawn the pager */\n \tprepare_pager_args(&pager_process, pager);\n \tpager_process.in = -1;\n-\targv_array_push(&pager_process.env_array, \"GIT_PAGER_IN_USE\");\n+\tstrvec_push(&pager_process.env_array, \"GIT_PAGER_IN_USE\");\n \tif (start_command(&pager_process))\n \t\treturn;\n \ndiff --git a/parse-options-cb.c b/parse-options-cb.c\nindex 7cba96454c..d9d3b0819f 100644\n--- a/parse-options-cb.c\n+++ b/parse-options-cb.c\n@@ -275,19 +275,19 @@ int parse_opt_passthru(const struct option *opt, const char *arg, int unset)\n \n /**\n  * For an option opt, recreate the command-line option, appending it to\n- * opt->value which must be a argv_array. This is useful when we need to pass\n+ * opt->value which must be a strvec. This is useful when we need to pass\n  * the command-line option, which can be specified multiple times, to another\n  * command.\n  */\n int parse_opt_passthru_argv(const struct option *opt, const char *arg, int unset)\n {\n \tstatic struct strbuf sb = STRBUF_INIT;\n-\tstruct argv_array *opt_value = opt->value;\n+\tstruct strvec *opt_value = opt->value;\n \n \tif (recreate_opt(&sb, opt, arg, unset) < 0)\n \t\treturn -1;\n \n-\targv_array_push(opt_value, sb.buf);\n+\tstrvec_push(opt_value, sb.buf);\n \n \treturn 0;\n }\ndiff --git a/pathspec.c b/pathspec.c\nindex 57c9b58418..c303126f37 100644\n--- a/pathspec.c\n+++ b/pathspec.c\n@@ -624,7 +624,7 @@ void parse_pathspec_file(struct pathspec *pathspec, unsigned magic_mask,\n \t\t\t unsigned flags, const char *prefix,\n \t\t\t const char *file, int nul_term_line)\n {\n-\tstruct argv_array parsed_file = ARGV_ARRAY_INIT;\n+\tstruct strvec parsed_file = STRVEC_INIT;\n \tstrbuf_getline_fn getline_fn = nul_term_line ? strbuf_getline_nul :\n \t\t\t\t\t\t       strbuf_getline;\n \tstruct strbuf buf = STRBUF_INIT;\n@@ -643,7 +643,7 @@ void parse_pathspec_file(struct pathspec *pathspec, unsigned magic_mask,\n \t\t\t\tdie(_(\"line is badly quoted: %s\"), buf.buf);\n \t\t\tstrbuf_swap(&buf, &unquoted);\n \t\t}\n-\t\targv_array_push(&parsed_file, buf.buf);\n+\t\tstrvec_push(&parsed_file, buf.buf);\n \t\tstrbuf_reset(&buf);\n \t}\n \n@@ -653,7 +653,7 @@ void parse_pathspec_file(struct pathspec *pathspec, unsigned magic_mask,\n \t\tfclose(in);\n \n \tparse_pathspec(pathspec, magic_mask, flags, prefix, parsed_file.argv);\n-\targv_array_clear(&parsed_file);\n+\tstrvec_clear(&parsed_file);\n }\n \n void copy_pathspec(struct pathspec *dst, const struct pathspec *src)\ndiff --git a/quote.c b/quote.c\nindex 10b383cc1d..ced0245e80 100644\n--- a/quote.c\n+++ b/quote.c\n@@ -172,7 +172,7 @@ char *sq_dequote(char *arg)\n \n static int sq_dequote_to_argv_internal(char *arg,\n \t\t\t\t       const char ***argv, int *nr, int *alloc,\n-\t\t\t\t       struct argv_array *array)\n+\t\t\t\t       struct strvec *array)\n {\n \tchar *next = arg;\n \n@@ -187,7 +187,7 @@ static int sq_dequote_to_argv_internal(char *arg,\n \t\t\t(*argv)[(*nr)++] = dequoted;\n \t\t}\n \t\tif (array)\n-\t\t\targv_array_push(array, dequoted);\n+\t\t\tstrvec_push(array, dequoted);\n \t} while (next);\n \n \treturn 0;\ndiff --git a/range-diff.c b/range-diff.c\nindex b4d1d56445..3a0eb70c89 100644\n--- a/range-diff.c\n+++ b/range-diff.c\n@@ -41,7 +41,7 @@ static size_t find_end_of_line(char *buffer, unsigned long size)\n  * as struct object_id (will need to be free()d).\n  */\n static int read_patches(const char *range, struct string_list *list,\n-\t\t\tconst struct argv_array *other_arg)\n+\t\t\tconst struct strvec *other_arg)\n {\n \tstruct child_process cp = CHILD_PROCESS_INIT;\n \tstruct strbuf buf = STRBUF_INIT, contents = STRBUF_INIT;\n@@ -51,7 +51,7 @@ static int read_patches(const char *range, struct string_list *list,\n \tint offset, len;\n \tsize_t size;\n \n-\targv_array_pushl(&cp.args, \"log\", \"--no-color\", \"-p\", \"--no-merges\",\n+\tstrvec_pushl(&cp.args, \"log\", \"--no-color\", \"-p\", \"--no-merges\",\n \t\t\t\"--reverse\", \"--date-order\", \"--decorate=no\",\n \t\t\t\"--no-prefix\",\n \t\t\t/*\n@@ -67,8 +67,8 @@ static int read_patches(const char *range, struct string_list *list,\n \t\t\t\"--notes\",\n \t\t\tNULL);\n \tif (other_arg)\n-\t\targv_array_pushv(&cp.args, other_arg->argv);\n-\targv_array_push(&cp.args, range);\n+\t\tstrvec_pushv(&cp.args, other_arg->argv);\n+\tstrvec_push(&cp.args, range);\n \tcp.out = -1;\n \tcp.no_stdin = 1;\n \tcp.git_cmd = 1;\n@@ -523,7 +523,7 @@ static struct strbuf *output_prefix_cb(struct diff_options *opt, void *data)\n int show_range_diff(const char *range1, const char *range2,\n \t\t    int creation_factor, int dual_color,\n \t\t    const struct diff_options *diffopt,\n-\t\t    const struct argv_array *other_arg)\n+\t\t    const struct strvec *other_arg)\n {\n \tint res = 0;\n \ndiff --git a/range-diff.h b/range-diff.h\nindex 916f18bcd7..583ced2e8e 100644\n--- a/range-diff.h\n+++ b/range-diff.h\n@@ -14,6 +14,6 @@\n int show_range_diff(const char *range1, const char *range2,\n \t\t    int creation_factor, int dual_color,\n \t\t    const struct diff_options *diffopt,\n-\t\t    const struct argv_array *other_arg);\n+\t\t    const struct strvec *other_arg);\n \n #endif\ndiff --git a/ref-filter.c b/ref-filter.c\nindex 81c4399da9..7f013851ed 100644\n--- a/ref-filter.c\n+++ b/ref-filter.c\n@@ -1914,15 +1914,15 @@ static void find_longest_prefixes_1(struct string_list *out,\n static void find_longest_prefixes(struct string_list *out,\n \t\t\t\t  const char **patterns)\n {\n-\tstruct argv_array sorted = ARGV_ARRAY_INIT;\n+\tstruct strvec sorted = STRVEC_INIT;\n \tstruct strbuf prefix = STRBUF_INIT;\n \n-\targv_array_pushv(&sorted, patterns);\n+\tstrvec_pushv(&sorted, patterns);\n \tQSORT(sorted.argv, sorted.argc, qsort_strcmp);\n \n \tfind_longest_prefixes_1(out, &prefix, sorted.argv, sorted.argc);\n \n-\targv_array_clear(&sorted);\n+\tstrvec_clear(&sorted);\n \tstrbuf_release(&prefix);\n }\n \ndiff --git a/refs.c b/refs.c\nindex 0067926262..d8d3b10fbd 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -553,13 +553,13 @@ int refname_match(const char *abbrev_name, const char *full_name)\n  * Given a 'prefix' expand it by the rules in 'ref_rev_parse_rules' and add\n  * the results to 'prefixes'\n  */\n-void expand_ref_prefix(struct argv_array *prefixes, const char *prefix)\n+void expand_ref_prefix(struct strvec *prefixes, const char *prefix)\n {\n \tconst char **p;\n \tint len = strlen(prefix);\n \n \tfor (p = ref_rev_parse_rules; *p; p++)\n-\t\targv_array_pushf(prefixes, *p, len, prefix);\n+\t\tstrvec_pushf(prefixes, *p, len, prefix);\n }\n \n char *repo_default_branch_name(struct repository *r)\n@@ -2037,7 +2037,7 @@ static int run_transaction_hook(struct ref_transaction *transaction,\n \t\treturn ret;\n \t}\n \n-\targv_array_pushl(&proc.args, hook, state, NULL);\n+\tstrvec_pushl(&proc.args, hook, state, NULL);\n \tproc.in = -1;\n \tproc.stdout_to_stderr = 1;\n \tproc.trace2_hook_name = \"reference-transaction\";\ndiff --git a/refspec.c b/refspec.c\nindex f9fb67d295..6f317d6b44 100644\n--- a/refspec.c\n+++ b/refspec.c\n@@ -202,7 +202,7 @@ int valid_fetch_refspec(const char *fetch_refspec_str)\n }\n \n void refspec_ref_prefixes(const struct refspec *rs,\n-\t\t\t  struct argv_array *ref_prefixes)\n+\t\t\t  struct strvec *ref_prefixes)\n {\n \tint i;\n \tfor (i = 0; i < rs->nr; i++) {\n@@ -221,7 +221,7 @@ void refspec_ref_prefixes(const struct refspec *rs,\n \t\tif (prefix) {\n \t\t\tif (item->pattern) {\n \t\t\t\tconst char *glob = strchr(prefix, '*');\n-\t\t\t\targv_array_pushf(ref_prefixes, \"%.*s\",\n+\t\t\t\tstrvec_pushf(ref_prefixes, \"%.*s\",\n \t\t\t\t\t\t (int)(glob - prefix),\n \t\t\t\t\t\t prefix);\n \t\t\t} else {\ndiff --git a/remote-curl.c b/remote-curl.c\nindex 05fb794ddd..85ce4f7e6f 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -1141,41 +1141,41 @@ static int fetch_git(struct discovery *heads,\n \tstruct rpc_state rpc;\n \tstruct strbuf preamble = STRBUF_INIT;\n \tint i, err;\n-\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\tstruct strvec args = STRVEC_INIT;\n \tstruct strbuf rpc_result = STRBUF_INIT;\n \n-\targv_array_pushl(&args, \"fetch-pack\", \"--stateless-rpc\",\n+\tstrvec_pushl(&args, \"fetch-pack\", \"--stateless-rpc\",\n \t\t\t \"--stdin\", \"--lock-pack\", NULL);\n \tif (options.followtags)\n-\t\targv_array_push(&args, \"--include-tag\");\n+\t\tstrvec_push(&args, \"--include-tag\");\n \tif (options.thin)\n-\t\targv_array_push(&args, \"--thin\");\n+\t\tstrvec_push(&args, \"--thin\");\n \tif (options.verbosity >= 3)\n-\t\targv_array_pushl(&args, \"-v\", \"-v\", NULL);\n+\t\tstrvec_pushl(&args, \"-v\", \"-v\", NULL);\n \tif (options.check_self_contained_and_connected)\n-\t\targv_array_push(&args, \"--check-self-contained-and-connected\");\n+\t\tstrvec_push(&args, \"--check-self-contained-and-connected\");\n \tif (options.cloning)\n-\t\targv_array_push(&args, \"--cloning\");\n+\t\tstrvec_push(&args, \"--cloning\");\n \tif (options.update_shallow)\n-\t\targv_array_push(&args, \"--update-shallow\");\n+\t\tstrvec_push(&args, \"--update-shallow\");\n \tif (!options.progress)\n-\t\targv_array_push(&args, \"--no-progress\");\n+\t\tstrvec_push(&args, \"--no-progress\");\n \tif (options.depth)\n-\t\targv_array_pushf(&args, \"--depth=%lu\", options.depth);\n+\t\tstrvec_pushf(&args, \"--depth=%lu\", options.depth);\n \tif (options.deepen_since)\n-\t\targv_array_pushf(&args, \"--shallow-since=%s\", options.deepen_since);\n+\t\tstrvec_pushf(&args, \"--shallow-since=%s\", options.deepen_since);\n \tfor (i = 0; i < options.deepen_not.nr; i++)\n-\t\targv_array_pushf(&args, \"--shallow-exclude=%s\",\n+\t\tstrvec_pushf(&args, \"--shallow-exclude=%s\",\n \t\t\t\t options.deepen_not.items[i].string);\n \tif (options.deepen_relative && options.depth)\n-\t\targv_array_push(&args, \"--deepen-relative\");\n+\t\tstrvec_push(&args, \"--deepen-relative\");\n \tif (options.from_promisor)\n-\t\targv_array_push(&args, \"--from-promisor\");\n+\t\tstrvec_push(&args, \"--from-promisor\");\n \tif (options.no_dependents)\n-\t\targv_array_push(&args, \"--no-dependents\");\n+\t\tstrvec_push(&args, \"--no-dependents\");\n \tif (options.filter)\n-\t\targv_array_pushf(&args, \"--filter=%s\", options.filter);\n-\targv_array_push(&args, url.buf);\n+\t\tstrvec_pushf(&args, \"--filter=%s\", options.filter);\n+\tstrvec_push(&args, url.buf);\n \n \tfor (i = 0; i < nr_heads; i++) {\n \t\tstruct ref *ref = to_fetch[i];\n@@ -1195,7 +1195,7 @@ static int fetch_git(struct discovery *heads,\n \t\twrite_or_die(1, rpc_result.buf, rpc_result.len);\n \tstrbuf_release(&rpc_result);\n \tstrbuf_release(&preamble);\n-\targv_array_clear(&args);\n+\tstrvec_clear(&args);\n \treturn err;\n }\n \n@@ -1267,15 +1267,15 @@ static int push_dav(int nr_spec, const char **specs)\n \tsize_t i;\n \n \tchild.git_cmd = 1;\n-\targv_array_push(&child.args, \"http-push\");\n-\targv_array_push(&child.args, \"--helper-status\");\n+\tstrvec_push(&child.args, \"http-push\");\n+\tstrvec_push(&child.args, \"--helper-status\");\n \tif (options.dry_run)\n-\t\targv_array_push(&child.args, \"--dry-run\");\n+\t\tstrvec_push(&child.args, \"--dry-run\");\n \tif (options.verbosity > 1)\n-\t\targv_array_push(&child.args, \"--verbose\");\n-\targv_array_push(&child.args, url.buf);\n+\t\tstrvec_push(&child.args, \"--verbose\");\n+\tstrvec_push(&child.args, url.buf);\n \tfor (i = 0; i < nr_spec; i++)\n-\t\targv_array_push(&child.args, specs[i]);\n+\t\tstrvec_push(&child.args, specs[i]);\n \n \tif (run_command(&child))\n \t\tdie(_(\"git-http-push failed\"));\n@@ -1286,38 +1286,38 @@ static int push_git(struct discovery *heads, int nr_spec, const char **specs)\n {\n \tstruct rpc_state rpc;\n \tint i, err;\n-\tstruct argv_array args;\n+\tstruct strvec args;\n \tstruct string_list_item *cas_option;\n \tstruct strbuf preamble = STRBUF_INIT;\n \tstruct strbuf rpc_result = STRBUF_INIT;\n \n-\targv_array_init(&args);\n-\targv_array_pushl(&args, \"send-pack\", \"--stateless-rpc\", \"--helper-status\",\n+\tstrvec_init(&args);\n+\tstrvec_pushl(&args, \"send-pack\", \"--stateless-rpc\", \"--helper-status\",\n \t\t\t NULL);\n \n \tif (options.thin)\n-\t\targv_array_push(&args, \"--thin\");\n+\t\tstrvec_push(&args, \"--thin\");\n \tif (options.dry_run)\n-\t\targv_array_push(&args, \"--dry-run\");\n+\t\tstrvec_push(&args, \"--dry-run\");\n \tif (options.push_cert == SEND_PACK_PUSH_CERT_ALWAYS)\n-\t\targv_array_push(&args, \"--signed=yes\");\n+\t\tstrvec_push(&args, \"--signed=yes\");\n \telse if (options.push_cert == SEND_PACK_PUSH_CERT_IF_ASKED)\n-\t\targv_array_push(&args, \"--signed=if-asked\");\n+\t\tstrvec_push(&args, \"--signed=if-asked\");\n \tif (options.atomic)\n-\t\targv_array_push(&args, \"--atomic\");\n+\t\tstrvec_push(&args, \"--atomic\");\n \tif (options.verbosity == 0)\n-\t\targv_array_push(&args, \"--quiet\");\n+\t\tstrvec_push(&args, \"--quiet\");\n \telse if (options.verbosity > 1)\n-\t\targv_array_push(&args, \"--verbose\");\n+\t\tstrvec_push(&args, \"--verbose\");\n \tfor (i = 0; i < options.push_options.nr; i++)\n-\t\targv_array_pushf(&args, \"--push-option=%s\",\n+\t\tstrvec_pushf(&args, \"--push-option=%s\",\n \t\t\t\t options.push_options.items[i].string);\n-\targv_array_push(&args, options.progress ? \"--progress\" : \"--no-progress\");\n+\tstrvec_push(&args, options.progress ? \"--progress\" : \"--no-progress\");\n \tfor_each_string_list_item(cas_option, &cas_options)\n-\t\targv_array_push(&args, cas_option->string);\n-\targv_array_push(&args, url.buf);\n+\t\tstrvec_push(&args, cas_option->string);\n+\tstrvec_push(&args, url.buf);\n \n-\targv_array_push(&args, \"--stdin\");\n+\tstrvec_push(&args, \"--stdin\");\n \tfor (i = 0; i < nr_spec; i++)\n \t\tpacket_buf_write(&preamble, \"%s\\n\", specs[i]);\n \tpacket_buf_flush(&preamble);\n@@ -1330,7 +1330,7 @@ static int push_git(struct discovery *heads, int nr_spec, const char **specs)\n \t\twrite_or_die(1, rpc_result.buf, rpc_result.len);\n \tstrbuf_release(&rpc_result);\n \tstrbuf_release(&preamble);\n-\targv_array_clear(&args);\n+\tstrvec_clear(&args);\n \treturn err;\n }\n \n@@ -1349,13 +1349,13 @@ static int push(int nr_spec, const char **specs)\n \n static void parse_push(struct strbuf *buf)\n {\n-\tstruct argv_array specs = ARGV_ARRAY_INIT;\n+\tstruct strvec specs = STRVEC_INIT;\n \tint ret;\n \n \tdo {\n \t\tconst char *arg;\n \t\tif (skip_prefix(buf->buf, \"push \", &arg))\n-\t\t\targv_array_push(&specs, arg);\n+\t\t\tstrvec_push(&specs, arg);\n \t\telse\n \t\t\tdie(_(\"http transport does not support %s\"), buf->buf);\n \n@@ -1374,7 +1374,7 @@ static void parse_push(struct strbuf *buf)\n \t\texit(128); /* error already reported */\n \n free_specs:\n-\targv_array_clear(&specs);\n+\tstrvec_clear(&specs);\n }\n \n static int stateless_connect(const char *service_name)\ndiff --git a/remote-testsvn.c b/remote-testsvn.c\nindex 809b290d45..636b2b62a6 100644\n--- a/remote-testsvn.c\n+++ b/remote-testsvn.c\n@@ -198,10 +198,10 @@ static int cmd_import(const char *line)\n \t\t\tdie_errno(\"Couldn't open svn dump file %s.\", url);\n \t} else {\n \t\tsvndump_proc.out = -1;\n-\t\targv_array_push(&svndump_proc.args, command);\n-\t\targv_array_push(&svndump_proc.args, \"dump\");\n-\t\targv_array_push(&svndump_proc.args, url);\n-\t\targv_array_pushf(&svndump_proc.args, \"-r%u:HEAD\", startrev);\n+\t\tstrvec_push(&svndump_proc.args, command);\n+\t\tstrvec_push(&svndump_proc.args, \"dump\");\n+\t\tstrvec_push(&svndump_proc.args, url);\n+\t\tstrvec_pushf(&svndump_proc.args, \"-r%u:HEAD\", startrev);\n \n \t\tcode = start_command(&svndump_proc);\n \t\tif (code)\ndiff --git a/remote.c b/remote.c\nindex ba1a386d98..13b097866c 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -1885,7 +1885,7 @@ static int stat_branch_pair(const char *branch_name, const char *base,\n \tstruct object_id oid;\n \tstruct commit *ours, *theirs;\n \tstruct rev_info revs;\n-\tstruct argv_array argv = ARGV_ARRAY_INIT;\n+\tstruct strvec argv = STRVEC_INIT;\n \n \t/* Cannot stat if what we used to build on no longer exists */\n \tif (read_ref(base, &oid))\n@@ -1911,12 +1911,12 @@ static int stat_branch_pair(const char *branch_name, const char *base,\n \t\tBUG(\"stat_branch_pair: invalid abf '%d'\", abf);\n \n \t/* Run \"rev-list --left-right ours...theirs\" internally... */\n-\targv_array_push(&argv, \"\"); /* ignored */\n-\targv_array_push(&argv, \"--left-right\");\n-\targv_array_pushf(&argv, \"%s...%s\",\n+\tstrvec_push(&argv, \"\"); /* ignored */\n+\tstrvec_push(&argv, \"--left-right\");\n+\tstrvec_pushf(&argv, \"%s...%s\",\n \t\t\t oid_to_hex(&ours->object.oid),\n \t\t\t oid_to_hex(&theirs->object.oid));\n-\targv_array_push(&argv, \"--\");\n+\tstrvec_push(&argv, \"--\");\n \n \trepo_init_revisions(the_repository, &revs, NULL);\n \tsetup_revisions(argv.argc, argv.argv, &revs, NULL);\n@@ -1938,7 +1938,7 @@ static int stat_branch_pair(const char *branch_name, const char *base,\n \tclear_commit_marks(ours, ALL_REV_FLAGS);\n \tclear_commit_marks(theirs, ALL_REV_FLAGS);\n \n-\targv_array_clear(&argv);\n+\tstrvec_clear(&argv);\n \treturn 1;\n }\n \ndiff --git a/revision.c b/revision.c\nindex 07e16ed44b..e144132ae9 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -2073,14 +2073,14 @@ int handle_revision_arg(const char *arg_, struct rev_info *revs, int flags, unsi\n }\n \n static void read_pathspec_from_stdin(struct strbuf *sb,\n-\t\t\t\t     struct argv_array *prune)\n+\t\t\t\t     struct strvec *prune)\n {\n \twhile (strbuf_getline(sb, stdin) != EOF)\n-\t\targv_array_push(prune, sb->buf);\n+\t\tstrvec_push(prune, sb->buf);\n }\n \n static void read_revisions_from_stdin(struct rev_info *revs,\n-\t\t\t\t      struct argv_array *prune)\n+\t\t\t\t      struct strvec *prune)\n {\n \tstruct strbuf sb;\n \tint seen_dashdash = 0;\n@@ -2675,7 +2675,7 @@ static void NORETURN diagnose_missing_default(const char *def)\n int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct setup_revision_opt *opt)\n {\n \tint i, flags, left, seen_dashdash, got_rev_arg = 0, revarg_opt;\n-\tstruct argv_array prune_data = ARGV_ARRAY_INIT;\n+\tstruct strvec prune_data = STRVEC_INIT;\n \tconst char *submodule = NULL;\n \tint seen_end_of_options = 0;\n \n@@ -2694,7 +2694,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s\n \t\t\targv[i] = NULL;\n \t\t\targc = i;\n \t\t\tif (argv[i + 1])\n-\t\t\t\targv_array_pushv(&prune_data, argv + i + 1);\n+\t\t\t\tstrvec_pushv(&prune_data, argv + i + 1);\n \t\t\tseen_dashdash = 1;\n \t\t\tbreak;\n \t\t}\n@@ -2760,7 +2760,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s\n \t\t\tfor (j = i; j < argc; j++)\n \t\t\t\tverify_filename(revs->prefix, argv[j], j == i);\n \n-\t\t\targv_array_pushv(&prune_data, argv + i);\n+\t\t\tstrvec_pushv(&prune_data, argv + i);\n \t\t\tbreak;\n \t\t}\n \t\telse\n@@ -2785,7 +2785,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s\n \t\tparse_pathspec(&revs->prune_data, 0, 0,\n \t\t\t       revs->prefix, prune_data.argv);\n \t}\n-\targv_array_clear(&prune_data);\n+\tstrvec_clear(&prune_data);\n \n \tif (revs->def == NULL)\n \t\trevs->def = opt ? opt->def : NULL;\ndiff --git a/run-command.c b/run-command.c\nindex 8f57661d96..b9630a1b5f 100644\n--- a/run-command.c\n+++ b/run-command.c\n@@ -11,14 +11,14 @@\n void child_process_init(struct child_process *child)\n {\n \tmemset(child, 0, sizeof(*child));\n-\targv_array_init(&child->args);\n-\targv_array_init(&child->env_array);\n+\tstrvec_init(&child->args);\n+\tstrvec_init(&child->env_array);\n }\n \n void child_process_clear(struct child_process *child)\n {\n-\targv_array_clear(&child->args);\n-\targv_array_clear(&child->env_array);\n+\tstrvec_clear(&child->args);\n+\tstrvec_clear(&child->env_array);\n }\n \n struct child_to_clean {\n@@ -263,30 +263,30 @@ int sane_execvp(const char *file, char * const argv[])\n \treturn -1;\n }\n \n-static const char **prepare_shell_cmd(struct argv_array *out, const char **argv)\n+static const char **prepare_shell_cmd(struct strvec *out, const char **argv)\n {\n \tif (!argv[0])\n \t\tBUG(\"shell command is empty\");\n \n \tif (strcspn(argv[0], \"|&;<>()$`\\\\\\\"' \\t\\n*?[#~=%\") != strlen(argv[0])) {\n #ifndef GIT_WINDOWS_NATIVE\n-\t\targv_array_push(out, SHELL_PATH);\n+\t\tstrvec_push(out, SHELL_PATH);\n #else\n-\t\targv_array_push(out, \"sh\");\n+\t\tstrvec_push(out, \"sh\");\n #endif\n-\t\targv_array_push(out, \"-c\");\n+\t\tstrvec_push(out, \"-c\");\n \n \t\t/*\n \t\t * If we have no extra arguments, we do not even need to\n \t\t * bother with the \"$@\" magic.\n \t\t */\n \t\tif (!argv[1])\n-\t\t\targv_array_push(out, argv[0]);\n+\t\t\tstrvec_push(out, argv[0]);\n \t\telse\n-\t\t\targv_array_pushf(out, \"%s \\\"$@\\\"\", argv[0]);\n+\t\t\tstrvec_pushf(out, \"%s \\\"$@\\\"\", argv[0]);\n \t}\n \n-\targv_array_pushv(out, argv);\n+\tstrvec_pushv(out, argv);\n \treturn out->argv;\n }\n \n@@ -401,7 +401,7 @@ static void child_err_spew(struct child_process *cmd, struct child_err *cerr)\n \tset_error_routine(old_errfn);\n }\n \n-static int prepare_cmd(struct argv_array *out, const struct child_process *cmd)\n+static int prepare_cmd(struct strvec *out, const struct child_process *cmd)\n {\n \tif (!cmd->argv[0])\n \t\tBUG(\"command is empty\");\n@@ -410,14 +410,14 @@ static int prepare_cmd(struct argv_array *out, const struct child_process *cmd)\n \t * Add SHELL_PATH so in the event exec fails with ENOEXEC we can\n \t * attempt to interpret the command with 'sh'.\n \t */\n-\targv_array_push(out, SHELL_PATH);\n+\tstrvec_push(out, SHELL_PATH);\n \n \tif (cmd->git_cmd) {\n \t\tprepare_git_cmd(out, cmd->argv);\n \t} else if (cmd->use_shell) {\n \t\tprepare_shell_cmd(out, cmd->argv);\n \t} else {\n-\t\targv_array_pushv(out, cmd->argv);\n+\t\tstrvec_pushv(out, cmd->argv);\n \t}\n \n \t/*\n@@ -432,7 +432,7 @@ static int prepare_cmd(struct argv_array *out, const struct child_process *cmd)\n \t\t\tfree((char *)out->argv[1]);\n \t\t\tout->argv[1] = program;\n \t\t} else {\n-\t\t\targv_array_clear(out);\n+\t\t\tstrvec_clear(out);\n \t\t\terrno = ENOENT;\n \t\t\treturn -1;\n \t\t}\n@@ -742,7 +742,7 @@ int start_command(struct child_process *cmd)\n \tint notify_pipe[2];\n \tint null_fd = -1;\n \tchar **childenv;\n-\tstruct argv_array argv = ARGV_ARRAY_INIT;\n+\tstruct strvec argv = STRVEC_INIT;\n \tstruct child_err cerr;\n \tstruct atfork_state as;\n \n@@ -888,7 +888,7 @@ int start_command(struct child_process *cmd)\n \n \tif (null_fd >= 0)\n \t\tclose(null_fd);\n-\targv_array_clear(&argv);\n+\tstrvec_clear(&argv);\n \tfree(childenv);\n }\n end_of_spawn:\n@@ -897,7 +897,7 @@ int start_command(struct child_process *cmd)\n {\n \tint fhin = 0, fhout = 1, fherr = 2;\n \tconst char **sargv = cmd->argv;\n-\tstruct argv_array nargv = ARGV_ARRAY_INIT;\n+\tstruct strvec nargv = STRVEC_INIT;\n \n \tif (cmd->no_stdin)\n \t\tfhin = open(\"/dev/null\", O_RDWR);\n@@ -935,7 +935,7 @@ int start_command(struct child_process *cmd)\n \tif (cmd->clean_on_exit && cmd->pid >= 0)\n \t\tmark_child_for_cleanup(cmd->pid, cmd);\n \n-\targv_array_clear(&nargv);\n+\tstrvec_clear(&nargv);\n \tcmd->argv = sargv;\n \tif (fhin != 0)\n \t\tclose(fhin);\n@@ -1352,9 +1352,9 @@ int run_hook_ve(const char *const *env, const char *name, va_list args)\n \tif (!p)\n \t\treturn 0;\n \n-\targv_array_push(&hook.args, p);\n+\tstrvec_push(&hook.args, p);\n \twhile ((p = va_arg(args, const char *)))\n-\t\targv_array_push(&hook.args, p);\n+\t\tstrvec_push(&hook.args, p);\n \thook.env = env;\n \thook.no_stdin = 1;\n \thook.stdout_to_stderr = 1;\n@@ -1868,13 +1868,13 @@ int run_processes_parallel_tr2(int n, get_next_task_fn get_next_task,\n \n int run_auto_gc(int quiet)\n {\n-\tstruct argv_array argv_gc_auto = ARGV_ARRAY_INIT;\n+\tstruct strvec argv_gc_auto = STRVEC_INIT;\n \tint status;\n \n-\targv_array_pushl(&argv_gc_auto, \"gc\", \"--auto\", NULL);\n+\tstrvec_pushl(&argv_gc_auto, \"gc\", \"--auto\", NULL);\n \tif (quiet)\n-\t\targv_array_push(&argv_gc_auto, \"--quiet\");\n+\t\tstrvec_push(&argv_gc_auto, \"--quiet\");\n \tstatus = run_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD);\n-\targv_array_clear(&argv_gc_auto);\n+\tstrvec_clear(&argv_gc_auto);\n \treturn status;\n }\ndiff --git a/run-command.h b/run-command.h\nindex f5e05d38d2..8b9bfaef16 100644\n--- a/run-command.h\n+++ b/run-command.h\n@@ -52,15 +52,15 @@ struct child_process {\n \t * Note that the ownership of the memory pointed to by .argv stays with the\n \t * caller, but it should survive until `finish_command` completes. If the\n \t * .argv member is NULL, `start_command` will point it at the .args\n-\t * `argv_array` (so you may use one or the other, but you must use exactly\n+\t * `strvec` (so you may use one or the other, but you must use exactly\n \t * one). The memory in .args will be cleaned up automatically during\n \t * `finish_command` (or during `start_command` when it is unsuccessful).\n \t *\n \t */\n \tconst char **argv;\n \n-\tstruct argv_array args;\n-\tstruct argv_array env_array;\n+\tstruct strvec args;\n+\tstruct strvec env_array;\n \tpid_t pid;\n \n \tint trace2_child_id;\n@@ -107,7 +107,7 @@ struct child_process {\n \t *   variable that will be removed from the child process's environment.\n \t *\n \t * If the .env member is NULL, `start_command` will point it at the\n-\t * .env_array `argv_array` (so you may use one or the other, but not both).\n+\t * .env_array `strvec` (so you may use one or the other, but not both).\n \t * The memory in .env_array will be cleaned up automatically during\n \t * `finish_command` (or during `start_command` when it is unsuccessful).\n \t */\n@@ -134,7 +134,7 @@ struct child_process {\n \tvoid *clean_on_exit_handler_cbdata;\n };\n \n-#define CHILD_PROCESS_INIT { NULL, ARGV_ARRAY_INIT, ARGV_ARRAY_INIT }\n+#define CHILD_PROCESS_INIT { NULL, STRVEC_INIT, STRVEC_INIT }\n \n /**\n  * The functions: child_process_init, start_command, finish_command,\ndiff --git a/send-pack.c b/send-pack.c\nindex d671ab5d05..632f1580ca 100644\n--- a/send-pack.c\n+++ b/send-pack.c\n@@ -68,20 +68,20 @@ static int pack_objects(int fd, struct ref *refs, struct oid_array *extra, struc\n \tint i;\n \tint rc;\n \n-\targv_array_push(&po.args, \"pack-objects\");\n-\targv_array_push(&po.args, \"--all-progress-implied\");\n-\targv_array_push(&po.args, \"--revs\");\n-\targv_array_push(&po.args, \"--stdout\");\n+\tstrvec_push(&po.args, \"pack-objects\");\n+\tstrvec_push(&po.args, \"--all-progress-implied\");\n+\tstrvec_push(&po.args, \"--revs\");\n+\tstrvec_push(&po.args, \"--stdout\");\n \tif (args->use_thin_pack)\n-\t\targv_array_push(&po.args, \"--thin\");\n+\t\tstrvec_push(&po.args, \"--thin\");\n \tif (args->use_ofs_delta)\n-\t\targv_array_push(&po.args, \"--delta-base-offset\");\n+\t\tstrvec_push(&po.args, \"--delta-base-offset\");\n \tif (args->quiet || !args->progress)\n-\t\targv_array_push(&po.args, \"-q\");\n+\t\tstrvec_push(&po.args, \"-q\");\n \tif (args->progress)\n-\t\targv_array_push(&po.args, \"--progress\");\n+\t\tstrvec_push(&po.args, \"--progress\");\n \tif (is_repository_shallow(the_repository))\n-\t\targv_array_push(&po.args, \"--shallow\");\n+\t\tstrvec_push(&po.args, \"--shallow\");\n \tpo.in = -1;\n \tpo.out = args->stateless_rpc ? -1 : fd;\n \tpo.git_cmd = 1;\ndiff --git a/sequencer.c b/sequencer.c\nindex 9e7f868b00..80c770968a 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -830,20 +830,20 @@ int read_author_script(const char *path, char **name, char **email, char **date,\n \n /*\n  * Read a GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL AND GIT_AUTHOR_DATE from a\n- * file with shell quoting into struct argv_array. Returns -1 on\n+ * file with shell quoting into struct strvec. Returns -1 on\n  * error, 0 otherwise.\n  */\n-static int read_env_script(struct argv_array *env)\n+static int read_env_script(struct strvec *env)\n {\n \tchar *name, *email, *date;\n \n \tif (read_author_script(rebase_path_author_script(),\n \t\t\t       &name, &email, &date, 0))\n \t\treturn -1;\n \n-\targv_array_pushf(env, \"GIT_AUTHOR_NAME=%s\", name);\n-\targv_array_pushf(env, \"GIT_AUTHOR_EMAIL=%s\", email);\n-\targv_array_pushf(env, \"GIT_AUTHOR_DATE=%s\", date);\n+\tstrvec_pushf(env, \"GIT_AUTHOR_NAME=%s\", name);\n+\tstrvec_pushf(env, \"GIT_AUTHOR_EMAIL=%s\", email);\n+\tstrvec_pushf(env, \"GIT_AUTHOR_DATE=%s\", date);\n \tfree(name);\n \tfree(email);\n \tfree(date);\n@@ -929,34 +929,34 @@ static int run_git_commit(struct repository *r,\n \t\t\t     gpg_opt, gpg_opt);\n \t}\n \n-\targv_array_push(&cmd.args, \"commit\");\n+\tstrvec_push(&cmd.args, \"commit\");\n \n \tif (!(flags & VERIFY_MSG))\n-\t\targv_array_push(&cmd.args, \"-n\");\n+\t\tstrvec_push(&cmd.args, \"-n\");\n \tif ((flags & AMEND_MSG))\n-\t\targv_array_push(&cmd.args, \"--amend\");\n+\t\tstrvec_push(&cmd.args, \"--amend\");\n \tif (opts->gpg_sign)\n-\t\targv_array_pushf(&cmd.args, \"-S%s\", opts->gpg_sign);\n+\t\tstrvec_pushf(&cmd.args, \"-S%s\", opts->gpg_sign);\n \telse\n-\t\targv_array_push(&cmd.args, \"--no-gpg-sign\");\n+\t\tstrvec_push(&cmd.args, \"--no-gpg-sign\");\n \tif (defmsg)\n-\t\targv_array_pushl(&cmd.args, \"-F\", defmsg, NULL);\n+\t\tstrvec_pushl(&cmd.args, \"-F\", defmsg, NULL);\n \telse if (!(flags & EDIT_MSG))\n-\t\targv_array_pushl(&cmd.args, \"-C\", \"HEAD\", NULL);\n+\t\tstrvec_pushl(&cmd.args, \"-C\", \"HEAD\", NULL);\n \tif ((flags & CLEANUP_MSG))\n-\t\targv_array_push(&cmd.args, \"--cleanup=strip\");\n+\t\tstrvec_push(&cmd.args, \"--cleanup=strip\");\n \tif ((flags & EDIT_MSG))\n-\t\targv_array_push(&cmd.args, \"-e\");\n+\t\tstrvec_push(&cmd.args, \"-e\");\n \telse if (!(flags & CLEANUP_MSG) &&\n \t\t !opts->signoff && !opts->record_origin &&\n \t\t !opts->explicit_cleanup)\n-\t\targv_array_push(&cmd.args, \"--cleanup=verbatim\");\n+\t\tstrvec_push(&cmd.args, \"--cleanup=verbatim\");\n \n \tif ((flags & ALLOW_EMPTY))\n-\t\targv_array_push(&cmd.args, \"--allow-empty\");\n+\t\tstrvec_push(&cmd.args, \"--allow-empty\");\n \n \tif (!(flags & EDIT_MSG))\n-\t\targv_array_push(&cmd.args, \"--allow-empty-message\");\n+\t\tstrvec_push(&cmd.args, \"--allow-empty-message\");\n \n \tif (is_rebase_i(opts) && !(flags & EDIT_MSG))\n \t\treturn run_command_silent_on_success(&cmd);\n@@ -2754,15 +2754,15 @@ static int rollback_is_safe(void)\n static int reset_merge(const struct object_id *oid)\n {\n \tint ret;\n-\tstruct argv_array argv = ARGV_ARRAY_INIT;\n+\tstruct strvec argv = STRVEC_INIT;\n \n-\targv_array_pushl(&argv, \"reset\", \"--merge\", NULL);\n+\tstrvec_pushl(&argv, \"reset\", \"--merge\", NULL);\n \n \tif (!is_null_oid(oid))\n-\t\targv_array_push(&argv, oid_to_hex(oid));\n+\t\tstrvec_push(&argv, oid_to_hex(oid));\n \n \tret = run_command_v_opt(argv.argv, RUN_GIT_CMD);\n-\targv_array_clear(&argv);\n+\tstrvec_clear(&argv);\n \n \treturn ret;\n }\n@@ -3125,14 +3125,14 @@ static int error_failed_squash(struct repository *r,\n \n static int do_exec(struct repository *r, const char *command_line)\n {\n-\tstruct argv_array child_env = ARGV_ARRAY_INIT;\n+\tstruct strvec child_env = STRVEC_INIT;\n \tconst char *child_argv[] = { NULL, NULL };\n \tint dirty, status;\n \n \tfprintf(stderr, _(\"Executing: %s\\n\"), command_line);\n \tchild_argv[0] = command_line;\n-\targv_array_pushf(&child_env, \"GIT_DIR=%s\", absolute_path(get_git_dir()));\n-\targv_array_pushf(&child_env, \"GIT_WORK_TREE=%s\",\n+\tstrvec_pushf(&child_env, \"GIT_DIR=%s\", absolute_path(get_git_dir()));\n+\tstrvec_pushf(&child_env, \"GIT_WORK_TREE=%s\",\n \t\t\t absolute_path(get_git_work_tree()));\n \tstatus = run_command_v_opt_cd_env(child_argv, RUN_USING_SHELL, NULL,\n \t\t\t\t\t  child_env.argv);\n@@ -3165,7 +3165,7 @@ static int do_exec(struct repository *r, const char *command_line)\n \t\tstatus = 1;\n \t}\n \n-\targv_array_clear(&child_env);\n+\tstrvec_clear(&child_env);\n \n \treturn status;\n }\n@@ -3544,28 +3544,28 @@ static int do_merge(struct repository *r,\n \t\t}\n \n \t\tcmd.git_cmd = 1;\n-\t\targv_array_push(&cmd.args, \"merge\");\n-\t\targv_array_push(&cmd.args, \"-s\");\n+\t\tstrvec_push(&cmd.args, \"merge\");\n+\t\tstrvec_push(&cmd.args, \"-s\");\n \t\tif (!strategy)\n-\t\t\targv_array_push(&cmd.args, \"octopus\");\n+\t\t\tstrvec_push(&cmd.args, \"octopus\");\n \t\telse {\n-\t\t\targv_array_push(&cmd.args, strategy);\n+\t\t\tstrvec_push(&cmd.args, strategy);\n \t\t\tfor (k = 0; k < opts->xopts_nr; k++)\n-\t\t\t\targv_array_pushf(&cmd.args,\n+\t\t\t\tstrvec_pushf(&cmd.args,\n \t\t\t\t\t\t \"-X%s\", opts->xopts[k]);\n \t\t}\n-\t\targv_array_push(&cmd.args, \"--no-edit\");\n-\t\targv_array_push(&cmd.args, \"--no-ff\");\n-\t\targv_array_push(&cmd.args, \"--no-log\");\n-\t\targv_array_push(&cmd.args, \"--no-stat\");\n-\t\targv_array_push(&cmd.args, \"-F\");\n-\t\targv_array_push(&cmd.args, git_path_merge_msg(r));\n+\t\tstrvec_push(&cmd.args, \"--no-edit\");\n+\t\tstrvec_push(&cmd.args, \"--no-ff\");\n+\t\tstrvec_push(&cmd.args, \"--no-log\");\n+\t\tstrvec_push(&cmd.args, \"--no-stat\");\n+\t\tstrvec_push(&cmd.args, \"-F\");\n+\t\tstrvec_push(&cmd.args, git_path_merge_msg(r));\n \t\tif (opts->gpg_sign)\n-\t\t\targv_array_push(&cmd.args, opts->gpg_sign);\n+\t\t\tstrvec_push(&cmd.args, opts->gpg_sign);\n \n \t\t/* Add the tips to be merged */\n \t\tfor (j = to_merge; j; j = j->next)\n-\t\t\targv_array_push(&cmd.args,\n+\t\t\tstrvec_push(&cmd.args,\n \t\t\t\t\toid_to_hex(&j->item->object.oid));\n \n \t\tstrbuf_release(&ref_name);\n@@ -3694,7 +3694,7 @@ void create_autostash(struct repository *r, const char *path,\n \t\tstruct child_process stash = CHILD_PROCESS_INIT;\n \t\tstruct object_id oid;\n \n-\t\targv_array_pushl(&stash.args,\n+\t\tstrvec_pushl(&stash.args,\n \t\t\t\t \"stash\", \"create\", \"autostash\", NULL);\n \t\tstash.git_cmd = 1;\n \t\tstash.no_stdin = 1;\n@@ -3734,9 +3734,9 @@ static int apply_save_autostash_oid(const char *stash_oid, int attempt_apply)\n \t\tchild.git_cmd = 1;\n \t\tchild.no_stdout = 1;\n \t\tchild.no_stderr = 1;\n-\t\targv_array_push(&child.args, \"stash\");\n-\t\targv_array_push(&child.args, \"apply\");\n-\t\targv_array_push(&child.args, stash_oid);\n+\t\tstrvec_push(&child.args, \"stash\");\n+\t\tstrvec_push(&child.args, \"apply\");\n+\t\tstrvec_push(&child.args, stash_oid);\n \t\tret = run_command(&child);\n \t}\n \n@@ -3746,12 +3746,12 @@ static int apply_save_autostash_oid(const char *stash_oid, int attempt_apply)\n \t\tstruct child_process store = CHILD_PROCESS_INIT;\n \n \t\tstore.git_cmd = 1;\n-\t\targv_array_push(&store.args, \"stash\");\n-\t\targv_array_push(&store.args, \"store\");\n-\t\targv_array_push(&store.args, \"-m\");\n-\t\targv_array_push(&store.args, \"autostash\");\n-\t\targv_array_push(&store.args, \"-q\");\n-\t\targv_array_push(&store.args, stash_oid);\n+\t\tstrvec_push(&store.args, \"stash\");\n+\t\tstrvec_push(&store.args, \"store\");\n+\t\tstrvec_push(&store.args, \"-m\");\n+\t\tstrvec_push(&store.args, \"autostash\");\n+\t\tstrvec_push(&store.args, \"-q\");\n+\t\tstrvec_push(&store.args, stash_oid);\n \t\tif (run_command(&store))\n \t\t\tret = error(_(\"cannot store %s\"), stash_oid);\n \t\telse\n@@ -3831,9 +3831,9 @@ static int run_git_checkout(struct repository *r, struct replay_opts *opts,\n \n \tcmd.git_cmd = 1;\n \n-\targv_array_push(&cmd.args, \"checkout\");\n-\targv_array_push(&cmd.args, commit);\n-\targv_array_pushf(&cmd.env_array, GIT_REFLOG_ACTION \"=%s\", action);\n+\tstrvec_push(&cmd.args, \"checkout\");\n+\tstrvec_push(&cmd.args, commit);\n+\tstrvec_pushf(&cmd.env_array, GIT_REFLOG_ACTION \"=%s\", action);\n \n \tif (opts->verbose)\n \t\tret = run_command(&cmd);\n@@ -4157,9 +4157,9 @@ static int pick_commits(struct repository *r,\n \n \t\t\tchild.in = open(rebase_path_rewritten_list(), O_RDONLY);\n \t\t\tchild.git_cmd = 1;\n-\t\t\targv_array_push(&child.args, \"notes\");\n-\t\t\targv_array_push(&child.args, \"copy\");\n-\t\t\targv_array_push(&child.args, \"--for-rewrite=rebase\");\n+\t\t\tstrvec_push(&child.args, \"notes\");\n+\t\t\tstrvec_push(&child.args, \"copy\");\n+\t\t\tstrvec_push(&child.args, \"--for-rewrite=rebase\");\n \t\t\t/* we don't care if this copying failed */\n \t\t\trun_command(&child);\n \n@@ -4170,8 +4170,8 @@ static int pick_commits(struct repository *r,\n \t\t\t\t\tO_RDONLY);\n \t\t\t\thook.stdout_to_stderr = 1;\n \t\t\t\thook.trace2_hook_name = \"post-rewrite\";\n-\t\t\t\targv_array_push(&hook.args, post_rewrite_hook);\n-\t\t\t\targv_array_push(&hook.args, \"rebase\");\n+\t\t\t\tstrvec_push(&hook.args, post_rewrite_hook);\n+\t\t\t\tstrvec_push(&hook.args, \"rebase\");\n \t\t\t\t/* we don't care if this hook failed */\n \t\t\t\trun_command(&hook);\n \t\t\t}\ndiff --git a/serve.c b/serve.c\nindex 8d9a345b3d..523a9be32d 100644\n--- a/serve.c\n+++ b/serve.c\n@@ -56,7 +56,7 @@ struct protocol_capability {\n \t * This field should be NULL for capabilities which are not commands.\n \t */\n \tint (*command)(struct repository *r,\n-\t\t       struct argv_array *keys,\n+\t\t       struct strvec *keys,\n \t\t       struct packet_reader *request);\n };\n \n@@ -142,7 +142,7 @@ static int is_command(const char *key, struct protocol_capability **command)\n \treturn 0;\n }\n \n-int has_capability(const struct argv_array *keys, const char *capability,\n+int has_capability(const struct strvec *keys, const char *capability,\n \t\t   const char **value)\n {\n \tint i;\n@@ -162,7 +162,7 @@ int has_capability(const struct argv_array *keys, const char *capability,\n \treturn 0;\n }\n \n-static void check_algorithm(struct repository *r, struct argv_array *keys)\n+static void check_algorithm(struct repository *r, struct strvec *keys)\n {\n \tint client = GIT_HASH_SHA1, server = hash_algo_by_ptr(r->hash_algo);\n \tconst char *algo_name;\n@@ -187,7 +187,7 @@ static int process_request(void)\n {\n \tenum request_state state = PROCESS_REQUEST_KEYS;\n \tstruct packet_reader reader;\n-\tstruct argv_array keys = ARGV_ARRAY_INIT;\n+\tstruct strvec keys = STRVEC_INIT;\n \tstruct protocol_capability *command = NULL;\n \n \tpacket_reader_init(&reader, 0, NULL, 0,\n@@ -211,7 +211,7 @@ static int process_request(void)\n \t\t\t/* collect request; a sequence of keys and values */\n \t\t\tif (is_command(reader.line, &command) ||\n \t\t\t    is_valid_capability(reader.line))\n-\t\t\t\targv_array_push(&keys, reader.line);\n+\t\t\t\tstrvec_push(&keys, reader.line);\n \t\t\telse\n \t\t\t\tdie(\"unknown capability '%s'\", reader.line);\n \n@@ -254,7 +254,7 @@ static int process_request(void)\n \n \tcommand->command(the_repository, &keys, &reader);\n \n-\targv_array_clear(&keys);\n+\tstrvec_clear(&keys);\n \treturn 0;\n }\n \ndiff --git a/sha1-file.c b/sha1-file.c\nindex ccd34dd9e8..a7f7a14898 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -763,18 +763,18 @@ static void fill_alternate_refs_command(struct child_process *cmd,\n \tif (!git_config_get_value(\"core.alternateRefsCommand\", &value)) {\n \t\tcmd->use_shell = 1;\n \n-\t\targv_array_push(&cmd->args, value);\n-\t\targv_array_push(&cmd->args, repo_path);\n+\t\tstrvec_push(&cmd->args, value);\n+\t\tstrvec_push(&cmd->args, repo_path);\n \t} else {\n \t\tcmd->git_cmd = 1;\n \n-\t\targv_array_pushf(&cmd->args, \"--git-dir=%s\", repo_path);\n-\t\targv_array_push(&cmd->args, \"for-each-ref\");\n-\t\targv_array_push(&cmd->args, \"--format=%(objectname)\");\n+\t\tstrvec_pushf(&cmd->args, \"--git-dir=%s\", repo_path);\n+\t\tstrvec_push(&cmd->args, \"for-each-ref\");\n+\t\tstrvec_push(&cmd->args, \"--format=%(objectname)\");\n \n \t\tif (!git_config_get_value(\"core.alternateRefsPrefixes\", &value)) {\n-\t\t\targv_array_push(&cmd->args, \"--\");\n-\t\t\targv_array_split(&cmd->args, value);\n+\t\t\tstrvec_push(&cmd->args, \"--\");\n+\t\t\tstrvec_split(&cmd->args, value);\n \t\t}\n \t}\n \ndiff --git a/sub-process.c b/sub-process.c\nindex 1b1af9dcbd..dfa790d3ff 100644\n--- a/sub-process.c\n+++ b/sub-process.c\n@@ -84,7 +84,7 @@ int subprocess_start(struct hashmap *hashmap, struct subprocess_entry *entry, co\n \tprocess = &entry->process;\n \n \tchild_process_init(process);\n-\targv_array_push(&process->args, cmd);\n+\tstrvec_push(&process->args, cmd);\n \tprocess->use_shell = 1;\n \tprocess->in = -1;\n \tprocess->out = -1;\ndiff --git a/submodule.c b/submodule.c\nindex 874db5c4b2..5c9447422d 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -262,17 +262,17 @@ int is_submodule_active(struct repository *repo, const char *path)\n \tsl = repo_config_get_value_multi(repo, \"submodule.active\");\n \tif (sl) {\n \t\tstruct pathspec ps;\n-\t\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\t\tstruct strvec args = STRVEC_INIT;\n \t\tconst struct string_list_item *item;\n \n \t\tfor_each_string_list_item(item, sl) {\n-\t\t\targv_array_push(&args, item->string);\n+\t\t\tstrvec_push(&args, item->string);\n \t\t}\n \n \t\tparse_pathspec(&ps, 0, 0, NULL, args.argv);\n \t\tret = match_pathspec(repo->index, &ps, path, strlen(path), 0, NULL, 1);\n \n-\t\targv_array_clear(&args);\n+\t\tstrvec_clear(&args);\n \t\tclear_pathspec(&ps);\n \t\treturn ret;\n \t}\n@@ -481,27 +481,27 @@ static void print_submodule_summary(struct repository *r, struct rev_info *rev,\n \tstrbuf_release(&sb);\n }\n \n-static void prepare_submodule_repo_env_no_git_dir(struct argv_array *out)\n+static void prepare_submodule_repo_env_no_git_dir(struct strvec *out)\n {\n \tconst char * const *var;\n \n \tfor (var = local_repo_env; *var; var++) {\n \t\tif (strcmp(*var, CONFIG_DATA_ENVIRONMENT))\n-\t\t\targv_array_push(out, *var);\n+\t\t\tstrvec_push(out, *var);\n \t}\n }\n \n-void prepare_submodule_repo_env(struct argv_array *out)\n+void prepare_submodule_repo_env(struct strvec *out)\n {\n \tprepare_submodule_repo_env_no_git_dir(out);\n-\targv_array_pushf(out, \"%s=%s\", GIT_DIR_ENVIRONMENT,\n+\tstrvec_pushf(out, \"%s=%s\", GIT_DIR_ENVIRONMENT,\n \t\t\t DEFAULT_GIT_DIR_ENVIRONMENT);\n }\n \n-static void prepare_submodule_repo_env_in_gitdir(struct argv_array *out)\n+static void prepare_submodule_repo_env_in_gitdir(struct strvec *out)\n {\n \tprepare_submodule_repo_env_no_git_dir(out);\n-\targv_array_pushf(out, \"%s=.\", GIT_DIR_ENVIRONMENT);\n+\tstrvec_pushf(out, \"%s=.\", GIT_DIR_ENVIRONMENT);\n }\n \n /*\n@@ -681,30 +681,30 @@ void show_submodule_inline_diff(struct diff_options *o, const char *path,\n \tcp.no_stdin = 1;\n \n \t/* TODO: other options may need to be passed here. */\n-\targv_array_pushl(&cp.args, \"diff\", \"--submodule=diff\", NULL);\n-\targv_array_pushf(&cp.args, \"--color=%s\", want_color(o->use_color) ?\n+\tstrvec_pushl(&cp.args, \"diff\", \"--submodule=diff\", NULL);\n+\tstrvec_pushf(&cp.args, \"--color=%s\", want_color(o->use_color) ?\n \t\t\t \"always\" : \"never\");\n \n \tif (o->flags.reverse_diff) {\n-\t\targv_array_pushf(&cp.args, \"--src-prefix=%s%s/\",\n+\t\tstrvec_pushf(&cp.args, \"--src-prefix=%s%s/\",\n \t\t\t\t o->b_prefix, path);\n-\t\targv_array_pushf(&cp.args, \"--dst-prefix=%s%s/\",\n+\t\tstrvec_pushf(&cp.args, \"--dst-prefix=%s%s/\",\n \t\t\t\t o->a_prefix, path);\n \t} else {\n-\t\targv_array_pushf(&cp.args, \"--src-prefix=%s%s/\",\n+\t\tstrvec_pushf(&cp.args, \"--src-prefix=%s%s/\",\n \t\t\t\t o->a_prefix, path);\n-\t\targv_array_pushf(&cp.args, \"--dst-prefix=%s%s/\",\n+\t\tstrvec_pushf(&cp.args, \"--dst-prefix=%s%s/\",\n \t\t\t\t o->b_prefix, path);\n \t}\n-\targv_array_push(&cp.args, oid_to_hex(old_oid));\n+\tstrvec_push(&cp.args, oid_to_hex(old_oid));\n \t/*\n \t * If the submodule has modified content, we will diff against the\n \t * work tree, under the assumption that the user has asked for the\n \t * diff format and wishes to actually see all differences even if they\n \t * haven't yet been committed to the submodule yet.\n \t */\n \tif (!(dirty_submodule & DIRTY_SUBMODULE_MODIFIED))\n-\t\targv_array_push(&cp.args, oid_to_hex(new_oid));\n+\t\tstrvec_push(&cp.args, oid_to_hex(new_oid));\n \n \tprepare_submodule_repo_env(&cp.env_array);\n \tif (start_command(&cp))\n@@ -836,7 +836,7 @@ static void collect_changed_submodules_cb(struct diff_queue_struct *q,\n  */\n static void collect_changed_submodules(struct repository *r,\n \t\t\t\t       struct string_list *changed,\n-\t\t\t\t       struct argv_array *argv)\n+\t\t\t\t       struct strvec *argv)\n {\n \tstruct rev_info rev;\n \tconst struct commit *commit;\n@@ -879,8 +879,8 @@ static int has_remote(const char *refname, const struct object_id *oid,\n \n static int append_oid_to_argv(const struct object_id *oid, void *data)\n {\n-\tstruct argv_array *argv = data;\n-\targv_array_push(argv, oid_to_hex(oid));\n+\tstruct strvec *argv = data;\n+\tstrvec_push(argv, oid_to_hex(oid));\n \treturn 0;\n }\n \n@@ -941,9 +941,9 @@ static int submodule_has_commits(struct repository *r,\n \t\tstruct child_process cp = CHILD_PROCESS_INIT;\n \t\tstruct strbuf out = STRBUF_INIT;\n \n-\t\targv_array_pushl(&cp.args, \"rev-list\", \"-n\", \"1\", NULL);\n+\t\tstrvec_pushl(&cp.args, \"rev-list\", \"-n\", \"1\", NULL);\n \t\toid_array_for_each_unique(commits, append_oid_to_argv, &cp.args);\n-\t\targv_array_pushl(&cp.args, \"--not\", \"--all\", NULL);\n+\t\tstrvec_pushl(&cp.args, \"--not\", \"--all\", NULL);\n \n \t\tprepare_submodule_repo_env(&cp.env_array);\n \t\tcp.git_cmd = 1;\n@@ -982,9 +982,9 @@ static int submodule_needs_pushing(struct repository *r,\n \t\tstruct strbuf buf = STRBUF_INIT;\n \t\tint needs_pushing = 0;\n \n-\t\targv_array_push(&cp.args, \"rev-list\");\n+\t\tstrvec_push(&cp.args, \"rev-list\");\n \t\toid_array_for_each_unique(commits, append_oid_to_argv, &cp.args);\n-\t\targv_array_pushl(&cp.args, \"--not\", \"--remotes\", \"-n\", \"1\" , NULL);\n+\t\tstrvec_pushl(&cp.args, \"--not\", \"--remotes\", \"-n\", \"1\" , NULL);\n \n \t\tprepare_submodule_repo_env(&cp.env_array);\n \t\tcp.git_cmd = 1;\n@@ -1012,13 +1012,13 @@ int find_unpushed_submodules(struct repository *r,\n {\n \tstruct string_list submodules = STRING_LIST_INIT_DUP;\n \tstruct string_list_item *name;\n-\tstruct argv_array argv = ARGV_ARRAY_INIT;\n+\tstruct strvec argv = STRVEC_INIT;\n \n \t/* argv.argv[0] will be ignored by setup_revisions */\n-\targv_array_push(&argv, \"find_unpushed_submodules\");\n+\tstrvec_push(&argv, \"find_unpushed_submodules\");\n \toid_array_for_each_unique(commits, append_oid_to_argv, &argv);\n-\targv_array_push(&argv, \"--not\");\n-\targv_array_pushf(&argv, \"--remotes=%s\", remotes_name);\n+\tstrvec_push(&argv, \"--not\");\n+\tstrvec_pushf(&argv, \"--remotes=%s\", remotes_name);\n \n \tcollect_changed_submodules(r, &submodules, &argv);\n \n@@ -1041,7 +1041,7 @@ int find_unpushed_submodules(struct repository *r,\n \t}\n \n \tfree_submodules_oids(&submodules);\n-\targv_array_clear(&argv);\n+\tstrvec_clear(&argv);\n \n \treturn needs_pushing->nr;\n }\n@@ -1054,22 +1054,22 @@ static int push_submodule(const char *path,\n {\n \tif (for_each_remote_ref_submodule(path, has_remote, NULL) > 0) {\n \t\tstruct child_process cp = CHILD_PROCESS_INIT;\n-\t\targv_array_push(&cp.args, \"push\");\n+\t\tstrvec_push(&cp.args, \"push\");\n \t\tif (dry_run)\n-\t\t\targv_array_push(&cp.args, \"--dry-run\");\n+\t\t\tstrvec_push(&cp.args, \"--dry-run\");\n \n \t\tif (push_options && push_options->nr) {\n \t\t\tconst struct string_list_item *item;\n \t\t\tfor_each_string_list_item(item, push_options)\n-\t\t\t\targv_array_pushf(&cp.args, \"--push-option=%s\",\n+\t\t\t\tstrvec_pushf(&cp.args, \"--push-option=%s\",\n \t\t\t\t\t\t item->string);\n \t\t}\n \n \t\tif (remote->origin != REMOTE_UNCONFIGURED) {\n \t\t\tint i;\n-\t\t\targv_array_push(&cp.args, remote->name);\n+\t\t\tstrvec_push(&cp.args, remote->name);\n \t\t\tfor (i = 0; i < rs->raw_nr; i++)\n-\t\t\t\targv_array_push(&cp.args, rs->raw[i]);\n+\t\t\t\tstrvec_push(&cp.args, rs->raw[i]);\n \t\t}\n \n \t\tprepare_submodule_repo_env(&cp.env_array);\n@@ -1095,13 +1095,13 @@ static void submodule_push_check(const char *path, const char *head,\n \tstruct child_process cp = CHILD_PROCESS_INIT;\n \tint i;\n \n-\targv_array_push(&cp.args, \"submodule--helper\");\n-\targv_array_push(&cp.args, \"push-check\");\n-\targv_array_push(&cp.args, head);\n-\targv_array_push(&cp.args, remote->name);\n+\tstrvec_push(&cp.args, \"submodule--helper\");\n+\tstrvec_push(&cp.args, \"push-check\");\n+\tstrvec_push(&cp.args, head);\n+\tstrvec_push(&cp.args, remote->name);\n \n \tfor (i = 0; i < rs->raw_nr; i++)\n-\t\targv_array_push(&cp.args, rs->raw[i]);\n+\t\tstrvec_push(&cp.args, rs->raw[i]);\n \n \tprepare_submodule_repo_env(&cp.env_array);\n \tcp.git_cmd = 1;\n@@ -1189,17 +1189,17 @@ void check_for_new_submodule_commits(struct object_id *oid)\n static void calculate_changed_submodule_paths(struct repository *r,\n \t\tstruct string_list *changed_submodule_names)\n {\n-\tstruct argv_array argv = ARGV_ARRAY_INIT;\n+\tstruct strvec argv = STRVEC_INIT;\n \tstruct string_list_item *name;\n \n \t/* No need to check if there are no submodules configured */\n \tif (!submodule_from_path(r, NULL, NULL))\n \t\treturn;\n \n-\targv_array_push(&argv, \"--\"); /* argv[0] program name */\n+\tstrvec_push(&argv, \"--\"); /* argv[0] program name */\n \toid_array_for_each_unique(&ref_tips_after_fetch,\n \t\t\t\t   append_oid_to_argv, &argv);\n-\targv_array_push(&argv, \"--not\");\n+\tstrvec_push(&argv, \"--not\");\n \toid_array_for_each_unique(&ref_tips_before_fetch,\n \t\t\t\t   append_oid_to_argv, &argv);\n \n@@ -1231,7 +1231,7 @@ static void calculate_changed_submodule_paths(struct repository *r,\n \n \tstring_list_remove_empty_items(changed_submodule_names, 1);\n \n-\targv_array_clear(&argv);\n+\tstrvec_clear(&argv);\n \toid_array_clear(&ref_tips_before_fetch);\n \toid_array_clear(&ref_tips_after_fetch);\n \tinitialized_fetch_ref_tips = 0;\n@@ -1242,32 +1242,32 @@ int submodule_touches_in_range(struct repository *r,\n \t\t\t       struct object_id *incl_oid)\n {\n \tstruct string_list subs = STRING_LIST_INIT_DUP;\n-\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\tstruct strvec args = STRVEC_INIT;\n \tint ret;\n \n \t/* No need to check if there are no submodules configured */\n \tif (!submodule_from_path(r, NULL, NULL))\n \t\treturn 0;\n \n-\targv_array_push(&args, \"--\"); /* args[0] program name */\n-\targv_array_push(&args, oid_to_hex(incl_oid));\n+\tstrvec_push(&args, \"--\"); /* args[0] program name */\n+\tstrvec_push(&args, oid_to_hex(incl_oid));\n \tif (!is_null_oid(excl_oid)) {\n-\t\targv_array_push(&args, \"--not\");\n-\t\targv_array_push(&args, oid_to_hex(excl_oid));\n+\t\tstrvec_push(&args, \"--not\");\n+\t\tstrvec_push(&args, oid_to_hex(excl_oid));\n \t}\n \n \tcollect_changed_submodules(r, &subs, &args);\n \tret = subs.nr;\n \n-\targv_array_clear(&args);\n+\tstrvec_clear(&args);\n \n \tfree_submodules_oids(&subs);\n \treturn ret;\n }\n \n struct submodule_parallel_fetch {\n \tint count;\n-\tstruct argv_array args;\n+\tstruct strvec args;\n \tstruct repository *r;\n \tconst char *prefix;\n \tint command_line_option;\n@@ -1283,7 +1283,7 @@ struct submodule_parallel_fetch {\n \n \tstruct strbuf submodules_with_errors;\n };\n-#define SPF_INIT {0, ARGV_ARRAY_INIT, NULL, NULL, 0, 0, 0, 0, \\\n+#define SPF_INIT {0, STRVEC_INIT, NULL, NULL, 0, 0, 0, 0, \\\n \t\t  STRING_LIST_INIT_DUP, \\\n \t\t  NULL, 0, 0, STRBUF_INIT}\n \n@@ -1452,15 +1452,15 @@ static int get_next_submodule(struct child_process *cp,\n \t\t\tif (!spf->quiet)\n \t\t\t\tstrbuf_addf(err, _(\"Fetching submodule %s%s\\n\"),\n \t\t\t\t\t    spf->prefix, ce->name);\n-\t\t\targv_array_init(&cp->args);\n-\t\t\targv_array_pushv(&cp->args, spf->args.argv);\n-\t\t\targv_array_push(&cp->args, default_argv);\n-\t\t\targv_array_push(&cp->args, \"--submodule-prefix\");\n+\t\t\tstrvec_init(&cp->args);\n+\t\t\tstrvec_pushv(&cp->args, spf->args.argv);\n+\t\t\tstrvec_push(&cp->args, default_argv);\n+\t\t\tstrvec_push(&cp->args, \"--submodule-prefix\");\n \n \t\t\tstrbuf_addf(&submodule_prefix, \"%s%s/\",\n \t\t\t\t\t\t       spf->prefix,\n \t\t\t\t\t\t       task->sub->path);\n-\t\t\targv_array_push(&cp->args, submodule_prefix.buf);\n+\t\t\tstrvec_push(&cp->args, submodule_prefix.buf);\n \n \t\t\tspf->count++;\n \t\t\t*task_cb = task;\n@@ -1500,14 +1500,14 @@ static int get_next_submodule(struct child_process *cp,\n \t\tcp->git_cmd = 1;\n \t\tcp->dir = task->repo->gitdir;\n \n-\t\targv_array_init(&cp->args);\n-\t\targv_array_pushv(&cp->args, spf->args.argv);\n-\t\targv_array_push(&cp->args, \"on-demand\");\n-\t\targv_array_push(&cp->args, \"--submodule-prefix\");\n-\t\targv_array_push(&cp->args, submodule_prefix.buf);\n+\t\tstrvec_init(&cp->args);\n+\t\tstrvec_pushv(&cp->args, spf->args.argv);\n+\t\tstrvec_push(&cp->args, \"on-demand\");\n+\t\tstrvec_push(&cp->args, \"--submodule-prefix\");\n+\t\tstrvec_push(&cp->args, submodule_prefix.buf);\n \n \t\t/* NEEDSWORK: have get_default_remote from submodule--helper */\n-\t\targv_array_push(&cp->args, \"origin\");\n+\t\tstrvec_push(&cp->args, \"origin\");\n \t\toid_array_for_each_unique(task->commits,\n \t\t\t\t\t  append_oid_to_argv, &cp->args);\n \n@@ -1598,7 +1598,7 @@ static int fetch_finish(int retvalue, struct strbuf *err,\n }\n \n int fetch_populated_submodules(struct repository *r,\n-\t\t\t       const struct argv_array *options,\n+\t\t\t       const struct strvec *options,\n \t\t\t       const char *prefix, int command_line_option,\n \t\t\t       int default_option,\n \t\t\t       int quiet, int max_parallel_jobs)\n@@ -1618,10 +1618,10 @@ int fetch_populated_submodules(struct repository *r,\n \tif (repo_read_index(r) < 0)\n \t\tdie(_(\"index file corrupt\"));\n \n-\targv_array_push(&spf.args, \"fetch\");\n+\tstrvec_push(&spf.args, \"fetch\");\n \tfor (i = 0; i < options->argc; i++)\n-\t\targv_array_push(&spf.args, options->argv[i]);\n-\targv_array_push(&spf.args, \"--recurse-submodules-default\");\n+\t\tstrvec_push(&spf.args, options->argv[i]);\n+\tstrvec_push(&spf.args, \"--recurse-submodules-default\");\n \t/* default value, \"--submodule-prefix\" and its value are added later */\n \n \tcalculate_changed_submodule_paths(r, &spf.changed_submodule_names);\n@@ -1638,7 +1638,7 @@ int fetch_populated_submodules(struct repository *r,\n \t\t\tspf.submodules_with_errors.buf);\n \n \n-\targv_array_clear(&spf.args);\n+\tstrvec_clear(&spf.args);\n out:\n \tfree_submodules_oids(&spf.changed_submodule_names);\n \treturn spf.result;\n@@ -1666,9 +1666,9 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked)\n \t}\n \tstrbuf_reset(&buf);\n \n-\targv_array_pushl(&cp.args, \"status\", \"--porcelain=2\", NULL);\n+\tstrvec_pushl(&cp.args, \"status\", \"--porcelain=2\", NULL);\n \tif (ignore_untracked)\n-\t\targv_array_push(&cp.args, \"-uno\");\n+\t\tstrvec_push(&cp.args, \"-uno\");\n \n \tprepare_submodule_repo_env(&cp.env_array);\n \tcp.git_cmd = 1;\n@@ -1779,16 +1779,16 @@ int bad_to_remove_submodule(const char *path, unsigned flags)\n \tif (!submodule_uses_gitfile(path))\n \t\treturn 1;\n \n-\targv_array_pushl(&cp.args, \"status\", \"--porcelain\",\n+\tstrvec_pushl(&cp.args, \"status\", \"--porcelain\",\n \t\t\t\t   \"--ignore-submodules=none\", NULL);\n \n \tif (flags & SUBMODULE_REMOVAL_IGNORE_UNTRACKED)\n-\t\targv_array_push(&cp.args, \"-uno\");\n+\t\tstrvec_push(&cp.args, \"-uno\");\n \telse\n-\t\targv_array_push(&cp.args, \"-uall\");\n+\t\tstrvec_push(&cp.args, \"-uall\");\n \n \tif (!(flags & SUBMODULE_REMOVAL_IGNORE_IGNORED_UNTRACKED))\n-\t\targv_array_push(&cp.args, \"--ignored\");\n+\t\tstrvec_push(&cp.args, \"--ignored\");\n \n \tprepare_submodule_repo_env(&cp.env_array);\n \tcp.git_cmd = 1;\n@@ -1846,7 +1846,7 @@ static int submodule_has_dirty_index(const struct submodule *sub)\n \tprepare_submodule_repo_env(&cp.env_array);\n \n \tcp.git_cmd = 1;\n-\targv_array_pushl(&cp.args, \"diff-index\", \"--quiet\",\n+\tstrvec_pushl(&cp.args, \"diff-index\", \"--quiet\",\n \t\t\t\t   \"--cached\", \"HEAD\", NULL);\n \tcp.no_stdin = 1;\n \tcp.no_stdout = 1;\n@@ -1866,11 +1866,11 @@ static void submodule_reset_index(const char *path)\n \tcp.no_stdin = 1;\n \tcp.dir = path;\n \n-\targv_array_pushf(&cp.args, \"--super-prefix=%s%s/\",\n+\tstrvec_pushf(&cp.args, \"--super-prefix=%s%s/\",\n \t\t\t\t   get_super_prefix_or_empty(), path);\n-\targv_array_pushl(&cp.args, \"read-tree\", \"-u\", \"--reset\", NULL);\n+\tstrvec_pushl(&cp.args, \"read-tree\", \"-u\", \"--reset\", NULL);\n \n-\targv_array_push(&cp.args, empty_tree_oid_hex());\n+\tstrvec_push(&cp.args, empty_tree_oid_hex());\n \n \tif (run_command(&cp))\n \t\tdie(_(\"could not reset submodule index\"));\n@@ -1947,24 +1947,24 @@ int submodule_move_head(const char *path,\n \tcp.no_stdin = 1;\n \tcp.dir = path;\n \n-\targv_array_pushf(&cp.args, \"--super-prefix=%s%s/\",\n+\tstrvec_pushf(&cp.args, \"--super-prefix=%s%s/\",\n \t\t\tget_super_prefix_or_empty(), path);\n-\targv_array_pushl(&cp.args, \"read-tree\", \"--recurse-submodules\", NULL);\n+\tstrvec_pushl(&cp.args, \"read-tree\", \"--recurse-submodules\", NULL);\n \n \tif (flags & SUBMODULE_MOVE_HEAD_DRY_RUN)\n-\t\targv_array_push(&cp.args, \"-n\");\n+\t\tstrvec_push(&cp.args, \"-n\");\n \telse\n-\t\targv_array_push(&cp.args, \"-u\");\n+\t\tstrvec_push(&cp.args, \"-u\");\n \n \tif (flags & SUBMODULE_MOVE_HEAD_FORCE)\n-\t\targv_array_push(&cp.args, \"--reset\");\n+\t\tstrvec_push(&cp.args, \"--reset\");\n \telse\n-\t\targv_array_push(&cp.args, \"-m\");\n+\t\tstrvec_push(&cp.args, \"-m\");\n \n \tif (!(flags & SUBMODULE_MOVE_HEAD_FORCE))\n-\t\targv_array_push(&cp.args, old_head ? old_head : empty_tree_oid_hex());\n+\t\tstrvec_push(&cp.args, old_head ? old_head : empty_tree_oid_hex());\n \n-\targv_array_push(&cp.args, new_head ? new_head : empty_tree_oid_hex());\n+\tstrvec_push(&cp.args, new_head ? new_head : empty_tree_oid_hex());\n \n \tif (run_command(&cp)) {\n \t\tret = error(_(\"Submodule '%s' could not be updated.\"), path);\n@@ -1980,7 +1980,7 @@ int submodule_move_head(const char *path,\n \t\t\tcp.dir = path;\n \n \t\t\tprepare_submodule_repo_env(&cp.env_array);\n-\t\t\targv_array_pushl(&cp.args, \"update-ref\", \"HEAD\",\n+\t\t\tstrvec_pushl(&cp.args, \"update-ref\", \"HEAD\",\n \t\t\t\t\t \"--no-deref\", new_head, NULL);\n \n \t\t\tif (run_command(&cp)) {\n@@ -2157,7 +2157,7 @@ void absorb_git_dir_into_superproject(const char *path,\n \t\tcp.dir = path;\n \t\tcp.git_cmd = 1;\n \t\tcp.no_stdin = 1;\n-\t\targv_array_pushl(&cp.args, \"--super-prefix\", sb.buf,\n+\t\tstrvec_pushl(&cp.args, \"--super-prefix\", sb.buf,\n \t\t\t\t\t   \"submodule--helper\",\n \t\t\t\t\t   \"absorb-git-dirs\", NULL);\n \t\tprepare_submodule_repo_env(&cp.env_array);\n@@ -2194,9 +2194,9 @@ int get_superproject_working_tree(struct strbuf *buf)\n \tstrbuf_release(&one_up);\n \n \tprepare_submodule_repo_env(&cp.env_array);\n-\targv_array_pop(&cp.env_array);\n+\tstrvec_pop(&cp.env_array);\n \n-\targv_array_pushl(&cp.args, \"--literal-pathspecs\", \"-C\", \"..\",\n+\tstrvec_pushl(&cp.args, \"--literal-pathspecs\", \"-C\", \"..\",\n \t\t\t\"ls-files\", \"-z\", \"--stage\", \"--full-name\", \"--\",\n \t\t\tsubpath, NULL);\n \tstrbuf_reset(&sb);\ndiff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c\nindex 8d3f6d5a5e..67dde56962 100644\n--- a/t/helper/test-run-command.c\n+++ b/t/helper/test-run-command.c\n@@ -31,7 +31,7 @@ static int parallel_next(struct child_process *cp,\n \tif (number_callbacks >= 4)\n \t\treturn 0;\n \n-\targv_array_pushv(&cp->args, d->argv);\n+\tstrvec_pushv(&cp->args, d->argv);\n \tstrbuf_addstr(err, \"preloaded output of a child\\n\");\n \tnumber_callbacks++;\n \treturn 1;\n@@ -72,19 +72,19 @@ static int next_test(struct child_process *cp, struct strbuf *err, void *cb,\n \t\treturn 0;\n \n \ttest = suite->tests.items[suite->next++].string;\n-\targv_array_pushl(&cp->args, \"sh\", test, NULL);\n+\tstrvec_pushl(&cp->args, \"sh\", test, NULL);\n \tif (suite->quiet)\n-\t\targv_array_push(&cp->args, \"--quiet\");\n+\t\tstrvec_push(&cp->args, \"--quiet\");\n \tif (suite->immediate)\n-\t\targv_array_push(&cp->args, \"-i\");\n+\t\tstrvec_push(&cp->args, \"-i\");\n \tif (suite->verbose)\n-\t\targv_array_push(&cp->args, \"-v\");\n+\t\tstrvec_push(&cp->args, \"-v\");\n \tif (suite->verbose_log)\n-\t\targv_array_push(&cp->args, \"-V\");\n+\t\tstrvec_push(&cp->args, \"-V\");\n \tif (suite->trace)\n-\t\targv_array_push(&cp->args, \"-x\");\n+\t\tstrvec_push(&cp->args, \"-x\");\n \tif (suite->write_junit_xml)\n-\t\targv_array_push(&cp->args, \"--write-junit-xml\");\n+\t\tstrvec_push(&cp->args, \"--write-junit-xml\");\n \n \tstrbuf_addf(err, \"Output of '%s':\\n\", test);\n \t*task_cb = (void *)test;\n@@ -220,7 +220,7 @@ static int quote_stress_test(int argc, const char **argv)\n \tchar special[] = \".?*\\\\^_\\\"'`{}()[]<>@~&+:;$%\"; // \\t\\r\\n\\a\";\n \tint i, j, k, trials = 100, skip = 0, msys2 = 0;\n \tstruct strbuf out = STRBUF_INIT;\n-\tstruct argv_array args = ARGV_ARRAY_INIT;\n+\tstruct strvec args = STRVEC_INIT;\n \tstruct option options[] = {\n \t\tOPT_INTEGER('n', \"trials\", &trials, \"Number of trials\"),\n \t\tOPT_INTEGER('s', \"skip\", &skip, \"Skip <n> trials\"),\n@@ -241,20 +241,20 @@ static int quote_stress_test(int argc, const char **argv)\n \t\tsize_t arg_count, arg_offset;\n \t\tint ret = 0;\n \n-\t\targv_array_clear(&args);\n+\t\tstrvec_clear(&args);\n \t\tif (msys2)\n-\t\t\targv_array_pushl(&args, \"sh\", \"-c\",\n+\t\t\tstrvec_pushl(&args, \"sh\", \"-c\",\n \t\t\t\t\t \"printf %s\\\\\\\\0 \\\"$@\\\"\", \"skip\", NULL);\n \t\telse\n-\t\t\targv_array_pushl(&args, \"test-tool\", \"run-command\",\n+\t\t\tstrvec_pushl(&args, \"test-tool\", \"run-command\",\n \t\t\t\t\t \"quote-echo\", NULL);\n \t\targ_offset = args.argc;\n \n \t\tif (argc > 0) {\n \t\t\ttrials = 1;\n \t\t\targ_count = argc;\n \t\t\tfor (j = 0; j < arg_count; j++)\n-\t\t\t\targv_array_push(&args, argv[j]);\n+\t\t\t\tstrvec_push(&args, argv[j]);\n \t\t} else {\n \t\t\targ_count = 1 + (my_random() % 5);\n \t\t\tfor (j = 0; j < arg_count; j++) {\n@@ -268,7 +268,7 @@ static int quote_stress_test(int argc, const char **argv)\n \t\t\t\t\t\tARRAY_SIZE(special)];\n \t\t\t\tbuf[arg_len] = '\\0';\n \n-\t\t\t\targv_array_push(&args, buf);\n+\t\t\t\tstrvec_push(&args, buf);\n \t\t\t}\n \t\t}\n \n@@ -301,7 +301,7 @@ static int quote_stress_test(int argc, const char **argv)\n \t\t\t\t\t(int)j, args.argv[j + arg_offset]);\n \n \t\t\tstrbuf_release(&out);\n-\t\t\targv_array_clear(&args);\n+\t\t\tstrvec_clear(&args);\n \n \t\t\treturn ret;\n \t\t}\n@@ -311,7 +311,7 @@ static int quote_stress_test(int argc, const char **argv)\n \t}\n \n \tstrbuf_release(&out);\n-\targv_array_clear(&args);\n+\tstrvec_clear(&args);\n \n \treturn 0;\n }\n@@ -338,7 +338,7 @@ static int inherit_handle(const char *argv0)\n \txsnprintf(path, sizeof(path), \"out-XXXXXX\");\n \ttmp = xmkstemp(path);\n \n-\targv_array_pushl(&cp.args,\n+\tstrvec_pushl(&cp.args,\n \t\t\t \"test-tool\", argv0, \"inherited-handle-child\", NULL);\n \tcp.in = -1;\n \tcp.no_stdout = cp.no_stderr = 1;\n@@ -391,7 +391,7 @@ int cmd__run_command(int argc, const char **argv)\n \twhile (!strcmp(argv[1], \"env\")) {\n \t\tif (!argv[2])\n \t\t\tdie(\"env specifier without a value\");\n-\t\targv_array_push(&proc.env_array, argv[2]);\n+\t\tstrvec_push(&proc.env_array, argv[2]);\n \t\targv += 2;\n \t\targc -= 2;\n \t}\ndiff --git a/tmp-objdir.c b/tmp-objdir.c\nindex 06924a7875..e78e481d8e 100644\n--- a/tmp-objdir.c\n+++ b/tmp-objdir.c\n@@ -10,7 +10,7 @@\n \n struct tmp_objdir {\n \tstruct strbuf path;\n-\tstruct argv_array env;\n+\tstruct strvec env;\n };\n \n /*\n@@ -24,7 +24,7 @@ static struct tmp_objdir *the_tmp_objdir;\n static void tmp_objdir_free(struct tmp_objdir *t)\n {\n \tstrbuf_release(&t->path);\n-\targv_array_clear(&t->env);\n+\tstrvec_clear(&t->env);\n \tfree(t);\n }\n \n@@ -79,7 +79,7 @@ static void remove_tmp_objdir_on_signal(int signo)\n  * separated by PATH_SEP (which is what separate values in\n  * GIT_ALTERNATE_OBJECT_DIRECTORIES).\n  */\n-static void env_append(struct argv_array *env, const char *key, const char *val)\n+static void env_append(struct strvec *env, const char *key, const char *val)\n {\n \tstruct strbuf quoted = STRBUF_INIT;\n \tconst char *old;\n@@ -97,16 +97,16 @@ static void env_append(struct argv_array *env, const char *key, const char *val)\n \n \told = getenv(key);\n \tif (!old)\n-\t\targv_array_pushf(env, \"%s=%s\", key, val);\n+\t\tstrvec_pushf(env, \"%s=%s\", key, val);\n \telse\n-\t\targv_array_pushf(env, \"%s=%s%c%s\", key, old, PATH_SEP, val);\n+\t\tstrvec_pushf(env, \"%s=%s%c%s\", key, old, PATH_SEP, val);\n \n \tstrbuf_release(&quoted);\n }\n \n-static void env_replace(struct argv_array *env, const char *key, const char *val)\n+static void env_replace(struct strvec *env, const char *key, const char *val)\n {\n-\targv_array_pushf(env, \"%s=%s\", key, val);\n+\tstrvec_pushf(env, \"%s=%s\", key, val);\n }\n \n static int setup_tmp_objdir(const char *root)\n@@ -131,7 +131,7 @@ struct tmp_objdir *tmp_objdir_create(void)\n \n \tt = xmalloc(sizeof(*t));\n \tstrbuf_init(&t->path, 0);\n-\targv_array_init(&t->env);\n+\tstrvec_init(&t->env);\n \n \tstrbuf_addf(&t->path, \"%s/incoming-XXXXXX\", get_object_directory());\n \ndiff --git a/transport-helper.c b/transport-helper.c\nindex 441763fd7c..dcd4adf444 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -128,14 +128,14 @@ static struct child_process *get_helper(struct transport *transport)\n \thelper->in = -1;\n \thelper->out = -1;\n \thelper->err = 0;\n-\targv_array_pushf(&helper->args, \"git-remote-%s\", data->name);\n-\targv_array_push(&helper->args, transport->remote->name);\n-\targv_array_push(&helper->args, remove_ext_force(transport->url));\n+\tstrvec_pushf(&helper->args, \"git-remote-%s\", data->name);\n+\tstrvec_push(&helper->args, transport->remote->name);\n+\tstrvec_push(&helper->args, remove_ext_force(transport->url));\n \thelper->git_cmd = 0;\n \thelper->silent_exec_failure = 1;\n \n \tif (have_git_dir())\n-\t\targv_array_pushf(&helper->env_array, \"%s=%s\",\n+\t\tstrvec_pushf(&helper->env_array, \"%s=%s\",\n \t\t\t\t GIT_DIR_ENVIRONMENT, get_git_dir());\n \n \thelper->trace2_child_class = helper->args.argv[0]; /* \"remote-<name>\" */\n@@ -439,13 +439,13 @@ static int get_importer(struct transport *transport, struct child_process *fasti\n \tint cat_blob_fd, code;\n \tchild_process_init(fastimport);\n \tfastimport->in = xdup(helper->out);\n-\targv_array_push(&fastimport->args, \"fast-import\");\n-\targv_array_push(&fastimport->args, \"--allow-unsafe-features\");\n-\targv_array_push(&fastimport->args, debug ? \"--stats\" : \"--quiet\");\n+\tstrvec_push(&fastimport->args, \"fast-import\");\n+\tstrvec_push(&fastimport->args, \"--allow-unsafe-features\");\n+\tstrvec_push(&fastimport->args, debug ? \"--stats\" : \"--quiet\");\n \n \tif (data->bidi_import) {\n \t\tcat_blob_fd = xdup(helper->in);\n-\t\targv_array_pushf(&fastimport->args, \"--cat-blob-fd=%d\", cat_blob_fd);\n+\t\tstrvec_pushf(&fastimport->args, \"--cat-blob-fd=%d\", cat_blob_fd);\n \t}\n \tfastimport->git_cmd = 1;\n \n@@ -466,17 +466,17 @@ static int get_exporter(struct transport *transport,\n \t/* we need to duplicate helper->in because we want to use it after\n \t * fastexport is done with it. */\n \tfastexport->out = dup(helper->in);\n-\targv_array_push(&fastexport->args, \"fast-export\");\n-\targv_array_push(&fastexport->args, \"--use-done-feature\");\n-\targv_array_push(&fastexport->args, data->signed_tags ?\n+\tstrvec_push(&fastexport->args, \"fast-export\");\n+\tstrvec_push(&fastexport->args, \"--use-done-feature\");\n+\tstrvec_push(&fastexport->args, data->signed_tags ?\n \t\t\"--signed-tags=verbatim\" : \"--signed-tags=warn-strip\");\n \tif (data->export_marks)\n-\t\targv_array_pushf(&fastexport->args, \"--export-marks=%s.tmp\", data->export_marks);\n+\t\tstrvec_pushf(&fastexport->args, \"--export-marks=%s.tmp\", data->export_marks);\n \tif (data->import_marks)\n-\t\targv_array_pushf(&fastexport->args, \"--import-marks=%s\", data->import_marks);\n+\t\tstrvec_pushf(&fastexport->args, \"--import-marks=%s\", data->import_marks);\n \n \tfor (i = 0; i < revlist_args->nr; i++)\n-\t\targv_array_push(&fastexport->args, revlist_args->items[i].string);\n+\t\tstrvec_push(&fastexport->args, revlist_args->items[i].string);\n \n \tfastexport->git_cmd = 1;\n \treturn start_command(fastexport);\n@@ -1082,7 +1082,7 @@ static int has_attribute(const char *attrs, const char *attr)\n }\n \n static struct ref *get_refs_list(struct transport *transport, int for_push,\n-\t\t\t\t const struct argv_array *ref_prefixes)\n+\t\t\t\t const struct strvec *ref_prefixes)\n {\n \tget_helper(transport);\n \ndiff --git a/transport-internal.h b/transport-internal.h\nindex 284784a2a6..27c9daffc4 100644\n--- a/transport-internal.h\n+++ b/transport-internal.h\n@@ -30,7 +30,7 @@ struct transport_vtable {\n \t * in the ref's old_sha1 field; otherwise it should be all 0.\n \t **/\n \tstruct ref *(*get_refs_list)(struct transport *transport, int for_push,\n-\t\t\t\t     const struct argv_array *ref_prefixes);\n+\t\t\t\t     const struct strvec *ref_prefixes);\n \n \t/**\n \t * Fetch the objects for the given refs. Note that this gets\ndiff --git a/transport.c b/transport.c\nindex b41386eccb..2d4fd851dc 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -127,7 +127,7 @@ struct bundle_transport_data {\n \n static struct ref *get_refs_from_bundle(struct transport *transport,\n \t\t\t\t\tint for_push,\n-\t\t\t\t\tconst struct argv_array *ref_prefixes)\n+\t\t\t\t\tconst struct strvec *ref_prefixes)\n {\n \tstruct bundle_transport_data *data = transport->data;\n \tstruct ref *result = NULL;\n@@ -283,7 +283,7 @@ static void die_if_server_options(struct transport *transport)\n  * remote refs.\n  */\n static struct ref *handshake(struct transport *transport, int for_push,\n-\t\t\t     const struct argv_array *ref_prefixes,\n+\t\t\t     const struct strvec *ref_prefixes,\n \t\t\t     int must_list_refs)\n {\n \tstruct git_transport_data *data = transport->data;\n@@ -327,7 +327,7 @@ static struct ref *handshake(struct transport *transport, int for_push,\n }\n \n static struct ref *get_refs_via_connect(struct transport *transport, int for_push,\n-\t\t\t\t\tconst struct argv_array *ref_prefixes)\n+\t\t\t\t\tconst struct strvec *ref_prefixes)\n {\n \treturn handshake(transport, for_push, ref_prefixes, 1);\n }\n@@ -1153,7 +1153,7 @@ int transport_push(struct repository *r,\n \t\tint porcelain = flags & TRANSPORT_PUSH_PORCELAIN;\n \t\tint pretend = flags & TRANSPORT_PUSH_DRY_RUN;\n \t\tint push_ret, ret, err;\n-\t\tstruct argv_array ref_prefixes = ARGV_ARRAY_INIT;\n+\t\tstruct strvec ref_prefixes = STRVEC_INIT;\n \n \t\tif (check_push_refs(local_refs, rs) < 0)\n \t\t\treturn -1;\n@@ -1165,7 +1165,7 @@ int transport_push(struct repository *r,\n \t\t\t\t\t\t\t       &ref_prefixes);\n \t\ttrace2_region_leave(\"transport_push\", \"get_refs_list\", r);\n \n-\t\targv_array_clear(&ref_prefixes);\n+\t\tstrvec_clear(&ref_prefixes);\n \n \t\tif (flags & TRANSPORT_PUSH_ALL)\n \t\t\tmatch_flags |= MATCH_REFS_ALL;\n@@ -1281,7 +1281,7 @@ int transport_push(struct repository *r,\n }\n \n const struct ref *transport_get_remote_refs(struct transport *transport,\n-\t\t\t\t\t    const struct argv_array *ref_prefixes)\n+\t\t\t\t\t    const struct strvec *ref_prefixes)\n {\n \tif (!transport->got_remote_refs) {\n \t\ttransport->remote_refs =\ndiff --git a/transport.h b/transport.h\nindex b3c30133ea..1be4013dec 100644\n--- a/transport.h\n+++ b/transport.h\n@@ -243,7 +243,7 @@ int transport_push(struct repository *repo,\n  * ref_prefixes.\n  */\n const struct ref *transport_get_remote_refs(struct transport *transport,\n-\t\t\t\t\t    const struct argv_array *ref_prefixes);\n+\t\t\t\t\t    const struct strvec *ref_prefixes);\n \n /*\n  * Fetch the hash algorithm used by a remote.\ndiff --git a/unpack-trees.c b/unpack-trees.c\nindex 65c3395f0f..323280dd48 100644\n--- a/unpack-trees.c\n+++ b/unpack-trees.c\n@@ -106,7 +106,7 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,\n \tconst char **msgs = opts->msgs;\n \tconst char *msg;\n \n-\targv_array_init(&opts->msgs_to_free);\n+\tstrvec_init(&opts->msgs_to_free);\n \n \tif (!strcmp(cmd, \"checkout\"))\n \t\tmsg = advice_commit_before_merge\n@@ -124,7 +124,7 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,\n \t\t\t  \"Please commit your changes or stash them before you %s.\")\n \t\t      : _(\"Your local changes to the following files would be overwritten by %s:\\n%%s\");\n \tmsgs[ERROR_WOULD_OVERWRITE] = msgs[ERROR_NOT_UPTODATE_FILE] =\n-\t\targv_array_pushf(&opts->msgs_to_free, msg, cmd, cmd);\n+\t\tstrvec_pushf(&opts->msgs_to_free, msg, cmd, cmd);\n \n \tmsgs[ERROR_NOT_UPTODATE_DIR] =\n \t\t_(\"Updating the following directories would lose untracked files in them:\\n%s\");\n@@ -145,7 +145,7 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,\n \t\t\t  \"Please move or remove them before you %s.\")\n \t\t      : _(\"The following untracked working tree files would be removed by %s:\\n%%s\");\n \tmsgs[ERROR_WOULD_LOSE_UNTRACKED_REMOVED] =\n-\t\targv_array_pushf(&opts->msgs_to_free, msg, cmd, cmd);\n+\t\tstrvec_pushf(&opts->msgs_to_free, msg, cmd, cmd);\n \n \tif (!strcmp(cmd, \"checkout\"))\n \t\tmsg = advice_commit_before_merge\n@@ -163,7 +163,7 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,\n \t\t\t  \"Please move or remove them before you %s.\")\n \t\t      : _(\"The following untracked working tree files would be overwritten by %s:\\n%%s\");\n \tmsgs[ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN] =\n-\t\targv_array_pushf(&opts->msgs_to_free, msg, cmd, cmd);\n+\t\tstrvec_pushf(&opts->msgs_to_free, msg, cmd, cmd);\n \n \t/*\n \t * Special case: ERROR_BIND_OVERLAP refers to a pair of paths, we\n@@ -189,7 +189,7 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,\n \n void clear_unpack_trees_porcelain(struct unpack_trees_options *opts)\n {\n-\targv_array_clear(&opts->msgs_to_free);\n+\tstrvec_clear(&opts->msgs_to_free);\n \tmemset(opts->msgs, 0, sizeof(opts->msgs));\n }\n \ndiff --git a/unpack-trees.h b/unpack-trees.h\nindex f8a904a05b..2e87875b15 100644\n--- a/unpack-trees.h\n+++ b/unpack-trees.h\n@@ -70,7 +70,7 @@ struct unpack_trees_options {\n \tstruct pathspec *pathspec;\n \tmerge_fn_t fn;\n \tconst char *msgs[NB_UNPACK_TREES_WARNING_TYPES];\n-\tstruct argv_array msgs_to_free;\n+\tstruct strvec msgs_to_free;\n \t/*\n \t * Store error messages in an array, each case\n \t * corresponding to a error message type\ndiff --git a/upload-pack.c b/upload-pack.c\nindex b435dae62f..1b0e1fca1a 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -269,45 +269,45 @@ static void create_pack_file(struct upload_pack_data *pack_data,\n \tif (!pack_data->pack_objects_hook)\n \t\tpack_objects.git_cmd = 1;\n \telse {\n-\t\targv_array_push(&pack_objects.args, pack_data->pack_objects_hook);\n-\t\targv_array_push(&pack_objects.args, \"git\");\n+\t\tstrvec_push(&pack_objects.args, pack_data->pack_objects_hook);\n+\t\tstrvec_push(&pack_objects.args, \"git\");\n \t\tpack_objects.use_shell = 1;\n \t}\n \n \tif (pack_data->shallow_nr) {\n-\t\targv_array_push(&pack_objects.args, \"--shallow-file\");\n-\t\targv_array_push(&pack_objects.args, \"\");\n+\t\tstrvec_push(&pack_objects.args, \"--shallow-file\");\n+\t\tstrvec_push(&pack_objects.args, \"\");\n \t}\n-\targv_array_push(&pack_objects.args, \"pack-objects\");\n-\targv_array_push(&pack_objects.args, \"--revs\");\n+\tstrvec_push(&pack_objects.args, \"pack-objects\");\n+\tstrvec_push(&pack_objects.args, \"--revs\");\n \tif (pack_data->use_thin_pack)\n-\t\targv_array_push(&pack_objects.args, \"--thin\");\n+\t\tstrvec_push(&pack_objects.args, \"--thin\");\n \n-\targv_array_push(&pack_objects.args, \"--stdout\");\n+\tstrvec_push(&pack_objects.args, \"--stdout\");\n \tif (pack_data->shallow_nr)\n-\t\targv_array_push(&pack_objects.args, \"--shallow\");\n+\t\tstrvec_push(&pack_objects.args, \"--shallow\");\n \tif (!pack_data->no_progress)\n-\t\targv_array_push(&pack_objects.args, \"--progress\");\n+\t\tstrvec_push(&pack_objects.args, \"--progress\");\n \tif (pack_data->use_ofs_delta)\n-\t\targv_array_push(&pack_objects.args, \"--delta-base-offset\");\n+\t\tstrvec_push(&pack_objects.args, \"--delta-base-offset\");\n \tif (pack_data->use_include_tag)\n-\t\targv_array_push(&pack_objects.args, \"--include-tag\");\n+\t\tstrvec_push(&pack_objects.args, \"--include-tag\");\n \tif (pack_data->filter_options.choice) {\n \t\tconst char *spec =\n \t\t\texpand_list_objects_filter_spec(&pack_data->filter_options);\n \t\tif (pack_objects.use_shell) {\n \t\t\tstruct strbuf buf = STRBUF_INIT;\n \t\t\tsq_quote_buf(&buf, spec);\n-\t\t\targv_array_pushf(&pack_objects.args, \"--filter=%s\", buf.buf);\n+\t\t\tstrvec_pushf(&pack_objects.args, \"--filter=%s\", buf.buf);\n \t\t\tstrbuf_release(&buf);\n \t\t} else {\n-\t\t\targv_array_pushf(&pack_objects.args, \"--filter=%s\",\n+\t\t\tstrvec_pushf(&pack_objects.args, \"--filter=%s\",\n \t\t\t\t\t spec);\n \t\t}\n \t}\n \tif (uri_protocols) {\n \t\tfor (i = 0; i < uri_protocols->nr; i++)\n-\t\t\targv_array_pushf(&pack_objects.args, \"--uri-protocol=%s\",\n+\t\t\tstrvec_pushf(&pack_objects.args, \"--uri-protocol=%s\",\n \t\t\t\t\t uri_protocols->items[i].string);\n \t}\n \n@@ -880,26 +880,26 @@ static int send_shallow_list(struct upload_pack_data *data)\n \t\tdeepen(data, data->depth);\n \t\tret = 1;\n \t} else if (data->deepen_rev_list) {\n-\t\tstruct argv_array av = ARGV_ARRAY_INIT;\n+\t\tstruct strvec av = STRVEC_INIT;\n \t\tint i;\n \n-\t\targv_array_push(&av, \"rev-list\");\n+\t\tstrvec_push(&av, \"rev-list\");\n \t\tif (data->deepen_since)\n-\t\t\targv_array_pushf(&av, \"--max-age=%\"PRItime, data->deepen_since);\n+\t\t\tstrvec_pushf(&av, \"--max-age=%\"PRItime, data->deepen_since);\n \t\tif (data->deepen_not.nr) {\n-\t\t\targv_array_push(&av, \"--not\");\n+\t\t\tstrvec_push(&av, \"--not\");\n \t\t\tfor (i = 0; i < data->deepen_not.nr; i++) {\n \t\t\t\tstruct string_list_item *s = data->deepen_not.items + i;\n-\t\t\t\targv_array_push(&av, s->string);\n+\t\t\t\tstrvec_push(&av, s->string);\n \t\t\t}\n-\t\t\targv_array_push(&av, \"--not\");\n+\t\t\tstrvec_push(&av, \"--not\");\n \t\t}\n \t\tfor (i = 0; i < data->want_obj.nr; i++) {\n \t\t\tstruct object *o = data->want_obj.objects[i].item;\n-\t\t\targv_array_push(&av, oid_to_hex(&o->oid));\n+\t\t\tstrvec_push(&av, oid_to_hex(&o->oid));\n \t\t}\n \t\tdeepen_by_rev_list(data, av.argc, av.argv);\n-\t\targv_array_clear(&av);\n+\t\tstrvec_clear(&av);\n \t\tret = 1;\n \t} else {\n \t\tif (data->shallows.nr > 0) {\n@@ -1521,7 +1521,7 @@ enum fetch_state {\n \tFETCH_DONE,\n };\n \n-int upload_pack_v2(struct repository *r, struct argv_array *keys,\n+int upload_pack_v2(struct repository *r, struct strvec *keys,\n \t\t   struct packet_reader *request)\n {\n \tenum fetch_state state = FETCH_PROCESS_ARGS;\ndiff --git a/wt-status.c b/wt-status.c\nindex 9817161da4..60d4e847a5 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -913,17 +913,17 @@ static void wt_longstatus_print_submodule_summary(struct wt_status *s, int uncom\n \tstruct strbuf summary = STRBUF_INIT;\n \tchar *summary_content;\n \n-\targv_array_pushf(&sm_summary.env_array, \"GIT_INDEX_FILE=%s\",\n+\tstrvec_pushf(&sm_summary.env_array, \"GIT_INDEX_FILE=%s\",\n \t\t\t s->index_file);\n \n-\targv_array_push(&sm_summary.args, \"submodule\");\n-\targv_array_push(&sm_summary.args, \"summary\");\n-\targv_array_push(&sm_summary.args, uncommitted ? \"--files\" : \"--cached\");\n-\targv_array_push(&sm_summary.args, \"--for-status\");\n-\targv_array_push(&sm_summary.args, \"--summary-limit\");\n-\targv_array_pushf(&sm_summary.args, \"%d\", s->submodule_summary);\n+\tstrvec_push(&sm_summary.args, \"submodule\");\n+\tstrvec_push(&sm_summary.args, \"summary\");\n+\tstrvec_push(&sm_summary.args, uncommitted ? \"--files\" : \"--cached\");\n+\tstrvec_push(&sm_summary.args, \"--for-status\");\n+\tstrvec_push(&sm_summary.args, \"--summary-limit\");\n+\tstrvec_pushf(&sm_summary.args, \"%d\", s->submodule_summary);\n \tif (!uncommitted)\n-\t\targv_array_push(&sm_summary.args, s->amend ? \"HEAD^\" : \"HEAD\");\n+\t\tstrvec_push(&sm_summary.args, s->amend ? \"HEAD^\" : \"HEAD\");\n \n \tsm_summary.git_cmd = 1;\n \tsm_summary.no_stdin = 1;\n-- \n2.28.0.rc2.475.g53c7e1c7f4\n\n"},{"id":"402238","messageId":"20200728202631.GH1021513@coredump.intra.peff.net","threadId":"53940","inReplyTo":"20200728202124.GA1021264@coredump.intra.peff.net","subject":"[PATCH 08/11] strvec: fix indentation in renamed calls","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-28T20:26:31Z","receivedAt":"2020-07-28T20:26:38Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Code which split an argv_array call across multiple lines, like:\n\n  argv_array_pushl(&args, \"one argument\",\n                   \"another argument\", \"and more\",\n\t\t   NULL);\n\nwas recently mechanically renamed to use strvec, which results in\nmis-matched indentation like:\n\n  strvec_pushl(&args, \"one argument\",\n                   \"another argument\", \"and more\",\n\t\t   NULL);\n\nLet's fix these up to align the arguments with the opening paren. I did\nthis manually by sifting through the results of:\n\n  git jump grep 'strvec_.*,$'\n\nand liberally applying my editor's auto-format. Most of the changes are\nof the form shown above, though I also normalized a few that had\noriginally used a single-tab indentation (rather than our usual style of\naligning with the open paren). I also rewrapped a couple of obvious\ncases (e.g., where previously too-long lines became short enough to fit\non one), but I wasn't aggressive about it. In cases broken to three or\nmore lines, the grouping of arguments is sometimes meaningful, and it\nwasn't worth my time or reviewer time to ponder each case individually.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n add-interactive.c           | 10 ++++-----\n add-patch.c                 | 10 ++++-----\n bisect.c                    |  2 +-\n builtin/bisect--helper.c    |  2 +-\n builtin/describe.c          |  8 +++----\n builtin/difftool.c          | 12 +++++------\n builtin/fetch.c             |  2 +-\n builtin/gc.c                |  2 +-\n builtin/pull.c              |  6 +++---\n builtin/rebase.c            | 14 ++++++-------\n builtin/receive-pack.c      | 42 ++++++++++++++++++-------------------\n builtin/repack.c            |  8 +++----\n builtin/stash.c             | 38 ++++++++++++++++-----------------\n builtin/submodule--helper.c | 20 +++++++++---------\n builtin/worktree.c          | 18 ++++++++--------\n bundle.c                    | 10 ++++-----\n connect.c                   |  7 ++++---\n connected.c                 |  2 +-\n daemon.c                    |  6 +++---\n fetch-pack.c                | 12 +++++------\n gpg-interface.c             | 14 ++++++-------\n http-backend.c              |  2 +-\n http-push.c                 |  2 +-\n http.c                      |  2 +-\n range-diff.c                | 28 ++++++++++++-------------\n refspec.c                   |  4 ++--\n remote-curl.c               |  8 +++----\n remote.c                    |  4 ++--\n sequencer.c                 |  8 +++----\n submodule.c                 | 30 +++++++++++++-------------\n t/helper/test-run-command.c |  6 +++---\n transport-helper.c          |  2 +-\n upload-pack.c               |  3 +--\n wt-status.c                 |  3 +--\n 34 files changed, 173 insertions(+), 174 deletions(-)\n\ndiff --git a/add-interactive.c b/add-interactive.c\nindex b345777d0c..458f3a3e69 100644\n--- a/add-interactive.c\n+++ b/add-interactive.c\n@@ -941,7 +941,7 @@ static int run_patch(struct add_i_state *s, const struct pathspec *ps,\n \t\tfor (i = 0; i < files->items.nr; i++)\n \t\t\tif (files->selected[i])\n \t\t\t\tstrvec_push(&args,\n-\t\t\t\t\t\tfiles->items.items[i].string);\n+\t\t\t\t\t    files->items.items[i].string);\n \t\tparse_pathspec(&ps_selected,\n \t\t\t       PATHSPEC_ALL_MAGIC & ~PATHSPEC_LITERAL,\n \t\t\t       PATHSPEC_LITERAL_PATH, \"\", args.argv);\n@@ -979,13 +979,13 @@ static int run_diff(struct add_i_state *s, const struct pathspec *ps,\n \t\tstruct strvec args = STRVEC_INIT;\n \n \t\tstrvec_pushl(&args, \"git\", \"diff\", \"-p\", \"--cached\",\n-\t\t\t\t oid_to_hex(!is_initial ? &oid :\n-\t\t\t\t\t    s->r->hash_algo->empty_tree),\n-\t\t\t\t \"--\", NULL);\n+\t\t\t     oid_to_hex(!is_initial ? &oid :\n+\t\t\t\t\ts->r->hash_algo->empty_tree),\n+\t\t\t     \"--\", NULL);\n \t\tfor (i = 0; i < files->items.nr; i++)\n \t\t\tif (files->selected[i])\n \t\t\t\tstrvec_push(&args,\n-\t\t\t\t\t\tfiles->items.items[i].string);\n+\t\t\t\t\t    files->items.items[i].string);\n \t\tres = run_command_v_opt(args.argv, 0);\n \t\tstrvec_clear(&args);\n \t}\ndiff --git a/add-patch.c b/add-patch.c\nindex 3c91ae52ae..8c0772803b 100644\n--- a/add-patch.c\n+++ b/add-patch.c\n@@ -291,7 +291,7 @@ static void setup_child_process(struct add_p_state *s,\n \n \tcp->git_cmd = 1;\n \tstrvec_pushf(&cp->env_array,\n-\t\t\t INDEX_ENVIRONMENT \"=%s\", s->s.r->index_file);\n+\t\t     INDEX_ENVIRONMENT \"=%s\", s->s.r->index_file);\n }\n \n static int parse_range(const char **p,\n@@ -386,10 +386,10 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)\n \tif (s->revision) {\n \t\tstruct object_id oid;\n \t\tstrvec_push(&args,\n-\t\t\t\t/* could be on an unborn branch */\n-\t\t\t\t!strcmp(\"HEAD\", s->revision) &&\n-\t\t\t\tget_oid(\"HEAD\", &oid) ?\n-\t\t\t\tempty_tree_oid_hex() : s->revision);\n+\t\t\t    /* could be on an unborn branch */\n+\t\t\t    !strcmp(\"HEAD\", s->revision) &&\n+\t\t\t    get_oid(\"HEAD\", &oid) ?\n+\t\t\t    empty_tree_oid_hex() : s->revision);\n \t}\n \tcolor_arg_index = args.argc;\n \t/* Use `--no-color` explicitly, just in case `diff.color = always`. */\ndiff --git a/bisect.c b/bisect.c\nindex 3e50b51c11..99ff694960 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -644,7 +644,7 @@ static void bisect_rev_setup(struct repository *r, struct rev_info *revs,\n \tstrvec_pushf(&rev_argv, bad_format, oid_to_hex(current_bad_oid));\n \tfor (i = 0; i < good_revs.nr; i++)\n \t\tstrvec_pushf(&rev_argv, good_format,\n-\t\t\t\t oid_to_hex(good_revs.oid + i));\n+\t\t\t     oid_to_hex(good_revs.oid + i));\n \tstrvec_push(&rev_argv, \"--\");\n \tif (read_paths)\n \t\tread_bisect_paths(&rev_argv);\ndiff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c\nindex 9815e78871..dd52878413 100644\n--- a/builtin/bisect--helper.c\n+++ b/builtin/bisect--helper.c\n@@ -529,7 +529,7 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout,\n \t\t\tstruct strvec argv = STRVEC_INIT;\n \n \t\t\tstrvec_pushl(&argv, \"checkout\", start_head.buf,\n-\t\t\t\t\t \"--\", NULL);\n+\t\t\t\t     \"--\", NULL);\n \t\t\tif (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {\n \t\t\t\tres = error(_(\"checking out '%s' failed.\"\n \t\t\t\t\t\t \" Try 'git bisect start \"\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex ff3c169fa9..e3cac8002c 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -505,8 +505,8 @@ static void describe_blob(struct object_id oid, struct strbuf *dst)\n \tstruct process_commit_data pcd = { null_oid, oid, dst, &revs};\n \n \tstrvec_pushl(&args, \"internal: The first arg is not parsed\",\n-\t\t\"--objects\", \"--in-commit-order\", \"--reverse\", \"HEAD\",\n-\t\tNULL);\n+\t\t     \"--objects\", \"--in-commit-order\", \"--reverse\", \"HEAD\",\n+\t\t     NULL);\n \n \trepo_init_revisions(the_repository, &revs, NULL);\n \tif (setup_revisions(args.argc, args.argv, &revs, NULL) > 1)\n@@ -598,8 +598,8 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \n \t\tstrvec_init(&args);\n \t\tstrvec_pushl(&args, \"name-rev\",\n-\t\t\t\t \"--peel-tag\", \"--name-only\", \"--no-undefined\",\n-\t\t\t\t NULL);\n+\t\t\t     \"--peel-tag\", \"--name-only\", \"--no-undefined\",\n+\t\t\t     NULL);\n \t\tif (always)\n \t\t\tstrvec_push(&args, \"--always\");\n \t\tif (!all) {\ndiff --git a/builtin/difftool.c b/builtin/difftool.c\nindex 40c4d7b6b6..5ac021a1d4 100644\n--- a/builtin/difftool.c\n+++ b/builtin/difftool.c\n@@ -211,9 +211,9 @@ static void changed_files(struct hashmap *result, const char *index_path,\n \tenv[0] = index_env.buf;\n \n \tstrvec_pushl(&update_index.args,\n-\t\t\t \"--git-dir\", git_dir, \"--work-tree\", workdir,\n-\t\t\t \"update-index\", \"--really-refresh\", \"-q\",\n-\t\t\t \"--unmerged\", NULL);\n+\t\t     \"--git-dir\", git_dir, \"--work-tree\", workdir,\n+\t\t     \"update-index\", \"--really-refresh\", \"-q\",\n+\t\t     \"--unmerged\", NULL);\n \tupdate_index.no_stdin = 1;\n \tupdate_index.no_stdout = 1;\n \tupdate_index.no_stderr = 1;\n@@ -226,8 +226,8 @@ static void changed_files(struct hashmap *result, const char *index_path,\n \trun_command(&update_index);\n \n \tstrvec_pushl(&diff_files.args,\n-\t\t\t \"--git-dir\", git_dir, \"--work-tree\", workdir,\n-\t\t\t \"diff-files\", \"--name-only\", \"-z\", NULL);\n+\t\t     \"--git-dir\", git_dir, \"--work-tree\", workdir,\n+\t\t     \"diff-files\", \"--name-only\", \"-z\", NULL);\n \tdiff_files.no_stdin = 1;\n \tdiff_files.git_cmd = 1;\n \tdiff_files.use_shell = 0;\n@@ -394,7 +394,7 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,\n \tchild.dir = prefix;\n \tchild.out = -1;\n \tstrvec_pushl(&child.args, \"diff\", \"--raw\", \"--no-abbrev\", \"-z\",\n-\t\t\t NULL);\n+\t\t     NULL);\n \tfor (i = 0; i < argc; i++)\n \t\tstrvec_push(&child.args, argv[i]);\n \tif (start_command(&child))\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex cc636188ad..c2e7afeb6a 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -1601,7 +1601,7 @@ static int fetch_multiple(struct string_list *list, int max_children)\n \t}\n \n \tstrvec_pushl(&argv, \"fetch\", \"--append\", \"--no-auto-gc\",\n-\t\t\t\"--no-write-commit-graph\", NULL);\n+\t\t     \"--no-write-commit-graph\", NULL);\n \tadd_options_to_argv(&argv);\n \n \tif (max_children != 1 && list->nr != 1) {\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 89742e159e..98719800a3 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -662,7 +662,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \t\t\t\tstrvec_push(&prune, \"--no-progress\");\n \t\t\tif (has_promisor_remote())\n \t\t\t\tstrvec_push(&prune,\n-\t\t\t\t\t\t\"--exclude-promisor-objects\");\n+\t\t\t\t\t    \"--exclude-promisor-objects\");\n \t\t\tif (run_command_v_opt(prune.argv, RUN_GIT_CMD))\n \t\t\t\tdie(FAILED_RUN, prune.argv[0]);\n \t\t}\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex 8a8d30e1dc..dae8766646 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -638,7 +638,7 @@ static int rebase_submodules(void)\n \tcp.git_cmd = 1;\n \tcp.no_stdin = 1;\n \tstrvec_pushl(&cp.args, \"submodule\", \"update\",\n-\t\t\t\t   \"--recursive\", \"--rebase\", NULL);\n+\t\t     \"--recursive\", \"--rebase\", NULL);\n \targv_push_verbosity(&cp.args);\n \n \treturn run_command(&cp);\n@@ -651,7 +651,7 @@ static int update_submodules(void)\n \tcp.git_cmd = 1;\n \tcp.no_stdin = 1;\n \tstrvec_pushl(&cp.args, \"submodule\", \"update\",\n-\t\t\t\t   \"--recursive\", \"--checkout\", NULL);\n+\t\t     \"--recursive\", \"--checkout\", NULL);\n \targv_push_verbosity(&cp.args);\n \n \treturn run_command(&cp);\n@@ -802,7 +802,7 @@ static int get_rebase_fork_point(struct object_id *fork_point, const char *repo,\n \t\treturn -1;\n \n \tstrvec_pushl(&cp.args, \"merge-base\", \"--fork-point\",\n-\t\t\tremote_branch, curr_branch->name, NULL);\n+\t\t     remote_branch, curr_branch->name, NULL);\n \tcp.no_stdin = 1;\n \tcp.no_stderr = 1;\n \tcp.git_cmd = 1;\ndiff --git a/builtin/rebase.c b/builtin/rebase.c\nindex fb56b9e263..35aeb8effc 100644\n--- a/builtin/rebase.c\n+++ b/builtin/rebase.c\n@@ -348,7 +348,7 @@ static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)\n \tstrvec_pushl(&make_script_args, \"\", revisions, NULL);\n \tif (opts->restrict_revision)\n \t\tstrvec_pushf(&make_script_args, \"^%s\",\n-\t\t\t\t oid_to_hex(&opts->restrict_revision->object.oid));\n+\t\t\t     oid_to_hex(&opts->restrict_revision->object.oid));\n \n \tret = sequencer_make_script(the_repository, &todo_list.buf,\n \t\t\t\t    make_script_args.argc, make_script_args.argv,\n@@ -858,17 +858,17 @@ static int run_am(struct rebase_options *opts)\n \n \tformat_patch.git_cmd = 1;\n \tstrvec_pushl(&format_patch.args, \"format-patch\", \"-k\", \"--stdout\",\n-\t\t\t \"--full-index\", \"--cherry-pick\", \"--right-only\",\n-\t\t\t \"--src-prefix=a/\", \"--dst-prefix=b/\", \"--no-renames\",\n-\t\t\t \"--no-cover-letter\", \"--pretty=mboxrd\", \"--topo-order\",\n-\t\t\t \"--no-base\", NULL);\n+\t\t     \"--full-index\", \"--cherry-pick\", \"--right-only\",\n+\t\t     \"--src-prefix=a/\", \"--dst-prefix=b/\", \"--no-renames\",\n+\t\t     \"--no-cover-letter\", \"--pretty=mboxrd\", \"--topo-order\",\n+\t\t     \"--no-base\", NULL);\n \tif (opts->git_format_patch_opt.len)\n \t\tstrvec_split(&format_patch.args,\n-\t\t\t\t opts->git_format_patch_opt.buf);\n+\t\t\t     opts->git_format_patch_opt.buf);\n \tstrvec_push(&format_patch.args, revisions.buf);\n \tif (opts->restrict_revision)\n \t\tstrvec_pushf(&format_patch.args, \"^%s\",\n-\t\t\t\t oid_to_hex(&opts->restrict_revision->object.oid));\n+\t\t\t     oid_to_hex(&opts->restrict_revision->object.oid));\n \n \tstatus = run_command(&format_patch);\n \tif (status) {\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex 71274231aa..1fc69cf5bc 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -668,24 +668,24 @@ static void prepare_push_cert_sha1(struct child_process *proc)\n \t}\n \tif (!is_null_oid(&push_cert_oid)) {\n \t\tstrvec_pushf(&proc->env_array, \"GIT_PUSH_CERT=%s\",\n-\t\t\t\t oid_to_hex(&push_cert_oid));\n+\t\t\t     oid_to_hex(&push_cert_oid));\n \t\tstrvec_pushf(&proc->env_array, \"GIT_PUSH_CERT_SIGNER=%s\",\n-\t\t\t\t sigcheck.signer ? sigcheck.signer : \"\");\n+\t\t\t     sigcheck.signer ? sigcheck.signer : \"\");\n \t\tstrvec_pushf(&proc->env_array, \"GIT_PUSH_CERT_KEY=%s\",\n-\t\t\t\t sigcheck.key ? sigcheck.key : \"\");\n+\t\t\t     sigcheck.key ? sigcheck.key : \"\");\n \t\tstrvec_pushf(&proc->env_array, \"GIT_PUSH_CERT_STATUS=%c\",\n-\t\t\t\t sigcheck.result);\n+\t\t\t     sigcheck.result);\n \t\tif (push_cert_nonce) {\n \t\t\tstrvec_pushf(&proc->env_array,\n-\t\t\t\t\t \"GIT_PUSH_CERT_NONCE=%s\",\n-\t\t\t\t\t push_cert_nonce);\n+\t\t\t\t     \"GIT_PUSH_CERT_NONCE=%s\",\n+\t\t\t\t     push_cert_nonce);\n \t\t\tstrvec_pushf(&proc->env_array,\n-\t\t\t\t\t \"GIT_PUSH_CERT_NONCE_STATUS=%s\",\n-\t\t\t\t\t nonce_status);\n+\t\t\t\t     \"GIT_PUSH_CERT_NONCE_STATUS=%s\",\n+\t\t\t\t     nonce_status);\n \t\t\tif (nonce_status == NONCE_SLOP)\n \t\t\t\tstrvec_pushf(&proc->env_array,\n-\t\t\t\t\t\t \"GIT_PUSH_CERT_NONCE_SLOP=%ld\",\n-\t\t\t\t\t\t nonce_stamp_slop);\n+\t\t\t\t\t     \"GIT_PUSH_CERT_NONCE_SLOP=%ld\",\n+\t\t\t\t\t     nonce_stamp_slop);\n \t\t}\n \t}\n }\n@@ -721,10 +721,10 @@ static int run_and_feed_hook(const char *hook_name, feed_fn feed,\n \t\tint i;\n \t\tfor (i = 0; i < feed_state->push_options->nr; i++)\n \t\t\tstrvec_pushf(&proc.env_array,\n-\t\t\t\t\"GIT_PUSH_OPTION_%d=%s\", i,\n-\t\t\t\tfeed_state->push_options->items[i].string);\n+\t\t\t\t     \"GIT_PUSH_OPTION_%d=%s\", i,\n+\t\t\t\t     feed_state->push_options->items[i].string);\n \t\tstrvec_pushf(&proc.env_array, \"GIT_PUSH_OPTION_COUNT=%d\",\n-\t\t\t\t feed_state->push_options->nr);\n+\t\t\t     feed_state->push_options->nr);\n \t} else\n \t\tstrvec_pushf(&proc.env_array, \"GIT_PUSH_OPTION_COUNT\");\n \n@@ -1718,7 +1718,7 @@ static const char *pack_lockfile;\n static void push_header_arg(struct strvec *args, struct pack_header *hdr)\n {\n \tstrvec_pushf(args, \"--pack_header=%\"PRIu32\",%\"PRIu32,\n-\t\t\tntohl(hdr->hdr_version), ntohl(hdr->hdr_entries));\n+\t\t     ntohl(hdr->hdr_version), ntohl(hdr->hdr_entries));\n }\n \n static const char *unpack(int err_fd, struct shallow_info *si)\n@@ -1768,10 +1768,10 @@ static const char *unpack(int err_fd, struct shallow_info *si)\n \t\t\tstrvec_push(&child.args, \"-q\");\n \t\tif (fsck_objects)\n \t\t\tstrvec_pushf(&child.args, \"--strict%s\",\n-\t\t\t\tfsck_msg_types.buf);\n+\t\t\t\t     fsck_msg_types.buf);\n \t\tif (max_input_size)\n \t\t\tstrvec_pushf(&child.args, \"--max-input-size=%\"PRIuMAX,\n-\t\t\t\t(uintmax_t)max_input_size);\n+\t\t\t\t     (uintmax_t)max_input_size);\n \t\tchild.no_stdout = 1;\n \t\tchild.err = err_fd;\n \t\tchild.git_cmd = 1;\n@@ -1787,22 +1787,22 @@ static const char *unpack(int err_fd, struct shallow_info *si)\n \t\tif (xgethostname(hostname, sizeof(hostname)))\n \t\t\txsnprintf(hostname, sizeof(hostname), \"localhost\");\n \t\tstrvec_pushf(&child.args,\n-\t\t\t\t \"--keep=receive-pack %\"PRIuMAX\" on %s\",\n-\t\t\t\t (uintmax_t)getpid(),\n-\t\t\t\t hostname);\n+\t\t\t     \"--keep=receive-pack %\"PRIuMAX\" on %s\",\n+\t\t\t     (uintmax_t)getpid(),\n+\t\t\t     hostname);\n \n \t\tif (!quiet && err_fd)\n \t\t\tstrvec_push(&child.args, \"--show-resolving-progress\");\n \t\tif (use_sideband)\n \t\t\tstrvec_push(&child.args, \"--report-end-of-input\");\n \t\tif (fsck_objects)\n \t\t\tstrvec_pushf(&child.args, \"--strict%s\",\n-\t\t\t\tfsck_msg_types.buf);\n+\t\t\t\t     fsck_msg_types.buf);\n \t\tif (!reject_thin)\n \t\t\tstrvec_push(&child.args, \"--fix-thin\");\n \t\tif (max_input_size)\n \t\t\tstrvec_pushf(&child.args, \"--max-input-size=%\"PRIuMAX,\n-\t\t\t\t(uintmax_t)max_input_size);\n+\t\t\t\t     (uintmax_t)max_input_size);\n \t\tchild.out = -1;\n \t\tchild.err = err_fd;\n \t\tchild.git_cmd = 1;\ndiff --git a/builtin/repack.c b/builtin/repack.c\nindex 7435ee9af1..04c5ceaf7e 100644\n--- a/builtin/repack.c\n+++ b/builtin/repack.c\n@@ -366,7 +366,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)\n \t\tstrvec_push(&cmd.args, \"--honor-pack-keep\");\n \tfor (i = 0; i < keep_pack_list.nr; i++)\n \t\tstrvec_pushf(&cmd.args, \"--keep-pack=%s\",\n-\t\t\t\t keep_pack_list.items[i].string);\n+\t\t\t     keep_pack_list.items[i].string);\n \tstrvec_push(&cmd.args, \"--non-empty\");\n \tstrvec_push(&cmd.args, \"--all\");\n \tstrvec_push(&cmd.args, \"--reflog\");\n@@ -388,12 +388,12 @@ int cmd_repack(int argc, const char **argv, const char *prefix)\n \t\tif (existing_packs.nr && delete_redundant) {\n \t\t\tif (unpack_unreachable) {\n \t\t\t\tstrvec_pushf(&cmd.args,\n-\t\t\t\t\t\t\"--unpack-unreachable=%s\",\n-\t\t\t\t\t\tunpack_unreachable);\n+\t\t\t\t\t     \"--unpack-unreachable=%s\",\n+\t\t\t\t\t     unpack_unreachable);\n \t\t\t\tstrvec_push(&cmd.env_array, \"GIT_REF_PARANOIA=1\");\n \t\t\t} else if (pack_everything & LOOSEN_UNREACHABLE) {\n \t\t\t\tstrvec_push(&cmd.args,\n-\t\t\t\t\t\t\"--unpack-unreachable\");\n+\t\t\t\t\t    \"--unpack-unreachable\");\n \t\t\t} else if (keep_unreachable) {\n \t\t\t\tstrvec_push(&cmd.args, \"--keep-unreachable\");\n \t\t\t\tstrvec_push(&cmd.args, \"--pack-loose-unreachable\");\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex 05c086e54c..bfdbafae89 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -336,7 +336,7 @@ static int get_newly_staged(struct strbuf *out, struct object_id *c_tree)\n \t */\n \tcp.git_cmd = 1;\n \tstrvec_pushl(&cp.args, \"diff-index\", \"--cached\", \"--name-only\",\n-\t\t\t \"--diff-filter=A\", NULL);\n+\t\t     \"--diff-filter=A\", NULL);\n \tstrvec_push(&cp.args, c_tree_hex);\n \treturn pipe_command(&cp, NULL, 0, out, 0, NULL, 0);\n }\n@@ -368,7 +368,7 @@ static int restore_untracked(struct object_id *u_tree)\n \tstrvec_push(&cp.args, \"read-tree\");\n \tstrvec_push(&cp.args, oid_to_hex(u_tree));\n \tstrvec_pushf(&cp.env_array, \"GIT_INDEX_FILE=%s\",\n-\t\t\t stash_index_path.buf);\n+\t\t     stash_index_path.buf);\n \tif (run_command(&cp)) {\n \t\tremove_path(stash_index_path.buf);\n \t\treturn -1;\n@@ -378,7 +378,7 @@ static int restore_untracked(struct object_id *u_tree)\n \tcp.git_cmd = 1;\n \tstrvec_pushl(&cp.args, \"checkout-index\", \"--all\", NULL);\n \tstrvec_pushf(&cp.env_array, \"GIT_INDEX_FILE=%s\",\n-\t\t\t stash_index_path.buf);\n+\t\t     stash_index_path.buf);\n \n \tres = run_command(&cp);\n \tremove_path(stash_index_path.buf);\n@@ -500,9 +500,9 @@ static int do_apply_stash(const char *prefix, struct stash_info *info,\n \t\tcp.git_cmd = 1;\n \t\tcp.dir = prefix;\n \t\tstrvec_pushf(&cp.env_array, GIT_WORK_TREE_ENVIRONMENT\"=%s\",\n-\t\t\t\t absolute_path(get_git_work_tree()));\n+\t\t\t     absolute_path(get_git_work_tree()));\n \t\tstrvec_pushf(&cp.env_array, GIT_DIR_ENVIRONMENT\"=%s\",\n-\t\t\t\t absolute_path(get_git_dir()));\n+\t\t\t     absolute_path(get_git_dir()));\n \t\tstrvec_push(&cp.args, \"status\");\n \t\trun_command(&cp);\n \t}\n@@ -547,7 +547,7 @@ static int do_drop_stash(struct stash_info *info, int quiet)\n \n \tcp_reflog.git_cmd = 1;\n \tstrvec_pushl(&cp_reflog.args, \"reflog\", \"delete\", \"--updateref\",\n-\t\t\t \"--rewrite\", NULL);\n+\t\t     \"--rewrite\", NULL);\n \tstrvec_push(&cp_reflog.args, info->revision.buf);\n \tret = run_command(&cp_reflog);\n \tif (!ret) {\n@@ -693,7 +693,7 @@ static int list_stash(int argc, const char **argv, const char *prefix)\n \n \tcp.git_cmd = 1;\n \tstrvec_pushl(&cp.args, \"log\", \"--format=%gd: %gs\", \"-g\",\n-\t\t\t \"--first-parent\", \"-m\", NULL);\n+\t\t     \"--first-parent\", \"-m\", NULL);\n \tstrvec_pushv(&cp.args, argv);\n \tstrvec_push(&cp.args, ref_stash);\n \tstrvec_push(&cp.args, \"--\");\n@@ -961,7 +961,7 @@ static int save_untracked_files(struct stash_info *info, struct strbuf *msg,\n \n \tcp_upd_index.git_cmd = 1;\n \tstrvec_pushl(&cp_upd_index.args, \"update-index\", \"-z\", \"--add\",\n-\t\t\t \"--remove\", \"--stdin\", NULL);\n+\t\t     \"--remove\", \"--stdin\", NULL);\n \tstrvec_pushf(&cp_upd_index.env_array, \"GIT_INDEX_FILE=%s\",\n \t\t\t stash_index_path.buf);\n \n@@ -1005,7 +1005,7 @@ static int stash_patch(struct stash_info *info, const struct pathspec *ps,\n \tcp_read_tree.git_cmd = 1;\n \tstrvec_pushl(&cp_read_tree.args, \"read-tree\", \"HEAD\", NULL);\n \tstrvec_pushf(&cp_read_tree.env_array, \"GIT_INDEX_FILE=%s\",\n-\t\t\t stash_index_path.buf);\n+\t\t     stash_index_path.buf);\n \tif (run_command(&cp_read_tree)) {\n \t\tret = -1;\n \t\tgoto done;\n@@ -1035,7 +1035,7 @@ static int stash_patch(struct stash_info *info, const struct pathspec *ps,\n \n \tcp_diff_tree.git_cmd = 1;\n \tstrvec_pushl(&cp_diff_tree.args, \"diff-tree\", \"-p\", \"-U1\", \"HEAD\",\n-\t\t\t oid_to_hex(&info->w_tree), \"--\", NULL);\n+\t\t     oid_to_hex(&info->w_tree), \"--\", NULL);\n \tif (pipe_command(&cp_diff_tree, NULL, 0, out_patch, 0, NULL, 0)) {\n \t\tret = -1;\n \t\tgoto done;\n@@ -1089,10 +1089,10 @@ static int stash_working_tree(struct stash_info *info, const struct pathspec *ps\n \n \tcp_upd_index.git_cmd = 1;\n \tstrvec_pushl(&cp_upd_index.args, \"update-index\",\n-\t\t\t \"--ignore-skip-worktree-entries\",\n-\t\t\t \"-z\", \"--add\", \"--remove\", \"--stdin\", NULL);\n+\t\t     \"--ignore-skip-worktree-entries\",\n+\t\t     \"-z\", \"--add\", \"--remove\", \"--stdin\", NULL);\n \tstrvec_pushf(&cp_upd_index.env_array, \"GIT_INDEX_FILE=%s\",\n-\t\t\t stash_index_path.buf);\n+\t\t     stash_index_path.buf);\n \n \tif (pipe_command(&cp_upd_index, diff_output.buf, diff_output.len,\n \t\t\t NULL, 0, NULL, 0)) {\n@@ -1343,7 +1343,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n \n \t\t\tcp.git_cmd = 1;\n \t\t\tstrvec_pushl(&cp.args, \"clean\", \"--force\",\n-\t\t\t\t\t \"--quiet\", \"-d\", NULL);\n+\t\t\t\t     \"--quiet\", \"-d\", NULL);\n \t\t\tif (include_untracked == INCLUDE_ALL_FILES)\n \t\t\t\tstrvec_push(&cp.args, \"-x\");\n \t\t\tif (run_command(&cp)) {\n@@ -1373,8 +1373,8 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n \n \t\t\tcp_diff.git_cmd = 1;\n \t\t\tstrvec_pushl(&cp_diff.args, \"diff-index\", \"-p\",\n-\t\t\t\t\t \"--cached\", \"--binary\", \"HEAD\", \"--\",\n-\t\t\t\t\t NULL);\n+\t\t\t\t     \"--cached\", \"--binary\", \"HEAD\", \"--\",\n+\t\t\t\t     NULL);\n \t\t\tadd_pathspecs(&cp_diff.args, ps);\n \t\t\tif (pipe_command(&cp_diff, NULL, 0, &out, 0, NULL, 0)) {\n \t\t\t\tret = -1;\n@@ -1383,7 +1383,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n \n \t\t\tcp_apply.git_cmd = 1;\n \t\t\tstrvec_pushl(&cp_apply.args, \"apply\", \"--index\",\n-\t\t\t\t\t \"-R\", NULL);\n+\t\t\t\t     \"-R\", NULL);\n \t\t\tif (pipe_command(&cp_apply, out.buf, out.len, NULL, 0,\n \t\t\t\t\t NULL, 0)) {\n \t\t\t\tret = -1;\n@@ -1393,7 +1393,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n \t\t\tstruct child_process cp = CHILD_PROCESS_INIT;\n \t\t\tcp.git_cmd = 1;\n \t\t\tstrvec_pushl(&cp.args, \"reset\", \"--hard\", \"-q\",\n-\t\t\t\t\t \"--no-recurse-submodules\", NULL);\n+\t\t\t\t     \"--no-recurse-submodules\", NULL);\n \t\t\tif (run_command(&cp)) {\n \t\t\t\tret = -1;\n \t\t\t\tgoto done;\n@@ -1405,7 +1405,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q\n \n \t\t\tcp.git_cmd = 1;\n \t\t\tstrvec_pushl(&cp.args, \"checkout\", \"--no-overlay\",\n-\t\t\t\t\t oid_to_hex(&info.i_tree), \"--\", NULL);\n+\t\t\t\t     oid_to_hex(&info.i_tree), \"--\", NULL);\n \t\t\tif (!ps->nr)\n \t\t\t\tstrvec_push(&cp.args, \":/\");\n \t\t\telse\ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex 7705e8eabf..665db1ffed 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -499,7 +499,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,\n \t\tstrvec_pushf(&cp.env_array, \"sm_path=%s\", path);\n \t\tstrvec_pushf(&cp.env_array, \"displaypath=%s\", displaypath);\n \t\tstrvec_pushf(&cp.env_array, \"sha1=%s\",\n-\t\t\t\toid_to_hex(ce_oid));\n+\t\t\t     oid_to_hex(ce_oid));\n \t\tstrvec_pushf(&cp.env_array, \"toplevel=%s\", toplevel);\n \n \t\t/*\n@@ -513,7 +513,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,\n \t\t */\n \t\tsq_quote_buf(&sb, path);\n \t\tstrvec_pushf(&cp.args, \"path=%s; %s\",\n-\t\t\t\t sb.buf, info->argv[0]);\n+\t\t\t     sb.buf, info->argv[0]);\n \t\tstrbuf_release(&sb);\n \t\tfree(toplevel);\n \t} else {\n@@ -537,7 +537,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,\n \t\tstrvec_pushl(&cpr.args, \"--super-prefix\", NULL);\n \t\tstrvec_pushf(&cpr.args, \"%s/\", displaypath);\n \t\tstrvec_pushl(&cpr.args, \"submodule--helper\", \"foreach\", \"--recursive\",\n-\t\t\t\tNULL);\n+\t\t\t     NULL);\n \n \t\tif (info->quiet)\n \t\t\tstrvec_push(&cpr.args, \"--quiet\");\n@@ -810,8 +810,8 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,\n \tstrbuf_release(&buf);\n \n \tstrvec_pushl(&diff_files_args, \"diff-files\",\n-\t\t\t \"--ignore-submodules=dirty\", \"--quiet\", \"--\",\n-\t\t\t path, NULL);\n+\t\t     \"--ignore-submodules=dirty\", \"--quiet\", \"--\",\n+\t\t     path, NULL);\n \n \tgit_config(git_diff_basic_config, NULL);\n \n@@ -852,7 +852,7 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,\n \t\tstrvec_push(&cpr.args, \"--super-prefix\");\n \t\tstrvec_pushf(&cpr.args, \"%s/\", displaypath);\n \t\tstrvec_pushl(&cpr.args, \"submodule--helper\", \"status\",\n-\t\t\t\t \"--recursive\", NULL);\n+\t\t\t     \"--recursive\", NULL);\n \n \t\tif (flags & OPT_CACHED)\n \t\t\tstrvec_push(&cpr.args, \"--cached\");\n@@ -996,7 +996,7 @@ static void sync_submodule(const char *path, const char *prefix,\n \tcp.git_cmd = 1;\n \tcp.dir = path;\n \tstrvec_pushl(&cp.args, \"submodule--helper\",\n-\t\t\t \"print-default-remote\", NULL);\n+\t\t     \"print-default-remote\", NULL);\n \n \tstrbuf_reset(&sb);\n \tif (capture_command(&cp, &sb, 0))\n@@ -1024,7 +1024,7 @@ static void sync_submodule(const char *path, const char *prefix,\n \t\tstrvec_push(&cpr.args, \"--super-prefix\");\n \t\tstrvec_pushf(&cpr.args, \"%s/\", displaypath);\n \t\tstrvec_pushl(&cpr.args, \"submodule--helper\", \"sync\",\n-\t\t\t\t \"--recursive\", NULL);\n+\t\t\t     \"--recursive\", NULL);\n \n \t\tif (flags & OPT_QUIET)\n \t\t\tstrvec_push(&cpr.args, \"--quiet\");\n@@ -1128,7 +1128,7 @@ static void deinit_submodule(const char *path, const char *prefix,\n \t\t\tstruct child_process cp_rm = CHILD_PROCESS_INIT;\n \t\t\tcp_rm.git_cmd = 1;\n \t\t\tstrvec_pushl(&cp_rm.args, \"rm\", \"-qn\",\n-\t\t\t\t\t path, NULL);\n+\t\t\t\t     path, NULL);\n \n \t\t\tif (run_command(&cp_rm))\n \t\t\t\tdie(_(\"Submodule work tree '%s' contains local \"\n@@ -1251,7 +1251,7 @@ static int clone_submodule(const char *path, const char *gitdir, const char *url\n \t\tstruct string_list_item *item;\n \t\tfor_each_string_list_item(item, reference)\n \t\t\tstrvec_pushl(&cp.args, \"--reference\",\n-\t\t\t\t\t item->string, NULL);\n+\t\t\t\t     item->string, NULL);\n \t}\n \tif (dissociate)\n \t\tstrvec_push(&cp.args, \"--dissociate\");\ndiff --git a/builtin/worktree.c b/builtin/worktree.c\nindex 3c483c23d4..be5d84f0a0 100644\n--- a/builtin/worktree.c\n+++ b/builtin/worktree.c\n@@ -414,10 +414,10 @@ static int add_worktree(const char *path, const char *refname,\n \n \tif (!is_branch)\n \t\tstrvec_pushl(&cp.args, \"update-ref\", \"HEAD\",\n-\t\t\t\t oid_to_hex(&commit->object.oid), NULL);\n+\t\t\t     oid_to_hex(&commit->object.oid), NULL);\n \telse {\n \t\tstrvec_pushl(&cp.args, \"symbolic-ref\", \"HEAD\",\n-\t\t\t\t symref.buf, NULL);\n+\t\t\t     symref.buf, NULL);\n \t\tif (opts->quiet)\n \t\t\tstrvec_push(&cp.args, \"--quiet\");\n \t}\n@@ -466,9 +466,9 @@ static int add_worktree(const char *path, const char *refname,\n \t\t\tcp.argv = NULL;\n \t\t\tcp.trace2_hook_name = \"post-checkout\";\n \t\t\tstrvec_pushl(&cp.args, absolute_path(hook),\n-\t\t\t\t\t oid_to_hex(&null_oid),\n-\t\t\t\t\t oid_to_hex(&commit->object.oid),\n-\t\t\t\t\t \"1\", NULL);\n+\t\t\t\t     oid_to_hex(&null_oid),\n+\t\t\t\t     oid_to_hex(&commit->object.oid),\n+\t\t\t\t     \"1\", NULL);\n \t\t\tret = run_command(&cp);\n \t\t}\n \t}\n@@ -936,13 +936,13 @@ static void check_clean_worktree(struct worktree *wt,\n \tvalidate_no_submodules(wt);\n \n \tstrvec_pushf(&child_env, \"%s=%s/.git\",\n-\t\t\t GIT_DIR_ENVIRONMENT, wt->path);\n+\t\t     GIT_DIR_ENVIRONMENT, wt->path);\n \tstrvec_pushf(&child_env, \"%s=%s\",\n-\t\t\t GIT_WORK_TREE_ENVIRONMENT, wt->path);\n+\t\t     GIT_WORK_TREE_ENVIRONMENT, wt->path);\n \tmemset(&cp, 0, sizeof(cp));\n \tstrvec_pushl(&cp.args, \"status\",\n-\t\t\t \"--porcelain\", \"--ignore-submodules=none\",\n-\t\t\t NULL);\n+\t\t     \"--porcelain\", \"--ignore-submodules=none\",\n+\t\t     NULL);\n \tcp.env = child_env.argv;\n \tcp.git_cmd = 1;\n \tcp.dir = wt->path;\ndiff --git a/bundle.c b/bundle.c\nindex 709b2abc9c..565d05367f 100644\n--- a/bundle.c\n+++ b/bundle.c\n@@ -275,9 +275,9 @@ static int write_pack_data(int bundle_fd, struct rev_info *revs, struct strvec *\n \tint i;\n \n \tstrvec_pushl(&pack_objects.args,\n-\t\t\t \"pack-objects\",\n-\t\t\t \"--stdout\", \"--thin\", \"--delta-base-offset\",\n-\t\t\t NULL);\n+\t\t     \"pack-objects\",\n+\t\t     \"--stdout\", \"--thin\", \"--delta-base-offset\",\n+\t\t     NULL);\n \tstrvec_pushv(&pack_objects.args, pack_options->argv);\n \tpack_objects.in = -1;\n \tpack_objects.out = bundle_fd;\n@@ -322,8 +322,8 @@ static int compute_and_write_prerequisites(int bundle_fd,\n \tint i;\n \n \tstrvec_pushl(&rls.args,\n-\t\t\t \"rev-list\", \"--boundary\", \"--pretty=oneline\",\n-\t\t\t NULL);\n+\t\t     \"rev-list\", \"--boundary\", \"--pretty=oneline\",\n+\t\t     NULL);\n \tfor (i = 1; i < argc; i++)\n \t\tstrvec_push(&rls.args, argv[i]);\n \trls.out = -1;\ndiff --git a/connect.c b/connect.c\nindex 9b453fe792..3299ea956a 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -1208,7 +1208,7 @@ static void push_ssh_options(struct strvec *args, struct strvec *env,\n \t\tstrvec_push(args, \"-o\");\n \t\tstrvec_push(args, \"SendEnv=\" GIT_PROTOCOL_ENVIRONMENT);\n \t\tstrvec_pushf(env, GIT_PROTOCOL_ENVIRONMENT \"=version=%d\",\n-\t\t\t\t version);\n+\t\t\t     version);\n \t}\n \n \tif (flags & CONNECT_IPV4) {\n@@ -1397,8 +1397,9 @@ struct child_process *git_connect(int fd[2], const char *url,\n \t\t\ttransport_check_allowed(\"file\");\n \t\t\tconn->trace2_child_class = \"transport/file\";\n \t\t\tif (version > 0) {\n-\t\t\t\tstrvec_pushf(&conn->env_array, GIT_PROTOCOL_ENVIRONMENT \"=version=%d\",\n-\t\t\t\t\t\t version);\n+\t\t\t\tstrvec_pushf(&conn->env_array,\n+\t\t\t\t\t     GIT_PROTOCOL_ENVIRONMENT \"=version=%d\",\n+\t\t\t\t\t     version);\n \t\t\t}\n \t\t}\n \t\tstrvec_push(&conn->args, cmd.buf);\ndiff --git a/connected.c b/connected.c\nindex 96b47879d3..21c1ebe9fb 100644\n--- a/connected.c\n+++ b/connected.c\n@@ -106,7 +106,7 @@ int check_connected(oid_iterate_fn fn, void *cb_data,\n \tstrvec_push(&rev_list.args, \"--alternate-refs\");\n \tif (opt->progress)\n \t\tstrvec_pushf(&rev_list.args, \"--progress=%s\",\n-\t\t\t\t _(\"Checking connectivity\"));\n+\t\t\t     _(\"Checking connectivity\"));\n \n \trev_list.git_cmd = 1;\n \trev_list.env = opt->env;\ndiff --git a/daemon.c b/daemon.c\nindex cea5f5354f..0dec89fa02 100644\n--- a/daemon.c\n+++ b/daemon.c\n@@ -665,7 +665,7 @@ static void parse_extra_args(struct hostinfo *hi, struct strvec *env,\n \tif (git_protocol.len > 0) {\n \t\tloginfo(\"Extended attribute \\\"protocol\\\": %s\", git_protocol.buf);\n \t\tstrvec_pushf(env, GIT_PROTOCOL_ENVIRONMENT \"=%s\",\n-\t\t\t\t git_protocol.buf);\n+\t\t\t     git_protocol.buf);\n \t}\n \tstrbuf_release(&git_protocol);\n }\n@@ -915,15 +915,15 @@ static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)\n \t\tinet_ntop(addr->sa_family, &sin_addr->sin_addr, buf, sizeof(buf));\n \t\tstrvec_pushf(&cld.env_array, \"REMOTE_ADDR=%s\", buf);\n \t\tstrvec_pushf(&cld.env_array, \"REMOTE_PORT=%d\",\n-\t\t\t\t ntohs(sin_addr->sin_port));\n+\t\t\t     ntohs(sin_addr->sin_port));\n #ifndef NO_IPV6\n \t} else if (addr->sa_family == AF_INET6) {\n \t\tchar buf[128] = \"\";\n \t\tstruct sockaddr_in6 *sin6_addr = (void *) addr;\n \t\tinet_ntop(AF_INET6, &sin6_addr->sin6_addr, buf, sizeof(buf));\n \t\tstrvec_pushf(&cld.env_array, \"REMOTE_ADDR=[%s]\", buf);\n \t\tstrvec_pushf(&cld.env_array, \"REMOTE_PORT=%d\",\n-\t\t\t\t ntohs(sin6_addr->sin6_port));\n+\t\t\t     ntohs(sin6_addr->sin6_port));\n #endif\n \t}\n \ndiff --git a/fetch-pack.c b/fetch-pack.c\nindex 7aa5dfbdad..7f20eca4f8 100644\n--- a/fetch-pack.c\n+++ b/fetch-pack.c\n@@ -854,8 +854,8 @@ static int get_pack(struct fetch_pack_args *args,\n \t\t\tif (xgethostname(hostname, sizeof(hostname)))\n \t\t\t\txsnprintf(hostname, sizeof(hostname), \"localhost\");\n \t\t\tstrvec_pushf(&cmd.args,\n-\t\t\t\t\t\"--keep=fetch-pack %\"PRIuMAX \" on %s\",\n-\t\t\t\t\t(uintmax_t)getpid(), hostname);\n+\t\t\t\t     \"--keep=fetch-pack %\"PRIuMAX \" on %s\",\n+\t\t\t\t     (uintmax_t)getpid(), hostname);\n \t\t}\n \t\tif (only_packfile && args->check_self_contained_and_connected)\n \t\t\tstrvec_push(&cmd.args, \"--check-self-contained-and-connected\");\n@@ -885,7 +885,7 @@ static int get_pack(struct fetch_pack_args *args,\n \n \tif (pass_header)\n \t\tstrvec_pushf(&cmd.args, \"--pack_header=%\"PRIu32\",%\"PRIu32,\n-\t\t\t\t ntohl(header.hdr_version),\n+\t\t\t     ntohl(header.hdr_version),\n \t\t\t\t ntohl(header.hdr_entries));\n \tif (fetch_fsck_objects >= 0\n \t    ? fetch_fsck_objects\n@@ -901,7 +901,7 @@ static int get_pack(struct fetch_pack_args *args,\n \t\t\tstrvec_push(&cmd.args, \"--fsck-objects\");\n \t\telse\n \t\t\tstrvec_pushf(&cmd.args, \"--strict%s\",\n-\t\t\t\t\t fsck_msg_types.buf);\n+\t\t\t\t     fsck_msg_types.buf);\n \t}\n \n \tcmd.in = demux.out;\n@@ -1654,8 +1654,8 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,\n \n \t\tstrvec_push(&cmd.args, \"http-fetch\");\n \t\tstrvec_pushf(&cmd.args, \"--packfile=%.*s\",\n-\t\t\t\t (int) the_hash_algo->hexsz,\n-\t\t\t\t packfile_uris.items[i].string);\n+\t\t\t     (int) the_hash_algo->hexsz,\n+\t\t\t     packfile_uris.items[i].string);\n \t\tstrvec_push(&cmd.args, uri);\n \t\tcmd.git_cmd = 1;\n \t\tcmd.no_stdin = 1;\ndiff --git a/gpg-interface.c b/gpg-interface.c\nindex cf56fe838f..b499270836 100644\n--- a/gpg-interface.c\n+++ b/gpg-interface.c\n@@ -285,9 +285,9 @@ static int verify_signed_buffer(const char *payload, size_t payload_size,\n \tstrvec_push(&gpg.args, fmt->program);\n \tstrvec_pushv(&gpg.args, fmt->verify_args);\n \tstrvec_pushl(&gpg.args,\n-\t\t\t \"--status-fd=1\",\n-\t\t\t \"--verify\", temp->filename.buf, \"-\",\n-\t\t\t NULL);\n+\t\t     \"--status-fd=1\",\n+\t\t     \"--verify\", temp->filename.buf, \"-\",\n+\t\t     NULL);\n \n \tif (!gpg_status)\n \t\tgpg_status = &buf;\n@@ -435,10 +435,10 @@ int sign_buffer(struct strbuf *buffer, struct strbuf *signature, const char *sig\n \tstruct strbuf gpg_status = STRBUF_INIT;\n \n \tstrvec_pushl(&gpg.args,\n-\t\t\t use_format->program,\n-\t\t\t \"--status-fd=2\",\n-\t\t\t \"-bsau\", signing_key,\n-\t\t\t NULL);\n+\t\t     use_format->program,\n+\t\t     \"--status-fd=2\",\n+\t\t     \"-bsau\", signing_key,\n+\t\t     NULL);\n \n \tbottom = signature->len;\n \ndiff --git a/http-backend.c b/http-backend.c\nindex 92fd62f73f..a03b4bae22 100644\n--- a/http-backend.c\n+++ b/http-backend.c\n@@ -480,7 +480,7 @@ static void run_service(const char **argv, int buffer_input)\n \t\tstrvec_pushf(&cld.env_array, \"GIT_COMMITTER_NAME=%s\", user);\n \tif (!getenv(\"GIT_COMMITTER_EMAIL\"))\n \t\tstrvec_pushf(&cld.env_array,\n-\t\t\t\t \"GIT_COMMITTER_EMAIL=%s@http.%s\", user, host);\n+\t\t\t     \"GIT_COMMITTER_EMAIL=%s@http.%s\", user, host);\n \n \tcld.argv = argv;\n \tif (buffer_input || gzipped_request || req_len >= 0)\ndiff --git a/http-push.c b/http-push.c\nindex e1deea6fe4..31911aa345 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -1929,7 +1929,7 @@ int cmd_main(int argc, const char **argv)\n \t\tstrvec_push(&commit_argv, oid_to_hex(&ref->new_oid));\n \t\tif (!push_all && !is_null_oid(&ref->old_oid))\n \t\t\tstrvec_pushf(&commit_argv, \"^%s\",\n-\t\t\t\t\t oid_to_hex(&ref->old_oid));\n+\t\t\t\t     oid_to_hex(&ref->old_oid));\n \t\trepo_init_revisions(the_repository, &revs, setup_git_directory());\n \t\tsetup_revisions(commit_argv.argc, commit_argv.argv, &revs, NULL);\n \t\trevs.edge_hint = 0; /* just in case */\ndiff --git a/http.c b/http.c\nindex 268a1e9744..8b23a546af 100644\n--- a/http.c\n+++ b/http.c\n@@ -2276,7 +2276,7 @@ int finish_http_pack_request(struct http_pack_request *preq)\n \tip.in = tmpfile_fd;\n \tif (preq->generate_keep) {\n \t\tstrvec_pushf(&ip.args, \"--keep=git %\"PRIuMAX,\n-\t\t\t\t (uintmax_t)getpid());\n+\t\t\t     (uintmax_t)getpid());\n \t\tip.out = 0;\n \t} else {\n \t\tip.no_stdout = 1;\ndiff --git a/range-diff.c b/range-diff.c\nindex 3a0eb70c89..831c490bf2 100644\n--- a/range-diff.c\n+++ b/range-diff.c\n@@ -52,20 +52,20 @@ static int read_patches(const char *range, struct string_list *list,\n \tsize_t size;\n \n \tstrvec_pushl(&cp.args, \"log\", \"--no-color\", \"-p\", \"--no-merges\",\n-\t\t\t\"--reverse\", \"--date-order\", \"--decorate=no\",\n-\t\t\t\"--no-prefix\",\n-\t\t\t/*\n-\t\t\t * Choose indicators that are not used anywhere\n-\t\t\t * else in diffs, but still look reasonable\n-\t\t\t * (e.g. will not be confusing when debugging)\n-\t\t\t */\n-\t\t\t\"--output-indicator-new=>\",\n-\t\t\t\"--output-indicator-old=<\",\n-\t\t\t\"--output-indicator-context=#\",\n-\t\t\t\"--no-abbrev-commit\",\n-\t\t\t\"--pretty=medium\",\n-\t\t\t\"--notes\",\n-\t\t\tNULL);\n+\t\t     \"--reverse\", \"--date-order\", \"--decorate=no\",\n+\t\t     \"--no-prefix\",\n+\t\t     /*\n+\t\t      * Choose indicators that are not used anywhere\n+\t\t      * else in diffs, but still look reasonable\n+\t\t      * (e.g. will not be confusing when debugging)\n+\t\t      */\n+\t\t     \"--output-indicator-new=>\",\n+\t\t     \"--output-indicator-old=<\",\n+\t\t     \"--output-indicator-context=#\",\n+\t\t     \"--no-abbrev-commit\",\n+\t\t     \"--pretty=medium\",\n+\t\t     \"--notes\",\n+\t\t     NULL);\n \tif (other_arg)\n \t\tstrvec_pushv(&cp.args, other_arg->argv);\n \tstrvec_push(&cp.args, range);\ndiff --git a/refspec.c b/refspec.c\nindex 6f317d6b44..f10ef284ce 100644\n--- a/refspec.c\n+++ b/refspec.c\n@@ -222,8 +222,8 @@ void refspec_ref_prefixes(const struct refspec *rs,\n \t\t\tif (item->pattern) {\n \t\t\t\tconst char *glob = strchr(prefix, '*');\n \t\t\t\tstrvec_pushf(ref_prefixes, \"%.*s\",\n-\t\t\t\t\t\t (int)(glob - prefix),\n-\t\t\t\t\t\t prefix);\n+\t\t\t\t\t     (int)(glob - prefix),\n+\t\t\t\t\t     prefix);\n \t\t\t} else {\n \t\t\t\texpand_ref_prefix(ref_prefixes, prefix);\n \t\t\t}\ndiff --git a/remote-curl.c b/remote-curl.c\nindex 85ce4f7e6f..7feaddc003 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -1145,7 +1145,7 @@ static int fetch_git(struct discovery *heads,\n \tstruct strbuf rpc_result = STRBUF_INIT;\n \n \tstrvec_pushl(&args, \"fetch-pack\", \"--stateless-rpc\",\n-\t\t\t \"--stdin\", \"--lock-pack\", NULL);\n+\t\t     \"--stdin\", \"--lock-pack\", NULL);\n \tif (options.followtags)\n \t\tstrvec_push(&args, \"--include-tag\");\n \tif (options.thin)\n@@ -1166,7 +1166,7 @@ static int fetch_git(struct discovery *heads,\n \t\tstrvec_pushf(&args, \"--shallow-since=%s\", options.deepen_since);\n \tfor (i = 0; i < options.deepen_not.nr; i++)\n \t\tstrvec_pushf(&args, \"--shallow-exclude=%s\",\n-\t\t\t\t options.deepen_not.items[i].string);\n+\t\t\t     options.deepen_not.items[i].string);\n \tif (options.deepen_relative && options.depth)\n \t\tstrvec_push(&args, \"--deepen-relative\");\n \tif (options.from_promisor)\n@@ -1293,7 +1293,7 @@ static int push_git(struct discovery *heads, int nr_spec, const char **specs)\n \n \tstrvec_init(&args);\n \tstrvec_pushl(&args, \"send-pack\", \"--stateless-rpc\", \"--helper-status\",\n-\t\t\t NULL);\n+\t\t     NULL);\n \n \tif (options.thin)\n \t\tstrvec_push(&args, \"--thin\");\n@@ -1311,7 +1311,7 @@ static int push_git(struct discovery *heads, int nr_spec, const char **specs)\n \t\tstrvec_push(&args, \"--verbose\");\n \tfor (i = 0; i < options.push_options.nr; i++)\n \t\tstrvec_pushf(&args, \"--push-option=%s\",\n-\t\t\t\t options.push_options.items[i].string);\n+\t\t\t     options.push_options.items[i].string);\n \tstrvec_push(&args, options.progress ? \"--progress\" : \"--no-progress\");\n \tfor_each_string_list_item(cas_option, &cas_options)\n \t\tstrvec_push(&args, cas_option->string);\ndiff --git a/remote.c b/remote.c\nindex 13b097866c..b4665fe5a3 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -1914,8 +1914,8 @@ static int stat_branch_pair(const char *branch_name, const char *base,\n \tstrvec_push(&argv, \"\"); /* ignored */\n \tstrvec_push(&argv, \"--left-right\");\n \tstrvec_pushf(&argv, \"%s...%s\",\n-\t\t\t oid_to_hex(&ours->object.oid),\n-\t\t\t oid_to_hex(&theirs->object.oid));\n+\t\t     oid_to_hex(&ours->object.oid),\n+\t\t     oid_to_hex(&theirs->object.oid));\n \tstrvec_push(&argv, \"--\");\n \n \trepo_init_revisions(the_repository, &revs, NULL);\ndiff --git a/sequencer.c b/sequencer.c\nindex 80c770968a..31a2b1ab55 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -3133,7 +3133,7 @@ static int do_exec(struct repository *r, const char *command_line)\n \tchild_argv[0] = command_line;\n \tstrvec_pushf(&child_env, \"GIT_DIR=%s\", absolute_path(get_git_dir()));\n \tstrvec_pushf(&child_env, \"GIT_WORK_TREE=%s\",\n-\t\t\t absolute_path(get_git_work_tree()));\n+\t\t     absolute_path(get_git_work_tree()));\n \tstatus = run_command_v_opt_cd_env(child_argv, RUN_USING_SHELL, NULL,\n \t\t\t\t\t  child_env.argv);\n \n@@ -3552,7 +3552,7 @@ static int do_merge(struct repository *r,\n \t\t\tstrvec_push(&cmd.args, strategy);\n \t\t\tfor (k = 0; k < opts->xopts_nr; k++)\n \t\t\t\tstrvec_pushf(&cmd.args,\n-\t\t\t\t\t\t \"-X%s\", opts->xopts[k]);\n+\t\t\t\t\t     \"-X%s\", opts->xopts[k]);\n \t\t}\n \t\tstrvec_push(&cmd.args, \"--no-edit\");\n \t\tstrvec_push(&cmd.args, \"--no-ff\");\n@@ -3566,7 +3566,7 @@ static int do_merge(struct repository *r,\n \t\t/* Add the tips to be merged */\n \t\tfor (j = to_merge; j; j = j->next)\n \t\t\tstrvec_push(&cmd.args,\n-\t\t\t\t\toid_to_hex(&j->item->object.oid));\n+\t\t\t\t    oid_to_hex(&j->item->object.oid));\n \n \t\tstrbuf_release(&ref_name);\n \t\tunlink(git_path_cherry_pick_head(r));\n@@ -3695,7 +3695,7 @@ void create_autostash(struct repository *r, const char *path,\n \t\tstruct object_id oid;\n \n \t\tstrvec_pushl(&stash.args,\n-\t\t\t\t \"stash\", \"create\", \"autostash\", NULL);\n+\t\t\t     \"stash\", \"create\", \"autostash\", NULL);\n \t\tstash.git_cmd = 1;\n \t\tstash.no_stdin = 1;\n \t\tstrbuf_reset(&buf);\ndiff --git a/submodule.c b/submodule.c\nindex 5c9447422d..fb96d595b0 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -495,7 +495,7 @@ void prepare_submodule_repo_env(struct strvec *out)\n {\n \tprepare_submodule_repo_env_no_git_dir(out);\n \tstrvec_pushf(out, \"%s=%s\", GIT_DIR_ENVIRONMENT,\n-\t\t\t DEFAULT_GIT_DIR_ENVIRONMENT);\n+\t\t     DEFAULT_GIT_DIR_ENVIRONMENT);\n }\n \n static void prepare_submodule_repo_env_in_gitdir(struct strvec *out)\n@@ -687,14 +687,14 @@ void show_submodule_inline_diff(struct diff_options *o, const char *path,\n \n \tif (o->flags.reverse_diff) {\n \t\tstrvec_pushf(&cp.args, \"--src-prefix=%s%s/\",\n-\t\t\t\t o->b_prefix, path);\n+\t\t\t     o->b_prefix, path);\n \t\tstrvec_pushf(&cp.args, \"--dst-prefix=%s%s/\",\n-\t\t\t\t o->a_prefix, path);\n+\t\t\t     o->a_prefix, path);\n \t} else {\n \t\tstrvec_pushf(&cp.args, \"--src-prefix=%s%s/\",\n-\t\t\t\t o->a_prefix, path);\n+\t\t\t     o->a_prefix, path);\n \t\tstrvec_pushf(&cp.args, \"--dst-prefix=%s%s/\",\n-\t\t\t\t o->b_prefix, path);\n+\t\t\t     o->b_prefix, path);\n \t}\n \tstrvec_push(&cp.args, oid_to_hex(old_oid));\n \t/*\n@@ -1062,7 +1062,7 @@ static int push_submodule(const char *path,\n \t\t\tconst struct string_list_item *item;\n \t\t\tfor_each_string_list_item(item, push_options)\n \t\t\t\tstrvec_pushf(&cp.args, \"--push-option=%s\",\n-\t\t\t\t\t\t item->string);\n+\t\t\t\t\t     item->string);\n \t\t}\n \n \t\tif (remote->origin != REMOTE_UNCONFIGURED) {\n@@ -1780,7 +1780,7 @@ int bad_to_remove_submodule(const char *path, unsigned flags)\n \t\treturn 1;\n \n \tstrvec_pushl(&cp.args, \"status\", \"--porcelain\",\n-\t\t\t\t   \"--ignore-submodules=none\", NULL);\n+\t\t     \"--ignore-submodules=none\", NULL);\n \n \tif (flags & SUBMODULE_REMOVAL_IGNORE_UNTRACKED)\n \t\tstrvec_push(&cp.args, \"-uno\");\n@@ -1847,7 +1847,7 @@ static int submodule_has_dirty_index(const struct submodule *sub)\n \n \tcp.git_cmd = 1;\n \tstrvec_pushl(&cp.args, \"diff-index\", \"--quiet\",\n-\t\t\t\t   \"--cached\", \"HEAD\", NULL);\n+\t\t     \"--cached\", \"HEAD\", NULL);\n \tcp.no_stdin = 1;\n \tcp.no_stdout = 1;\n \tcp.dir = sub->path;\n@@ -1867,7 +1867,7 @@ static void submodule_reset_index(const char *path)\n \tcp.dir = path;\n \n \tstrvec_pushf(&cp.args, \"--super-prefix=%s%s/\",\n-\t\t\t\t   get_super_prefix_or_empty(), path);\n+\t\t     get_super_prefix_or_empty(), path);\n \tstrvec_pushl(&cp.args, \"read-tree\", \"-u\", \"--reset\", NULL);\n \n \tstrvec_push(&cp.args, empty_tree_oid_hex());\n@@ -1948,7 +1948,7 @@ int submodule_move_head(const char *path,\n \tcp.dir = path;\n \n \tstrvec_pushf(&cp.args, \"--super-prefix=%s%s/\",\n-\t\t\tget_super_prefix_or_empty(), path);\n+\t\t     get_super_prefix_or_empty(), path);\n \tstrvec_pushl(&cp.args, \"read-tree\", \"--recurse-submodules\", NULL);\n \n \tif (flags & SUBMODULE_MOVE_HEAD_DRY_RUN)\n@@ -1981,7 +1981,7 @@ int submodule_move_head(const char *path,\n \n \t\t\tprepare_submodule_repo_env(&cp.env_array);\n \t\t\tstrvec_pushl(&cp.args, \"update-ref\", \"HEAD\",\n-\t\t\t\t\t \"--no-deref\", new_head, NULL);\n+\t\t\t\t     \"--no-deref\", new_head, NULL);\n \n \t\t\tif (run_command(&cp)) {\n \t\t\t\tret = -1;\n@@ -2158,8 +2158,8 @@ void absorb_git_dir_into_superproject(const char *path,\n \t\tcp.git_cmd = 1;\n \t\tcp.no_stdin = 1;\n \t\tstrvec_pushl(&cp.args, \"--super-prefix\", sb.buf,\n-\t\t\t\t\t   \"submodule--helper\",\n-\t\t\t\t\t   \"absorb-git-dirs\", NULL);\n+\t\t\t     \"submodule--helper\",\n+\t\t\t     \"absorb-git-dirs\", NULL);\n \t\tprepare_submodule_repo_env(&cp.env_array);\n \t\tif (run_command(&cp))\n \t\t\tdie(_(\"could not recurse into submodule '%s'\"), path);\n@@ -2197,8 +2197,8 @@ int get_superproject_working_tree(struct strbuf *buf)\n \tstrvec_pop(&cp.env_array);\n \n \tstrvec_pushl(&cp.args, \"--literal-pathspecs\", \"-C\", \"..\",\n-\t\t\t\"ls-files\", \"-z\", \"--stage\", \"--full-name\", \"--\",\n-\t\t\tsubpath, NULL);\n+\t\t     \"ls-files\", \"-z\", \"--stage\", \"--full-name\", \"--\",\n+\t\t     subpath, NULL);\n \tstrbuf_reset(&sb);\n \n \tcp.no_stdin = 1;\ndiff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c\nindex 67dde56962..726835fcc2 100644\n--- a/t/helper/test-run-command.c\n+++ b/t/helper/test-run-command.c\n@@ -244,10 +244,10 @@ static int quote_stress_test(int argc, const char **argv)\n \t\tstrvec_clear(&args);\n \t\tif (msys2)\n \t\t\tstrvec_pushl(&args, \"sh\", \"-c\",\n-\t\t\t\t\t \"printf %s\\\\\\\\0 \\\"$@\\\"\", \"skip\", NULL);\n+\t\t\t\t     \"printf %s\\\\\\\\0 \\\"$@\\\"\", \"skip\", NULL);\n \t\telse\n \t\t\tstrvec_pushl(&args, \"test-tool\", \"run-command\",\n-\t\t\t\t\t \"quote-echo\", NULL);\n+\t\t\t\t     \"quote-echo\", NULL);\n \t\targ_offset = args.argc;\n \n \t\tif (argc > 0) {\n@@ -339,7 +339,7 @@ static int inherit_handle(const char *argv0)\n \ttmp = xmkstemp(path);\n \n \tstrvec_pushl(&cp.args,\n-\t\t\t \"test-tool\", argv0, \"inherited-handle-child\", NULL);\n+\t\t     \"test-tool\", argv0, \"inherited-handle-child\", NULL);\n \tcp.in = -1;\n \tcp.no_stdout = cp.no_stderr = 1;\n \tif (start_command(&cp) < 0)\ndiff --git a/transport-helper.c b/transport-helper.c\nindex dcd4adf444..ae8011e9d5 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -136,7 +136,7 @@ static struct child_process *get_helper(struct transport *transport)\n \n \tif (have_git_dir())\n \t\tstrvec_pushf(&helper->env_array, \"%s=%s\",\n-\t\t\t\t GIT_DIR_ENVIRONMENT, get_git_dir());\n+\t\t\t     GIT_DIR_ENVIRONMENT, get_git_dir());\n \n \thelper->trace2_child_class = helper->args.argv[0]; /* \"remote-<name>\" */\n \ndiff --git a/upload-pack.c b/upload-pack.c\nindex 1b0e1fca1a..4a7918e04e 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -301,8 +301,7 @@ static void create_pack_file(struct upload_pack_data *pack_data,\n \t\t\tstrvec_pushf(&pack_objects.args, \"--filter=%s\", buf.buf);\n \t\t\tstrbuf_release(&buf);\n \t\t} else {\n-\t\t\tstrvec_pushf(&pack_objects.args, \"--filter=%s\",\n-\t\t\t\t\t spec);\n+\t\t\tstrvec_pushf(&pack_objects.args, \"--filter=%s\", spec);\n \t\t}\n \t}\n \tif (uri_protocols) {\ndiff --git a/wt-status.c b/wt-status.c\nindex 60d4e847a5..8454662c90 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -913,8 +913,7 @@ static void wt_longstatus_print_submodule_summary(struct wt_status *s, int uncom\n \tstruct strbuf summary = STRBUF_INIT;\n \tchar *summary_content;\n \n-\tstrvec_pushf(&sm_summary.env_array, \"GIT_INDEX_FILE=%s\",\n-\t\t\t s->index_file);\n+\tstrvec_pushf(&sm_summary.env_array, \"GIT_INDEX_FILE=%s\", s->index_file);\n \n \tstrvec_push(&sm_summary.args, \"submodule\");\n \tstrvec_push(&sm_summary.args, \"summary\");\n-- \n2.28.0.rc2.475.g53c7e1c7f4\n\n"},{"id":"402239","messageId":"20200728202657.GI1021513@coredump.intra.peff.net","threadId":"53940","inReplyTo":"20200728202124.GA1021264@coredump.intra.peff.net","subject":"[PATCH 09/11] strvec: update documention to avoid argv_array","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-28T20:26:57Z","receivedAt":"2020-07-28T20:26:59Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"There were a few mentions of argv_array in a non-code file which didn't\nget picked up in the previous commits (note that even comments in code\nfiles were already covered because of the mechanical conversion via\nperl).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Documentation/technical/api-parse-options.txt | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/technical/api-parse-options.txt b/Documentation/technical/api-parse-options.txt\nindex 2e2e7c10c6..5a60bbfa7f 100644\n--- a/Documentation/technical/api-parse-options.txt\n+++ b/Documentation/technical/api-parse-options.txt\n@@ -232,9 +232,9 @@ There are some macros to easily define options:\n \twill be overwritten, so this should only be used for options where\n \tthe last one specified on the command line wins.\n \n-`OPT_PASSTHRU_ARGV(short, long, &argv_array_var, arg_str, description, flags)`::\n+`OPT_PASSTHRU_ARGV(short, long, &strvec_var, arg_str, description, flags)`::\n \tIntroduce an option where all instances of it on the command-line will\n-\tbe reconstructed into an argv_array. This is useful when you need to\n+\tbe reconstructed into a strvec. This is useful when you need to\n \tpass the command-line option, which can be specified multiple times,\n \tto another command.\n \n-- \n2.28.0.rc2.475.g53c7e1c7f4\n\n"},{"id":"402240","messageId":"20200728202709.GJ1021513@coredump.intra.peff.net","threadId":"53940","inReplyTo":"20200728202124.GA1021264@coredump.intra.peff.net","subject":"[PATCH 10/11] strvec: drop argv_array compatibility layer","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-28T20:27:09Z","receivedAt":"2020-07-28T20:27:11Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"There are no callers which need it anymore. Any topics in flight will\nneed to be updated as they get merged in (but the compiler will make\nthat quite clear).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n strvec.h | 13 -------------\n 1 file changed, 13 deletions(-)\n\ndiff --git a/strvec.h b/strvec.h\nindex 4be39c8a48..bd35de1ce4 100644\n--- a/strvec.h\n+++ b/strvec.h\n@@ -86,17 +86,4 @@ void strvec_clear(struct strvec *);\n  */\n const char **strvec_detach(struct strvec *);\n \n-/* compatibility for historic argv_array interface */\n-#define argv_array strvec\n-#define ARGV_ARRAY_INIT STRVEC_INIT\n-#define argv_array_init strvec_init\n-#define argv_array_push strvec_push\n-#define argv_array_pushf strvec_pushf\n-#define argv_array_pushl strvec_pushl\n-#define argv_array_pushv strvec_pushv\n-#define argv_array_pop strvec_pop\n-#define argv_array_split strvec_split\n-#define argv_array_clear strvec_clear\n-#define argv_array_detach strvec_detach\n-\n #endif /* STRVEC_H */\n-- \n2.28.0.rc2.475.g53c7e1c7f4\n\n"},{"id":"402241","messageId":"20200728202823.GK1021513@coredump.intra.peff.net","threadId":"53940","inReplyTo":"20200728202124.GA1021264@coredump.intra.peff.net","subject":"[PATCH 11/11] strvec: rename struct fields","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-28T20:28:23Z","receivedAt":"2020-07-28T20:28:30Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The \"argc\" and \"argv\" names made sense when the struct was argv_array,\nbut now they're just confusing. Let's rename them to our usual \"nr\" and\n\"items\" (which we use for string_list, as well as many ALLOC_GROW()\narrays).\n\nNote that we have to update all of the callers immediately. Playing\ntricks with the preprocessor is hard here, because we wouldn't want to\nrewrite unrelated tokens.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nI'm actually not that fond of \"items\". I almost went with just:\n\n  const char **v;\n\nas the variable name which contains it usually provides sufficient\ncontext. But I worried that people would consider that too inscrutable.\n\n add-interactive.c           |  4 ++--\n add-patch.c                 |  8 +++----\n bisect.c                    |  2 +-\n builtin/add.c               |  2 +-\n builtin/am.c                | 16 +++++++-------\n builtin/annotate.c          |  2 +-\n builtin/bisect--helper.c    |  4 ++--\n builtin/clone.c             |  4 ++--\n builtin/commit.c            |  2 +-\n builtin/describe.c          |  6 ++---\n builtin/difftool.c          |  2 +-\n builtin/fetch.c             |  6 ++---\n builtin/gc.c                | 24 ++++++++++----------\n builtin/pack-objects.c      |  2 +-\n builtin/pull.c              | 16 +++++++-------\n builtin/rebase.c            | 16 +++++++-------\n builtin/receive-pack.c      | 14 ++++++------\n builtin/remote.c            |  4 ++--\n builtin/replace.c           |  2 +-\n builtin/show-branch.c       |  8 +++----\n builtin/stash.c             |  8 +++----\n builtin/submodule--helper.c |  6 ++---\n builtin/upload-archive.c    |  4 ++--\n builtin/worktree.c          |  6 ++---\n bundle.c                    |  2 +-\n commit.c                    |  2 +-\n connect.c                   | 16 +++++++-------\n daemon.c                    |  8 +++----\n diff.c                      |  2 +-\n environment.c               |  2 +-\n exec-cmd.c                  |  6 ++---\n git.c                       | 10 ++++-----\n graph.c                     |  4 ++--\n http-push.c                 |  2 +-\n ls-refs.c                   |  6 ++---\n merge.c                     |  2 +-\n pathspec.c                  |  2 +-\n range-diff.c                |  2 +-\n ref-filter.c                |  4 ++--\n remote-curl.c               |  6 ++---\n remote.c                    |  2 +-\n revision.c                  |  4 ++--\n run-command.c               | 20 ++++++++---------\n sequencer.c                 |  4 ++--\n serve.c                     |  6 ++---\n strvec.c                    | 44 ++++++++++++++++++-------------------\n strvec.h                    | 20 ++++++++---------\n submodule.c                 | 14 ++++++------\n t/helper/test-run-command.c |  8 +++----\n tmp-objdir.c                |  2 +-\n transport-helper.c          |  2 +-\n upload-pack.c               |  2 +-\n 52 files changed, 186 insertions(+), 186 deletions(-)\n\ndiff --git a/add-interactive.c b/add-interactive.c\nindex 458f3a3e69..659289905c 100644\n--- a/add-interactive.c\n+++ b/add-interactive.c\n@@ -944,7 +944,7 @@ static int run_patch(struct add_i_state *s, const struct pathspec *ps,\n \t\t\t\t\t    files->items.items[i].string);\n \t\tparse_pathspec(&ps_selected,\n \t\t\t       PATHSPEC_ALL_MAGIC & ~PATHSPEC_LITERAL,\n-\t\t\t       PATHSPEC_LITERAL_PATH, \"\", args.argv);\n+\t\t\t       PATHSPEC_LITERAL_PATH, \"\", args.items);\n \t\tres = run_add_p(s->r, ADD_P_ADD, NULL, &ps_selected);\n \t\tstrvec_clear(&args);\n \t\tclear_pathspec(&ps_selected);\n@@ -986,7 +986,7 @@ static int run_diff(struct add_i_state *s, const struct pathspec *ps,\n \t\t\tif (files->selected[i])\n \t\t\t\tstrvec_push(&args,\n \t\t\t\t\t    files->items.items[i].string);\n-\t\tres = run_command_v_opt(args.argv, 0);\n+\t\tres = run_command_v_opt(args.items, 0);\n \t\tstrvec_clear(&args);\n \t}\n \ndiff --git a/add-patch.c b/add-patch.c\nindex 8c0772803b..df170d29ef 100644\n--- a/add-patch.c\n+++ b/add-patch.c\n@@ -391,14 +391,14 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)\n \t\t\t    get_oid(\"HEAD\", &oid) ?\n \t\t\t    empty_tree_oid_hex() : s->revision);\n \t}\n-\tcolor_arg_index = args.argc;\n+\tcolor_arg_index = args.nr;\n \t/* Use `--no-color` explicitly, just in case `diff.color = always`. */\n \tstrvec_pushl(&args, \"--no-color\", \"-p\", \"--\", NULL);\n \tfor (i = 0; i < ps->nr; i++)\n \t\tstrvec_push(&args, ps->items[i].original);\n \n \tsetup_child_process(s, &cp, NULL);\n-\tcp.argv = args.argv;\n+\tcp.argv = args.items;\n \tres = capture_command(&cp, plain, 0);\n \tif (res) {\n \t\tstrvec_clear(&args);\n@@ -415,8 +415,8 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)\n \t\tconst char *diff_filter = s->s.interactive_diff_filter;\n \n \t\tsetup_child_process(s, &colored_cp, NULL);\n-\t\txsnprintf((char *)args.argv[color_arg_index], 8, \"--color\");\n-\t\tcolored_cp.argv = args.argv;\n+\t\txsnprintf((char *)args.items[color_arg_index], 8, \"--color\");\n+\t\tcolored_cp.argv = args.items;\n \t\tcolored = &s->colored;\n \t\tres = capture_command(&colored_cp, colored, 0);\n \t\tstrvec_clear(&args);\ndiff --git a/bisect.c b/bisect.c\nindex 99ff694960..5d4ba23ba7 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -649,7 +649,7 @@ static void bisect_rev_setup(struct repository *r, struct rev_info *revs,\n \tif (read_paths)\n \t\tread_bisect_paths(&rev_argv);\n \n-\tsetup_revisions(rev_argv.argc, rev_argv.argv, revs, NULL);\n+\tsetup_revisions(rev_argv.nr, rev_argv.items, revs, NULL);\n \t/* XXX leak rev_argv, as \"revs\" may still be pointing to it */\n }\n \ndiff --git a/builtin/add.c b/builtin/add.c\nindex 6185dd12a8..eb6457da05 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -228,7 +228,7 @@ int run_add_interactive(const char *revision, const char *patch_mode,\n \t\t/* pass original pathspec, to be re-parsed */\n \t\tstrvec_push(&argv, pathspec->items[i].original);\n \n-\tstatus = run_command_v_opt(argv.argv, RUN_GIT_CMD);\n+\tstatus = run_command_v_opt(argv.items, RUN_GIT_CMD);\n \tstrvec_clear(&argv);\n \treturn status;\n }\ndiff --git a/builtin/am.c b/builtin/am.c\nindex 992ab3ca27..3f2adb3822 100644\n--- a/builtin/am.c\n+++ b/builtin/am.c\n@@ -812,7 +812,7 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths,\n \tstrbuf_release(&sb);\n \tfree(series_dir_buf);\n \n-\tret = split_mail_conv(stgit_patch_to_mail, state, patches.argv, keep_cr);\n+\tret = split_mail_conv(stgit_patch_to_mail, state, patches.items, keep_cr);\n \n \tstrvec_clear(&patches);\n \treturn ret;\n@@ -1002,7 +1002,7 @@ static void am_setup(struct am_state *state, enum patch_format patch_format,\n \t}\n \twrite_state_text(state, \"scissors\", str);\n \n-\tsq_quote_argv(&sb, state->git_apply_opts.argv);\n+\tsq_quote_argv(&sb, state->git_apply_opts.items);\n \twrite_state_text(state, \"apply-opt\", sb.buf);\n \n \tif (state->rebasing)\n@@ -1401,9 +1401,9 @@ static int run_apply(const struct am_state *state, const char *index_file)\n \t\tBUG(\"init_apply_state() failed\");\n \n \tstrvec_push(&apply_opts, \"apply\");\n-\tstrvec_pushv(&apply_opts, state->git_apply_opts.argv);\n+\tstrvec_pushv(&apply_opts, state->git_apply_opts.items);\n \n-\topts_left = apply_parse_options(apply_opts.argc, apply_opts.argv,\n+\topts_left = apply_parse_options(apply_opts.nr, apply_opts.items,\n \t\t\t\t\t&apply_state, &force_apply, &options,\n \t\t\t\t\tNULL);\n \n@@ -1428,7 +1428,7 @@ static int run_apply(const struct am_state *state, const char *index_file)\n \n \tstrvec_push(&apply_paths, am_path(state, \"patch\"));\n \n-\tres = apply_all_patches(&apply_state, apply_paths.argc, apply_paths.argv, options);\n+\tres = apply_all_patches(&apply_state, apply_paths.nr, apply_paths.items, options);\n \n \tstrvec_clear(&apply_paths);\n \tstrvec_clear(&apply_opts);\n@@ -1455,7 +1455,7 @@ static int build_fake_ancestor(const struct am_state *state, const char *index_f\n \n \tcp.git_cmd = 1;\n \tstrvec_push(&cp.args, \"apply\");\n-\tstrvec_pushv(&cp.args, state->git_apply_opts.argv);\n+\tstrvec_pushv(&cp.args, state->git_apply_opts.items);\n \tstrvec_pushf(&cp.args, \"--build-fake-ancestor=%s\", index_file);\n \tstrvec_push(&cp.args, am_path(state, \"patch\"));\n \n@@ -2376,10 +2376,10 @@ int cmd_am(int argc, const char **argv, const char *prefix)\n \t\t\t\tstrvec_push(&paths, mkpath(\"%s/%s\", prefix, argv[i]));\n \t\t}\n \n-\t\tif (state.interactive && !paths.argc)\n+\t\tif (state.interactive && !paths.nr)\n \t\t\tdie(_(\"interactive mode requires patches on the command line\"));\n \n-\t\tam_setup(&state, patch_format, paths.argv, keep_cr);\n+\t\tam_setup(&state, patch_format, paths.items, keep_cr);\n \n \t\tstrvec_clear(&paths);\n \t}\ndiff --git a/builtin/annotate.c b/builtin/annotate.c\nindex 7b7ecd366d..b9ab710740 100644\n--- a/builtin/annotate.c\n+++ b/builtin/annotate.c\n@@ -18,5 +18,5 @@ int cmd_annotate(int argc, const char **argv, const char *prefix)\n \t\tstrvec_push(&args, argv[i]);\n \t}\n \n-\treturn cmd_blame(args.argc, args.argv, prefix);\n+\treturn cmd_blame(args.nr, args.items, prefix);\n }\ndiff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c\nindex dd52878413..945641ea54 100644\n--- a/builtin/bisect--helper.c\n+++ b/builtin/bisect--helper.c\n@@ -168,7 +168,7 @@ static int bisect_reset(const char *commit)\n \t\tstruct strvec argv = STRVEC_INIT;\n \n \t\tstrvec_pushl(&argv, \"checkout\", branch.buf, \"--\", NULL);\n-\t\tif (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {\n+\t\tif (run_command_v_opt(argv.items, RUN_GIT_CMD)) {\n \t\t\terror(_(\"could not check out original\"\n \t\t\t\t\" HEAD '%s'. Try 'git bisect\"\n \t\t\t\t\" reset <commit>'.\"), branch.buf);\n@@ -530,7 +530,7 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout,\n \n \t\t\tstrvec_pushl(&argv, \"checkout\", start_head.buf,\n \t\t\t\t     \"--\", NULL);\n-\t\t\tif (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {\n+\t\t\tif (run_command_v_opt(argv.items, RUN_GIT_CMD)) {\n \t\t\t\tres = error(_(\"checking out '%s' failed.\"\n \t\t\t\t\t\t \" Try 'git bisect start \"\n \t\t\t\t\t\t \"<valid-branch>'.\"),\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex e26bd82dc4..e9712c383c 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -752,7 +752,7 @@ static int git_sparse_checkout_init(const char *repo)\n \t */\n \tcore_apply_sparse_checkout = 1;\n \n-\tif (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {\n+\tif (run_command_v_opt(argv.items, RUN_GIT_CMD)) {\n \t\terror(_(\"failed to initialize sparse-checkout\"));\n \t\tresult = 1;\n \t}\n@@ -844,7 +844,7 @@ static int checkout(int submodule_progress)\n \t\t\t\t\t       \"--single-branch\" :\n \t\t\t\t\t       \"--no-single-branch\");\n \n-\t\terr = run_command_v_opt(args.argv, RUN_GIT_CMD);\n+\t\terr = run_command_v_opt(args.items, RUN_GIT_CMD);\n \t\tstrvec_clear(&args);\n \t}\n \ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex c3f4067537..01105ce8b0 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1008,7 +1008,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tstruct strvec env = STRVEC_INIT;\n \n \t\tstrvec_pushf(&env, \"GIT_INDEX_FILE=%s\", index_file);\n-\t\tif (launch_editor(git_path_commit_editmsg(), NULL, env.argv)) {\n+\t\tif (launch_editor(git_path_commit_editmsg(), NULL, env.items)) {\n \t\t\tfprintf(stderr,\n \t\t\t_(\"Please supply the message using either -m or -F option.\\n\"));\n \t\t\texit(1);\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex e3cac8002c..85c1504065 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -509,7 +509,7 @@ static void describe_blob(struct object_id oid, struct strbuf *dst)\n \t\t     NULL);\n \n \trepo_init_revisions(the_repository, &revs, NULL);\n-\tif (setup_revisions(args.argc, args.argv, &revs, NULL) > 1)\n+\tif (setup_revisions(args.nr, args.items, &revs, NULL) > 1)\n \t\tBUG(\"setup_revisions could not handle all args?\");\n \n \tif (prepare_revision_walk(&revs))\n@@ -613,7 +613,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \t\t\tstrvec_pushv(&args, argv);\n \t\telse\n \t\t\tstrvec_push(&args, \"HEAD\");\n-\t\treturn cmd_name_rev(args.argc, args.argv, prefix);\n+\t\treturn cmd_name_rev(args.nr, args.items, prefix);\n \t}\n \n \thashmap_init(&names, commit_name_neq, NULL, 0);\n@@ -659,7 +659,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \n \t\t\trepo_init_revisions(the_repository, &revs, prefix);\n \t\t\tstrvec_pushv(&args, diff_index_args);\n-\t\t\tif (setup_revisions(args.argc, args.argv, &revs, NULL) != 1)\n+\t\t\tif (setup_revisions(args.nr, args.items, &revs, NULL) != 1)\n \t\t\t\tBUG(\"malformed internal diff-index command line\");\n \t\t\tresult = run_diff_index(&revs, 0);\n \ndiff --git a/builtin/difftool.c b/builtin/difftool.c\nindex 5ac021a1d4..78ea697325 100644\n--- a/builtin/difftool.c\n+++ b/builtin/difftool.c\n@@ -683,7 +683,7 @@ static int run_file_diff(int prompt, const char *prefix,\n \tstrvec_push(&args, \"diff\");\n \tfor (i = 0; i < argc; i++)\n \t\tstrvec_push(&args, argv[i]);\n-\tret = run_command_v_opt_cd_env(args.argv, RUN_GIT_CMD, prefix, env);\n+\tret = run_command_v_opt_cd_env(args.items, RUN_GIT_CMD, prefix, env);\n \texit(ret);\n }\n \ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex c2e7afeb6a..7953a1a25b 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -1354,7 +1354,7 @@ static int do_fetch(struct transport *transport,\n \n \tif (tags == TAGS_SET || tags == TAGS_DEFAULT) {\n \t\tmust_list_refs = 1;\n-\t\tif (ref_prefixes.argc)\n+\t\tif (ref_prefixes.nr)\n \t\t\tstrvec_push(&ref_prefixes, \"refs/tags/\");\n \t}\n \n@@ -1605,7 +1605,7 @@ static int fetch_multiple(struct string_list *list, int max_children)\n \tadd_options_to_argv(&argv);\n \n \tif (max_children != 1 && list->nr != 1) {\n-\t\tstruct parallel_fetch_state state = { argv.argv, list, 0, 0 };\n+\t\tstruct parallel_fetch_state state = { argv.items, list, 0, 0 };\n \n \t\tstrvec_push(&argv, \"--end-of-options\");\n \t\tresult = run_processes_parallel_tr2(max_children,\n@@ -1623,7 +1623,7 @@ static int fetch_multiple(struct string_list *list, int max_children)\n \t\t\tstrvec_push(&argv, name);\n \t\t\tif (verbosity >= 0)\n \t\t\t\tprintf(_(\"Fetching %s\\n\"), name);\n-\t\t\tif (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {\n+\t\t\tif (run_command_v_opt(argv.items, RUN_GIT_CMD)) {\n \t\t\t\terror(_(\"Could not fetch %s\"), name);\n \t\t\t\tresult = 1;\n \t\t\t}\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 98719800a3..10346e0465 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -514,11 +514,11 @@ static void gc_before_repack(void)\n \tif (done++)\n \t\treturn;\n \n-\tif (pack_refs && run_command_v_opt(pack_refs_cmd.argv, RUN_GIT_CMD))\n-\t\tdie(FAILED_RUN, pack_refs_cmd.argv[0]);\n+\tif (pack_refs && run_command_v_opt(pack_refs_cmd.items, RUN_GIT_CMD))\n+\t\tdie(FAILED_RUN, pack_refs_cmd.items[0]);\n \n-\tif (prune_reflogs && run_command_v_opt(reflog.argv, RUN_GIT_CMD))\n-\t\tdie(FAILED_RUN, reflog.argv[0]);\n+\tif (prune_reflogs && run_command_v_opt(reflog.items, RUN_GIT_CMD))\n+\t\tdie(FAILED_RUN, reflog.items[0]);\n }\n \n int cmd_gc(int argc, const char **argv, const char *prefix)\n@@ -653,8 +653,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \n \tif (!repository_format_precious_objects) {\n \t\tclose_object_store(the_repository->objects);\n-\t\tif (run_command_v_opt(repack.argv, RUN_GIT_CMD))\n-\t\t\tdie(FAILED_RUN, repack.argv[0]);\n+\t\tif (run_command_v_opt(repack.items, RUN_GIT_CMD))\n+\t\t\tdie(FAILED_RUN, repack.items[0]);\n \n \t\tif (prune_expire) {\n \t\t\tstrvec_push(&prune, prune_expire);\n@@ -663,19 +663,19 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \t\t\tif (has_promisor_remote())\n \t\t\t\tstrvec_push(&prune,\n \t\t\t\t\t    \"--exclude-promisor-objects\");\n-\t\t\tif (run_command_v_opt(prune.argv, RUN_GIT_CMD))\n-\t\t\t\tdie(FAILED_RUN, prune.argv[0]);\n+\t\t\tif (run_command_v_opt(prune.items, RUN_GIT_CMD))\n+\t\t\t\tdie(FAILED_RUN, prune.items[0]);\n \t\t}\n \t}\n \n \tif (prune_worktrees_expire) {\n \t\tstrvec_push(&prune_worktrees, prune_worktrees_expire);\n-\t\tif (run_command_v_opt(prune_worktrees.argv, RUN_GIT_CMD))\n-\t\t\tdie(FAILED_RUN, prune_worktrees.argv[0]);\n+\t\tif (run_command_v_opt(prune_worktrees.items, RUN_GIT_CMD))\n+\t\t\tdie(FAILED_RUN, prune_worktrees.items[0]);\n \t}\n \n-\tif (run_command_v_opt(rerere.argv, RUN_GIT_CMD))\n-\t\tdie(FAILED_RUN, rerere.argv[0]);\n+\tif (run_command_v_opt(rerere.items, RUN_GIT_CMD))\n+\t\tdie(FAILED_RUN, rerere.items[0]);\n \n \treport_garbage = report_pack_garbage;\n \treprepare_packed_git(the_repository);\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 323f8bce80..492a61aed0 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -3704,7 +3704,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)\n \tif (!use_internal_rev_list)\n \t\tread_object_list_from_stdin();\n \telse {\n-\t\tget_object_list(rp.argc, rp.argv);\n+\t\tget_object_list(rp.nr, rp.items);\n \t\tstrvec_clear(&rp);\n \t}\n \tcleanup_preferred_base();\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex dae8766646..858b492af3 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -584,14 +584,14 @@ static int run_fetch(const char *repo, const char **refspecs)\n \t\tstrvec_push(&args, \"--no-show-forced-updates\");\n \tif (set_upstream)\n \t\tstrvec_push(&args, set_upstream);\n-\tstrvec_pushv(&args, opt_fetch.argv);\n+\tstrvec_pushv(&args, opt_fetch.items);\n \n \tif (repo) {\n \t\tstrvec_push(&args, repo);\n \t\tstrvec_pushv(&args, refspecs);\n \t} else if (*refspecs)\n \t\tBUG(\"refspecs without repo?\");\n-\tret = run_command_v_opt(args.argv, RUN_GIT_CMD);\n+\tret = run_command_v_opt(args.items, RUN_GIT_CMD);\n \tstrvec_clear(&args);\n \treturn ret;\n }\n@@ -691,8 +691,8 @@ static int run_merge(void)\n \t\tstrvec_push(&args, opt_ff);\n \tif (opt_verify_signatures)\n \t\tstrvec_push(&args, opt_verify_signatures);\n-\tstrvec_pushv(&args, opt_strategies.argv);\n-\tstrvec_pushv(&args, opt_strategy_opts.argv);\n+\tstrvec_pushv(&args, opt_strategies.items);\n+\tstrvec_pushv(&args, opt_strategy_opts.items);\n \tif (opt_gpg_sign)\n \t\tstrvec_push(&args, opt_gpg_sign);\n \tif (opt_autostash == 0)\n@@ -703,7 +703,7 @@ static int run_merge(void)\n \t\tstrvec_push(&args, \"--allow-unrelated-histories\");\n \n \tstrvec_push(&args, \"FETCH_HEAD\");\n-\tret = run_command_v_opt(args.argv, RUN_GIT_CMD);\n+\tret = run_command_v_opt(args.items, RUN_GIT_CMD);\n \tstrvec_clear(&args);\n \treturn ret;\n }\n@@ -882,8 +882,8 @@ static int run_rebase(const struct object_id *curr_head,\n \t\tstrvec_push(&args, \"--interactive\");\n \tif (opt_diffstat)\n \t\tstrvec_push(&args, opt_diffstat);\n-\tstrvec_pushv(&args, opt_strategies.argv);\n-\tstrvec_pushv(&args, opt_strategy_opts.argv);\n+\tstrvec_pushv(&args, opt_strategies.items);\n+\tstrvec_pushv(&args, opt_strategy_opts.items);\n \tif (opt_gpg_sign)\n \t\tstrvec_push(&args, opt_gpg_sign);\n \tif (opt_autostash == 0)\n@@ -902,7 +902,7 @@ static int run_rebase(const struct object_id *curr_head,\n \telse\n \t\tstrvec_push(&args, oid_to_hex(merge_head));\n \n-\tret = run_command_v_opt(args.argv, RUN_GIT_CMD);\n+\tret = run_command_v_opt(args.items, RUN_GIT_CMD);\n \tstrvec_clear(&args);\n \treturn ret;\n }\ndiff --git a/builtin/rebase.c b/builtin/rebase.c\nindex 35aeb8effc..494107a648 100644\n--- a/builtin/rebase.c\n+++ b/builtin/rebase.c\n@@ -351,7 +351,7 @@ static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)\n \t\t\t     oid_to_hex(&opts->restrict_revision->object.oid));\n \n \tret = sequencer_make_script(the_repository, &todo_list.buf,\n-\t\t\t\t    make_script_args.argc, make_script_args.argv,\n+\t\t\t\t    make_script_args.nr, make_script_args.items,\n \t\t\t\t    flags);\n \n \tif (ret)\n@@ -900,7 +900,7 @@ static int run_am(struct rebase_options *opts)\n \t\treturn status;\n \t}\n \n-\tstrvec_pushv(&am.args, opts->git_am_opts.argv);\n+\tstrvec_pushv(&am.args, opts->git_am_opts.items);\n \tstrvec_push(&am.args, \"--rebasing\");\n \tstrvec_pushf(&am.args, \"--resolvemsg=%s\", resolvemsg);\n \tstrvec_push(&am.args, \"--patch-format=mboxrd\");\n@@ -969,7 +969,7 @@ static int run_specific_rebase(struct rebase_options *opts, enum action action)\n \tadd_var(&script_snippet, \"revisions\", opts->revisions);\n \tadd_var(&script_snippet, \"restrict_revision\", opts->restrict_revision ?\n \t\toid_to_hex(&opts->restrict_revision->object.oid) : NULL);\n-\tsq_quote_argv_pretty(&buf, opts->git_am_opts.argv);\n+\tsq_quote_argv_pretty(&buf, opts->git_am_opts.items);\n \tadd_var(&script_snippet, \"git_am_opt\", buf.buf);\n \tstrbuf_release(&buf);\n \tadd_var(&script_snippet, \"verbose\",\n@@ -1625,8 +1625,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)\n \t\tallow_preemptive_ff = 0;\n \t}\n \n-\tfor (i = 0; i < options.git_am_opts.argc; i++) {\n-\t\tconst char *option = options.git_am_opts.argv[i], *p;\n+\tfor (i = 0; i < options.git_am_opts.nr; i++) {\n+\t\tconst char *option = options.git_am_opts.items[i], *p;\n \t\tif (!strcmp(option, \"--committer-date-is-author-date\") ||\n \t\t    !strcmp(option, \"--ignore-date\") ||\n \t\t    !strcmp(option, \"--whitespace=fix\") ||\n@@ -1721,10 +1721,10 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)\n \tif (isatty(2) && options.flags & REBASE_NO_QUIET)\n \t\tstrbuf_addstr(&options.git_format_patch_opt, \" --progress\");\n \n-\tif (options.git_am_opts.argc || options.type == REBASE_APPLY) {\n+\tif (options.git_am_opts.nr || options.type == REBASE_APPLY) {\n \t\t/* all am options except -q are compatible only with --apply */\n-\t\tfor (i = options.git_am_opts.argc - 1; i >= 0; i--)\n-\t\t\tif (strcmp(options.git_am_opts.argv[i], \"-q\"))\n+\t\tfor (i = options.git_am_opts.nr - 1; i >= 0; i--)\n+\t\t\tif (strcmp(options.git_am_opts.items[i], \"-q\"))\n \t\t\t\tbreak;\n \n \t\tif (i >= 0) {\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex 1fc69cf5bc..8747a4e91f 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -950,7 +950,7 @@ static const char *push_to_deploy(unsigned char *sha1,\n \tstruct child_process child = CHILD_PROCESS_INIT;\n \n \tchild.argv = update_refresh;\n-\tchild.env = env->argv;\n+\tchild.env = env->items;\n \tchild.dir = work_tree;\n \tchild.no_stdin = 1;\n \tchild.stdout_to_stderr = 1;\n@@ -961,7 +961,7 @@ static const char *push_to_deploy(unsigned char *sha1,\n \t/* run_command() does not clean up completely; reinitialize */\n \tchild_process_init(&child);\n \tchild.argv = diff_files;\n-\tchild.env = env->argv;\n+\tchild.env = env->items;\n \tchild.dir = work_tree;\n \tchild.no_stdin = 1;\n \tchild.stdout_to_stderr = 1;\n@@ -974,7 +974,7 @@ static const char *push_to_deploy(unsigned char *sha1,\n \n \tchild_process_init(&child);\n \tchild.argv = diff_index;\n-\tchild.env = env->argv;\n+\tchild.env = env->items;\n \tchild.no_stdin = 1;\n \tchild.no_stdout = 1;\n \tchild.stdout_to_stderr = 0;\n@@ -985,7 +985,7 @@ static const char *push_to_deploy(unsigned char *sha1,\n \tread_tree[3] = hash_to_hex(sha1);\n \tchild_process_init(&child);\n \tchild.argv = read_tree;\n-\tchild.env = env->argv;\n+\tchild.env = env->items;\n \tchild.dir = work_tree;\n \tchild.no_stdin = 1;\n \tchild.no_stdout = 1;\n@@ -1004,7 +1004,7 @@ static const char *push_to_checkout(unsigned char *hash,\n \t\t\t\t    const char *work_tree)\n {\n \tstrvec_pushf(env, \"GIT_WORK_TREE=%s\", absolute_path(work_tree));\n-\tif (run_hook_le(env->argv, push_to_checkout_hook,\n+\tif (run_hook_le(env->items, push_to_checkout_hook,\n \t\t\thash_to_hex(hash), NULL))\n \t\treturn \"push-to-checkout hook declined\";\n \telse\n@@ -1205,11 +1205,11 @@ static void run_update_post_hook(struct command *commands)\n \tfor (cmd = commands; cmd; cmd = cmd->next) {\n \t\tif (cmd->error_string || cmd->did_not_exist)\n \t\t\tcontinue;\n-\t\tif (!proc.args.argc)\n+\t\tif (!proc.args.nr)\n \t\t\tstrvec_push(&proc.args, hook);\n \t\tstrvec_push(&proc.args, cmd->ref_name);\n \t}\n-\tif (!proc.args.argc)\n+\tif (!proc.args.nr)\n \t\treturn;\n \n \tproc.no_stdin = 1;\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex a3b33c2c88..9a98e77a5e 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -1470,15 +1470,15 @@ static int update(int argc, const char **argv)\n \tfor (i = 1; i < argc; i++)\n \t\tstrvec_push(&fetch_argv, argv[i]);\n \n-\tif (strcmp(fetch_argv.argv[fetch_argv.argc-1], \"default\") == 0) {\n+\tif (strcmp(fetch_argv.items[fetch_argv.nr-1], \"default\") == 0) {\n \t\tgit_config(get_remote_default, &default_defined);\n \t\tif (!default_defined) {\n \t\t\tstrvec_pop(&fetch_argv);\n \t\t\tstrvec_push(&fetch_argv, \"--all\");\n \t\t}\n \t}\n \n-\tretval = run_command_v_opt(fetch_argv.argv, RUN_GIT_CMD);\n+\tretval = run_command_v_opt(fetch_argv.items, RUN_GIT_CMD);\n \tstrvec_clear(&fetch_argv);\n \treturn retval;\n }\ndiff --git a/builtin/replace.c b/builtin/replace.c\nindex 7bc5d66ed9..038b7f874b 100644\n--- a/builtin/replace.c\n+++ b/builtin/replace.c\n@@ -513,7 +513,7 @@ static int convert_graft_file(int force)\n \t\t\tcontinue;\n \n \t\tstrvec_split(&args, buf.buf);\n-\t\tif (args.argc && create_graft(args.argc, args.argv, force, 1))\n+\t\tif (args.nr && create_graft(args.nr, args.items, force, 1))\n \t\t\tstrbuf_addf(&err, \"\\n\\t%s\", buf.buf);\n \t\tstrvec_clear(&args);\n \t}\ndiff --git a/builtin/show-branch.c b/builtin/show-branch.c\nindex 4c918ce90d..de27703297 100644\n--- a/builtin/show-branch.c\n+++ b/builtin/show-branch.c\n@@ -561,7 +561,7 @@ static int git_show_branch_config(const char *var, const char *value, void *cb)\n \t\t * default_arg is now passed to parse_options(), so we need to\n \t\t * mimic the real argv a bit better.\n \t\t */\n-\t\tif (!default_args.argc)\n+\t\tif (!default_args.nr)\n \t\t\tstrvec_push(&default_args, \"show-branch\");\n \t\tstrvec_push(&default_args, value);\n \t\treturn 0;\n@@ -684,9 +684,9 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)\n \tgit_config(git_show_branch_config, NULL);\n \n \t/* If nothing is specified, try the default first */\n-\tif (ac == 1 && default_args.argc) {\n-\t\tac = default_args.argc;\n-\t\tav = default_args.argv;\n+\tif (ac == 1 && default_args.nr) {\n+\t\tac = default_args.nr;\n+\t\tav = default_args.items;\n \t}\n \n \tac = parse_options(ac, av, prefix, builtin_show_branch_options,\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex bfdbafae89..0134c6b0d6 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -745,7 +745,7 @@ static int show_stash(int argc, const char **argv, const char *prefix)\n \t\t\tstrvec_push(&revision_args, argv[i]);\n \t}\n \n-\tret = get_stash_info(&info, stash_args.argc, stash_args.argv);\n+\tret = get_stash_info(&info, stash_args.nr, stash_args.items);\n \tstrvec_clear(&stash_args);\n \tif (ret)\n \t\treturn -1;\n@@ -754,7 +754,7 @@ static int show_stash(int argc, const char **argv, const char *prefix)\n \t * The config settings are applied only if there are not passed\n \t * any options.\n \t */\n-\tif (revision_args.argc == 1) {\n+\tif (revision_args.nr == 1) {\n \t\tif (show_stat)\n \t\t\trev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT;\n \n@@ -767,7 +767,7 @@ static int show_stash(int argc, const char **argv, const char *prefix)\n \t\t}\n \t}\n \n-\targc = setup_revisions(revision_args.argc, revision_args.argv, &rev, NULL);\n+\targc = setup_revisions(revision_args.nr, revision_args.items, &rev, NULL);\n \tif (argc > 1) {\n \t\tfree_stash_info(&info);\n \t\tusage_with_options(git_stash_show_usage, options);\n@@ -1611,5 +1611,5 @@ int cmd_stash(int argc, const char **argv, const char *prefix)\n \t/* Assume 'stash push' */\n \tstrvec_push(&args, \"push\");\n \tstrvec_pushv(&args, argv);\n-\treturn !!push_stash(args.argc, args.argv, prefix, 1);\n+\treturn !!push_stash(args.nr, args.items, prefix, 1);\n }\ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex 665db1ffed..6bbed9f92a 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -817,9 +817,9 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,\n \n \trepo_init_revisions(the_repository, &rev, NULL);\n \trev.abbrev = 0;\n-\tdiff_files_args.argc = setup_revisions(diff_files_args.argc,\n-\t\t\t\t\t       diff_files_args.argv,\n-\t\t\t\t\t       &rev, NULL);\n+\tdiff_files_args.nr = setup_revisions(diff_files_args.nr,\n+\t\t\t\t\t     diff_files_args.items,\n+\t\t\t\t\t     &rev, NULL);\n \tdiff_files_result = run_diff_files(&rev, 0);\n \n \tif (!diff_result_code(&rev.diffopt, diff_files_result)) {\ndiff --git a/builtin/upload-archive.c b/builtin/upload-archive.c\nindex f02bb0ea15..8ded611092 100644\n--- a/builtin/upload-archive.c\n+++ b/builtin/upload-archive.c\n@@ -36,7 +36,7 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)\n \t\tchar *buf = packet_read_line(0, NULL);\n \t\tif (!buf)\n \t\t\tbreak;\t/* got a flush */\n-\t\tif (sent_argv.argc > MAX_ARGS)\n+\t\tif (sent_argv.nr > MAX_ARGS)\n \t\t\tdie(\"Too many options (>%d)\", MAX_ARGS - 1);\n \n \t\tif (!starts_with(buf, arg_cmd))\n@@ -45,7 +45,7 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)\n \t}\n \n \t/* parse all options sent by the client */\n-\treturn write_archive(sent_argv.argc, sent_argv.argv, prefix,\n+\treturn write_archive(sent_argv.nr, sent_argv.items, prefix,\n \t\t\t     the_repository, NULL, 1);\n }\n \ndiff --git a/builtin/worktree.c b/builtin/worktree.c\nindex be5d84f0a0..1d6b9455da 100644\n--- a/builtin/worktree.c\n+++ b/builtin/worktree.c\n@@ -422,7 +422,7 @@ static int add_worktree(const char *path, const char *refname,\n \t\t\tstrvec_push(&cp.args, \"--quiet\");\n \t}\n \n-\tcp.env = child_env.argv;\n+\tcp.env = child_env.items;\n \tret = run_command(&cp);\n \tif (ret)\n \t\tgoto done;\n@@ -433,7 +433,7 @@ static int add_worktree(const char *path, const char *refname,\n \t\tstrvec_pushl(&cp.args, \"reset\", \"--hard\", \"--no-recurse-submodules\", NULL);\n \t\tif (opts->quiet)\n \t\t\tstrvec_push(&cp.args, \"--quiet\");\n-\t\tcp.env = child_env.argv;\n+\t\tcp.env = child_env.items;\n \t\tret = run_command(&cp);\n \t\tif (ret)\n \t\t\tgoto done;\n@@ -943,7 +943,7 @@ static void check_clean_worktree(struct worktree *wt,\n \tstrvec_pushl(&cp.args, \"status\",\n \t\t     \"--porcelain\", \"--ignore-submodules=none\",\n \t\t     NULL);\n-\tcp.env = child_env.argv;\n+\tcp.env = child_env.items;\n \tcp.git_cmd = 1;\n \tcp.dir = wt->path;\n \tcp.out = -1;\ndiff --git a/bundle.c b/bundle.c\nindex 565d05367f..2ba2277ef0 100644\n--- a/bundle.c\n+++ b/bundle.c\n@@ -278,7 +278,7 @@ static int write_pack_data(int bundle_fd, struct rev_info *revs, struct strvec *\n \t\t     \"pack-objects\",\n \t\t     \"--stdout\", \"--thin\", \"--delta-base-offset\",\n \t\t     NULL);\n-\tstrvec_pushv(&pack_objects.args, pack_options->argv);\n+\tstrvec_pushv(&pack_objects.args, pack_options->items);\n \tpack_objects.in = -1;\n \tpack_objects.out = bundle_fd;\n \tpack_objects.git_cmd = 1;\ndiff --git a/commit.c b/commit.c\nindex a5176a25bd..c8fd6931a6 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -1643,7 +1643,7 @@ int run_commit_hook(int editor_is_used, const char *index_file,\n \t\tstrvec_push(&hook_env, \"GIT_EDITOR=:\");\n \n \tva_start(args, name);\n-\tret = run_hook_ve(hook_env.argv,name, args);\n+\tret = run_hook_ve(hook_env.items, name, args);\n \tva_end(args);\n \tstrvec_clear(&hook_env);\n \ndiff --git a/connect.c b/connect.c\nindex 3299ea956a..e3a08179d4 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -70,9 +70,9 @@ int server_supports_v2(const char *c, int die_on_error)\n {\n \tint i;\n \n-\tfor (i = 0; i < server_capabilities_v2.argc; i++) {\n+\tfor (i = 0; i < server_capabilities_v2.nr; i++) {\n \t\tconst char *out;\n-\t\tif (skip_prefix(server_capabilities_v2.argv[i], c, &out) &&\n+\t\tif (skip_prefix(server_capabilities_v2.items[i], c, &out) &&\n \t\t    (!*out || *out == '='))\n \t\t\treturn 1;\n \t}\n@@ -87,9 +87,9 @@ int server_feature_v2(const char *c, const char **v)\n {\n \tint i;\n \n-\tfor (i = 0; i < server_capabilities_v2.argc; i++) {\n+\tfor (i = 0; i < server_capabilities_v2.nr; i++) {\n \t\tconst char *out;\n-\t\tif (skip_prefix(server_capabilities_v2.argv[i], c, &out) &&\n+\t\tif (skip_prefix(server_capabilities_v2.items[i], c, &out) &&\n \t\t    (*out == '=')) {\n \t\t\t*v = out + 1;\n \t\t\treturn 1;\n@@ -103,9 +103,9 @@ int server_supports_feature(const char *c, const char *feature,\n {\n \tint i;\n \n-\tfor (i = 0; i < server_capabilities_v2.argc; i++) {\n+\tfor (i = 0; i < server_capabilities_v2.nr; i++) {\n \t\tconst char *out;\n-\t\tif (skip_prefix(server_capabilities_v2.argv[i], c, &out) &&\n+\t\tif (skip_prefix(server_capabilities_v2.items[i], c, &out) &&\n \t\t    (!*out || *(out++) == '=')) {\n \t\t\tif (parse_feature_request(out, feature))\n \t\t\t\treturn 1;\n@@ -488,9 +488,9 @@ struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,\n \tif (!for_push)\n \t\tpacket_write_fmt(fd_out, \"peel\\n\");\n \tpacket_write_fmt(fd_out, \"symrefs\\n\");\n-\tfor (i = 0; ref_prefixes && i < ref_prefixes->argc; i++) {\n+\tfor (i = 0; ref_prefixes && i < ref_prefixes->nr; i++) {\n \t\tpacket_write_fmt(fd_out, \"ref-prefix %s\\n\",\n-\t\t\t\t ref_prefixes->argv[i]);\n+\t\t\t\t ref_prefixes->items[i]);\n \t}\n \tpacket_flush(fd_out);\n \ndiff --git a/daemon.c b/daemon.c\nindex 0dec89fa02..ee66002a6f 100644\n--- a/daemon.c\n+++ b/daemon.c\n@@ -482,7 +482,7 @@ static int upload_pack(const struct strvec *env)\n \tstrvec_pushl(&cld.args, \"upload-pack\", \"--strict\", NULL);\n \tstrvec_pushf(&cld.args, \"--timeout=%u\", timeout);\n \n-\tstrvec_pushv(&cld.env_array, env->argv);\n+\tstrvec_pushv(&cld.env_array, env->items);\n \n \treturn run_service_command(&cld);\n }\n@@ -492,7 +492,7 @@ static int upload_archive(const struct strvec *env)\n \tstruct child_process cld = CHILD_PROCESS_INIT;\n \tstrvec_push(&cld.args, \"upload-archive\");\n \n-\tstrvec_pushv(&cld.env_array, env->argv);\n+\tstrvec_pushv(&cld.env_array, env->items);\n \n \treturn run_service_command(&cld);\n }\n@@ -502,7 +502,7 @@ static int receive_pack(const struct strvec *env)\n \tstruct child_process cld = CHILD_PROCESS_INIT;\n \tstrvec_push(&cld.args, \"receive-pack\");\n \n-\tstrvec_pushv(&cld.env_array, env->argv);\n+\tstrvec_pushv(&cld.env_array, env->items);\n \n \treturn run_service_command(&cld);\n }\n@@ -927,7 +927,7 @@ static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)\n #endif\n \t}\n \n-\tcld.argv = cld_argv.argv;\n+\tcld.argv = cld_argv.items;\n \tcld.in = incoming;\n \tcld.out = dup(incoming);\n \ndiff --git a/diff.c b/diff.c\nindex f1a3758922..fb5462c532 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -4239,7 +4239,7 @@ static void run_external_diff(const char *pgm,\n \n \tdiff_free_filespec_data(one);\n \tdiff_free_filespec_data(two);\n-\tif (run_command_v_opt_cd_env(argv.argv, RUN_USING_SHELL, NULL, env.argv))\n+\tif (run_command_v_opt_cd_env(argv.items, RUN_USING_SHELL, NULL, env.items))\n \t\tdie(_(\"external diff died, stopping at %s\"), name);\n \n \tremove_tempfile();\ndiff --git a/environment.c b/environment.c\nindex 00fe20e496..449a46995d 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -164,7 +164,7 @@ static const char *getenv_safe(struct strvec *argv, const char *name)\n \t\treturn NULL;\n \n \tstrvec_push(argv, value);\n-\treturn argv->argv[argv->argc - 1];\n+\treturn argv->items[argv->nr - 1];\n }\n \n void setup_git_env(const char *git_dir)\ndiff --git a/exec-cmd.c b/exec-cmd.c\nindex 0f8e888424..d657c025c2 100644\n--- a/exec-cmd.c\n+++ b/exec-cmd.c\n@@ -324,18 +324,18 @@ const char **prepare_git_cmd(struct strvec *out, const char **argv)\n {\n \tstrvec_push(out, \"git\");\n \tstrvec_pushv(out, argv);\n-\treturn out->argv;\n+\treturn out->items;\n }\n \n int execv_git_cmd(const char **argv)\n {\n \tstruct strvec nargv = STRVEC_INIT;\n \n \tprepare_git_cmd(&nargv, argv);\n-\ttrace_argv_printf(nargv.argv, \"trace: exec:\");\n+\ttrace_argv_printf(nargv.items, \"trace: exec:\");\n \n \t/* execvp() can only ever return if it fails */\n-\tsane_execvp(\"git\", (char **)nargv.argv);\n+\tsane_execvp(\"git\", (char **)nargv.items);\n \n \ttrace_printf(\"trace: exec failed: %s\\n\", strerror(errno));\n \ndiff --git a/git.c b/git.c\nindex 258035cfb1..832688ca23 100644\n--- a/git.c\n+++ b/git.c\n@@ -352,7 +352,7 @@ static int handle_alias(int *argcp, const char ***argv)\n \t\t\tstrvec_push(&child.args, alias_string + 1);\n \t\t\tstrvec_pushv(&child.args, (*argv) + 1);\n \n-\t\t\ttrace2_cmd_alias(alias_command, child.args.argv);\n+\t\t\ttrace2_cmd_alias(alias_command, child.args.items);\n \t\t\ttrace2_cmd_list_config();\n \t\t\ttrace2_cmd_list_env_vars();\n \t\t\ttrace2_cmd_name(\"_run_shell_alias_\");\n@@ -667,7 +667,7 @@ static void handle_builtin(int argc, const char **argv)\n \t\t}\n \n \t\targc++;\n-\t\targv = args.argv;\n+\t\targv = args.items;\n \t}\n \n \tbuiltin = get_builtin(cmd);\n@@ -701,7 +701,7 @@ static void execv_dashed_external(const char **argv)\n \t * The code in run_command() logs trace2 child_start/child_exit\n \t * events, so we do not need to report exec/exec_result events here.\n \t */\n-\ttrace_argv_printf(cmd.args.argv, \"trace: exec:\");\n+\ttrace_argv_printf(cmd.args.items, \"trace: exec:\");\n \n \t/*\n \t * If we fail because the command is not found, it is\n@@ -762,13 +762,13 @@ static int run_argv(int *argcp, const char ***argv)\n \t\t\tfor (i = 0; i < *argcp; i++)\n \t\t\t\tstrvec_push(&args, (*argv)[i]);\n \n-\t\t\ttrace_argv_printf(args.argv, \"trace: exec:\");\n+\t\t\ttrace_argv_printf(args.items, \"trace: exec:\");\n \n \t\t\t/*\n \t\t\t * if we fail because the command is not found, it is\n \t\t\t * OK to return. Otherwise, we just pass along the status code.\n \t\t\t */\n-\t\t\ti = run_command_v_opt_tr2(args.argv, RUN_SILENT_EXEC_FAILURE |\n+\t\t\ti = run_command_v_opt_tr2(args.items, RUN_SILENT_EXEC_FAILURE |\n \t\t\t\t\t\t  RUN_CLEAN_ON_EXIT | RUN_WAIT_AFTER_CLEAN, \"git_alias\");\n \t\t\tif (i >= 0 || errno != ENOENT)\n \t\t\t\texit(i);\ndiff --git a/graph.c b/graph.c\nindex 09c9cc968c..1d68fffa24 100644\n--- a/graph.c\n+++ b/graph.c\n@@ -355,8 +355,8 @@ struct git_graph *graph_init(struct rev_info *opt)\n \t\t\tparse_graph_colors_config(&custom_colors, string);\n \t\t\tfree(string);\n \t\t\t/* graph_set_column_colors takes a max-index, not a count */\n-\t\t\tgraph_set_column_colors(custom_colors.argv,\n-\t\t\t\t\t\tcustom_colors.argc - 1);\n+\t\t\tgraph_set_column_colors(custom_colors.items,\n+\t\t\t\t\t\tcustom_colors.nr - 1);\n \t\t}\n \t}\n \ndiff --git a/http-push.c b/http-push.c\nindex 31911aa345..c4e3825609 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -1931,7 +1931,7 @@ int cmd_main(int argc, const char **argv)\n \t\t\tstrvec_pushf(&commit_argv, \"^%s\",\n \t\t\t\t     oid_to_hex(&ref->old_oid));\n \t\trepo_init_revisions(the_repository, &revs, setup_git_directory());\n-\t\tsetup_revisions(commit_argv.argc, commit_argv.argv, &revs, NULL);\n+\t\tsetup_revisions(commit_argv.nr, commit_argv.items, &revs, NULL);\n \t\trevs.edge_hint = 0; /* just in case */\n \n \t\t/* Generate a list of objects that need to be pushed */\ndiff --git a/ls-refs.c b/ls-refs.c\nindex 8192c949f4..e6b8c9cf8e 100644\n--- a/ls-refs.c\n+++ b/ls-refs.c\n@@ -15,11 +15,11 @@ static int ref_match(const struct strvec *prefixes, const char *refname)\n {\n \tint i;\n \n-\tif (!prefixes->argc)\n+\tif (!prefixes->nr)\n \t\treturn 1; /* no restriction */\n \n-\tfor (i = 0; i < prefixes->argc; i++) {\n-\t\tconst char *prefix = prefixes->argv[i];\n+\tfor (i = 0; i < prefixes->nr; i++) {\n+\t\tconst char *prefix = prefixes->items[i];\n \n \t\tif (starts_with(refname, prefix))\n \t\t\treturn 1;\ndiff --git a/merge.c b/merge.c\nindex a05b054faa..bcfb9dcf8a 100644\n--- a/merge.c\n+++ b/merge.c\n@@ -33,7 +33,7 @@ int try_merge_command(struct repository *r,\n \tfor (j = remotes; j; j = j->next)\n \t\tstrvec_push(&args, merge_argument(j->item));\n \n-\tret = run_command_v_opt(args.argv, RUN_GIT_CMD);\n+\tret = run_command_v_opt(args.items, RUN_GIT_CMD);\n \tstrvec_clear(&args);\n \n \tdiscard_index(r->index);\ndiff --git a/pathspec.c b/pathspec.c\nindex c303126f37..75378f49d1 100644\n--- a/pathspec.c\n+++ b/pathspec.c\n@@ -652,7 +652,7 @@ void parse_pathspec_file(struct pathspec *pathspec, unsigned magic_mask,\n \tif (in != stdin)\n \t\tfclose(in);\n \n-\tparse_pathspec(pathspec, magic_mask, flags, prefix, parsed_file.argv);\n+\tparse_pathspec(pathspec, magic_mask, flags, prefix, parsed_file.items);\n \tstrvec_clear(&parsed_file);\n }\n \ndiff --git a/range-diff.c b/range-diff.c\nindex 831c490bf2..3fa3ac6cb5 100644\n--- a/range-diff.c\n+++ b/range-diff.c\n@@ -67,7 +67,7 @@ static int read_patches(const char *range, struct string_list *list,\n \t\t     \"--notes\",\n \t\t     NULL);\n \tif (other_arg)\n-\t\tstrvec_pushv(&cp.args, other_arg->argv);\n+\t\tstrvec_pushv(&cp.args, other_arg->items);\n \tstrvec_push(&cp.args, range);\n \tcp.out = -1;\n \tcp.no_stdin = 1;\ndiff --git a/ref-filter.c b/ref-filter.c\nindex 7f013851ed..9d29271478 100644\n--- a/ref-filter.c\n+++ b/ref-filter.c\n@@ -1918,9 +1918,9 @@ static void find_longest_prefixes(struct string_list *out,\n \tstruct strbuf prefix = STRBUF_INIT;\n \n \tstrvec_pushv(&sorted, patterns);\n-\tQSORT(sorted.argv, sorted.argc, qsort_strcmp);\n+\tQSORT(sorted.items, sorted.nr, qsort_strcmp);\n \n-\tfind_longest_prefixes_1(out, &prefix, sorted.argv, sorted.argc);\n+\tfind_longest_prefixes_1(out, &prefix, sorted.items, sorted.nr);\n \n \tstrvec_clear(&sorted);\n \tstrbuf_release(&prefix);\ndiff --git a/remote-curl.c b/remote-curl.c\nindex 7feaddc003..564da05648 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -1190,7 +1190,7 @@ static int fetch_git(struct discovery *heads,\n \trpc.service_name = \"git-upload-pack\",\n \trpc.gzip_request = 1;\n \n-\terr = rpc_service(&rpc, heads, args.argv, &preamble, &rpc_result);\n+\terr = rpc_service(&rpc, heads, args.items, &preamble, &rpc_result);\n \tif (rpc_result.len)\n \t\twrite_or_die(1, rpc_result.buf, rpc_result.len);\n \tstrbuf_release(&rpc_result);\n@@ -1325,7 +1325,7 @@ static int push_git(struct discovery *heads, int nr_spec, const char **specs)\n \tmemset(&rpc, 0, sizeof(rpc));\n \trpc.service_name = \"git-receive-pack\",\n \n-\terr = rpc_service(&rpc, heads, args.argv, &preamble, &rpc_result);\n+\terr = rpc_service(&rpc, heads, args.items, &preamble, &rpc_result);\n \tif (rpc_result.len)\n \t\twrite_or_die(1, rpc_result.buf, rpc_result.len);\n \tstrbuf_release(&rpc_result);\n@@ -1366,7 +1366,7 @@ static void parse_push(struct strbuf *buf)\n \t\t\tbreak;\n \t} while (1);\n \n-\tret = push(specs.argc, specs.argv);\n+\tret = push(specs.nr, specs.items);\n \tprintf(\"\\n\");\n \tfflush(stdout);\n \ndiff --git a/remote.c b/remote.c\nindex b4665fe5a3..370bd07dc3 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -1919,7 +1919,7 @@ static int stat_branch_pair(const char *branch_name, const char *base,\n \tstrvec_push(&argv, \"--\");\n \n \trepo_init_revisions(the_repository, &revs, NULL);\n-\tsetup_revisions(argv.argc, argv.argv, &revs, NULL);\n+\tsetup_revisions(argv.nr, argv.items, &revs, NULL);\n \tif (prepare_revision_walk(&revs))\n \t\tdie(_(\"revision walk setup failed\"));\n \ndiff --git a/revision.c b/revision.c\nindex e144132ae9..d645487646 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -2767,7 +2767,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s\n \t\t\tgot_rev_arg = 1;\n \t}\n \n-\tif (prune_data.argc) {\n+\tif (prune_data.nr) {\n \t\t/*\n \t\t * If we need to introduce the magic \"a lone ':' means no\n \t\t * pathspec whatsoever\", here is the place to do so.\n@@ -2783,7 +2783,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s\n \t\t * }\n \t\t */\n \t\tparse_pathspec(&revs->prune_data, 0, 0,\n-\t\t\t       revs->prefix, prune_data.argv);\n+\t\t\t       revs->prefix, prune_data.items);\n \t}\n \tstrvec_clear(&prune_data);\n \ndiff --git a/run-command.c b/run-command.c\nindex b9630a1b5f..30104a4ee1 100644\n--- a/run-command.c\n+++ b/run-command.c\n@@ -287,7 +287,7 @@ static const char **prepare_shell_cmd(struct strvec *out, const char **argv)\n \t}\n \n \tstrvec_pushv(out, argv);\n-\treturn out->argv;\n+\treturn out->items;\n }\n \n #ifndef GIT_WINDOWS_NATIVE\n@@ -426,11 +426,11 @@ static int prepare_cmd(struct strvec *out, const struct child_process *cmd)\n \t * there are dir separator characters, we have exec attempt to invoke\n \t * the command directly.\n \t */\n-\tif (!has_dir_sep(out->argv[1])) {\n-\t\tchar *program = locate_in_PATH(out->argv[1]);\n+\tif (!has_dir_sep(out->items[1])) {\n+\t\tchar *program = locate_in_PATH(out->items[1]);\n \t\tif (program) {\n-\t\t\tfree((char *)out->argv[1]);\n-\t\t\tout->argv[1] = program;\n+\t\t\tfree((char *)out->items[1]);\n+\t\t\tout->items[1] = program;\n \t\t} else {\n \t\t\tstrvec_clear(out);\n \t\t\terrno = ENOENT;\n@@ -672,9 +672,9 @@ int start_command(struct child_process *cmd)\n \tchar *str;\n \n \tif (!cmd->argv)\n-\t\tcmd->argv = cmd->args.argv;\n+\t\tcmd->argv = cmd->args.items;\n \tif (!cmd->env)\n-\t\tcmd->env = cmd->env_array.argv;\n+\t\tcmd->env = cmd->env_array.items;\n \n \t/*\n \t * In case of errors we must keep the promise to close FDs\n@@ -846,10 +846,10 @@ int start_command(struct child_process *cmd)\n \t\t * be used in the event exec failed with ENOEXEC at which point\n \t\t * we will try to interpret the command using 'sh'.\n \t\t */\n-\t\texecve(argv.argv[1], (char *const *) argv.argv + 1,\n+\t\texecve(argv.items[1], (char *const *) argv.items + 1,\n \t\t       (char *const *) childenv);\n \t\tif (errno == ENOEXEC)\n-\t\t\texecve(argv.argv[0], (char *const *) argv.argv,\n+\t\t\texecve(argv.items[0], (char *const *) argv.items,\n \t\t\t       (char *const *) childenv);\n \n \t\tif (errno == ENOENT) {\n@@ -1874,7 +1874,7 @@ int run_auto_gc(int quiet)\n \tstrvec_pushl(&argv_gc_auto, \"gc\", \"--auto\", NULL);\n \tif (quiet)\n \t\tstrvec_push(&argv_gc_auto, \"--quiet\");\n-\tstatus = run_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD);\n+\tstatus = run_command_v_opt(argv_gc_auto.items, RUN_GIT_CMD);\n \tstrvec_clear(&argv_gc_auto);\n \treturn status;\n }\ndiff --git a/sequencer.c b/sequencer.c\nindex 31a2b1ab55..c1bcd64080 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -2761,7 +2761,7 @@ static int reset_merge(const struct object_id *oid)\n \tif (!is_null_oid(oid))\n \t\tstrvec_push(&argv, oid_to_hex(oid));\n \n-\tret = run_command_v_opt(argv.argv, RUN_GIT_CMD);\n+\tret = run_command_v_opt(argv.items, RUN_GIT_CMD);\n \tstrvec_clear(&argv);\n \n \treturn ret;\n@@ -3135,7 +3135,7 @@ static int do_exec(struct repository *r, const char *command_line)\n \tstrvec_pushf(&child_env, \"GIT_WORK_TREE=%s\",\n \t\t     absolute_path(get_git_work_tree()));\n \tstatus = run_command_v_opt_cd_env(child_argv, RUN_USING_SHELL, NULL,\n-\t\t\t\t\t  child_env.argv);\n+\t\t\t\t\t  child_env.items);\n \n \t/* force re-reading of the cache */\n \tif (discard_index(r->index) < 0 || repo_read_index(r) < 0)\ndiff --git a/serve.c b/serve.c\nindex 523a9be32d..0db929beff 100644\n--- a/serve.c\n+++ b/serve.c\n@@ -146,9 +146,9 @@ int has_capability(const struct strvec *keys, const char *capability,\n \t\t   const char **value)\n {\n \tint i;\n-\tfor (i = 0; i < keys->argc; i++) {\n+\tfor (i = 0; i < keys->nr; i++) {\n \t\tconst char *out;\n-\t\tif (skip_prefix(keys->argv[i], capability, &out) &&\n+\t\tif (skip_prefix(keys->items[i], capability, &out) &&\n \t\t    (!*out || *out == '=')) {\n \t\t\tif (value) {\n \t\t\t\tif (*out == '=')\n@@ -223,7 +223,7 @@ static int process_request(void)\n \t\t\t * If no command and no keys were given then the client\n \t\t\t * wanted to terminate the connection.\n \t\t\t */\n-\t\t\tif (!keys.argc)\n+\t\t\tif (!keys.nr)\n \t\t\t\treturn 1;\n \n \t\t\t/*\ndiff --git a/strvec.c b/strvec.c\nindex 9e76ab9295..0e17597f80 100644\n--- a/strvec.c\n+++ b/strvec.c\n@@ -6,25 +6,25 @@ const char *empty_strvec[] = { NULL };\n \n void strvec_init(struct strvec *array)\n {\n-\tarray->argv = empty_strvec;\n-\tarray->argc = 0;\n+\tarray->items = empty_strvec;\n+\tarray->nr = 0;\n \tarray->alloc = 0;\n }\n \n static void strvec_push_nodup(struct strvec *array, const char *value)\n {\n-\tif (array->argv == empty_strvec)\n-\t\tarray->argv = NULL;\n+\tif (array->items == empty_strvec)\n+\t\tarray->items = NULL;\n \n-\tALLOC_GROW(array->argv, array->argc + 2, array->alloc);\n-\tarray->argv[array->argc++] = value;\n-\tarray->argv[array->argc] = NULL;\n+\tALLOC_GROW(array->items, array->nr + 2, array->alloc);\n+\tarray->items[array->nr++] = value;\n+\tarray->items[array->nr] = NULL;\n }\n \n const char *strvec_push(struct strvec *array, const char *value)\n {\n \tstrvec_push_nodup(array, xstrdup(value));\n-\treturn array->argv[array->argc - 1];\n+\treturn array->items[array->nr - 1];\n }\n \n const char *strvec_pushf(struct strvec *array, const char *fmt, ...)\n@@ -37,7 +37,7 @@ const char *strvec_pushf(struct strvec *array, const char *fmt, ...)\n \tva_end(ap);\n \n \tstrvec_push_nodup(array, strbuf_detach(&v, NULL));\n-\treturn array->argv[array->argc - 1];\n+\treturn array->items[array->nr - 1];\n }\n \n void strvec_pushl(struct strvec *array, ...)\n@@ -51,19 +51,19 @@ void strvec_pushl(struct strvec *array, ...)\n \tva_end(ap);\n }\n \n-void strvec_pushv(struct strvec *array, const char **argv)\n+void strvec_pushv(struct strvec *array, const char **items)\n {\n-\tfor (; *argv; argv++)\n-\t\tstrvec_push(array, *argv);\n+\tfor (; *items; items++)\n+\t\tstrvec_push(array, *items);\n }\n \n void strvec_pop(struct strvec *array)\n {\n-\tif (!array->argc)\n+\tif (!array->nr)\n \t\treturn;\n-\tfree((char *)array->argv[array->argc - 1]);\n-\tarray->argv[array->argc - 1] = NULL;\n-\tarray->argc--;\n+\tfree((char *)array->items[array->nr - 1]);\n+\tarray->items[array->nr - 1] = NULL;\n+\tarray->nr--;\n }\n \n void strvec_split(struct strvec *array, const char *to_split)\n@@ -88,21 +88,21 @@ void strvec_split(struct strvec *array, const char *to_split)\n \n void strvec_clear(struct strvec *array)\n {\n-\tif (array->argv != empty_strvec) {\n+\tif (array->items != empty_strvec) {\n \t\tint i;\n-\t\tfor (i = 0; i < array->argc; i++)\n-\t\t\tfree((char *)array->argv[i]);\n-\t\tfree(array->argv);\n+\t\tfor (i = 0; i < array->nr; i++)\n+\t\t\tfree((char *)array->items[i]);\n+\t\tfree(array->items);\n \t}\n \tstrvec_init(array);\n }\n \n const char **strvec_detach(struct strvec *array)\n {\n-\tif (array->argv == empty_strvec)\n+\tif (array->items == empty_strvec)\n \t\treturn xcalloc(1, sizeof(const char *));\n \telse {\n-\t\tconst char **ret = array->argv;\n+\t\tconst char **ret = array->items;\n \t\tstrvec_init(array);\n \t\treturn ret;\n \t}\ndiff --git a/strvec.h b/strvec.h\nindex bd35de1ce4..fda1c81c86 100644\n--- a/strvec.h\n+++ b/strvec.h\n@@ -2,10 +2,10 @@\n #define STRVEC_H\n \n /**\n- * The argv-array API allows one to dynamically build and store\n- * NULL-terminated lists.  An argv-array maintains the invariant that the\n- * `argv` member always points to a non-NULL array, and that the array is\n- * always NULL-terminated at the element pointed to by `argv[argc]`. This\n+ * The strvec API allows one to dynamically build and store\n+ * NULL-terminated arrays of strings. A strvec maintains the invariant that the\n+ * `items` member always points to a non-NULL array, and that the array is\n+ * always NULL-terminated at the element pointed to by `items[nr]`. This\n  * makes the result suitable for passing to functions expecting to receive\n  * argv from main().\n  *\n@@ -22,15 +22,15 @@ extern const char *empty_strvec[];\n \n /**\n  * A single array. This should be initialized by assignment from\n- * `STRVEC_INIT`, or by calling `strvec_init`. The `argv`\n- * member contains the actual array; the `argc` member contains the\n+ * `STRVEC_INIT`, or by calling `strvec_init`. The `items`\n+ * member contains the actual array; the `nr` member contains the\n  * number of elements in the array, not including the terminating\n  * NULL.\n  */\n struct strvec {\n-\tconst char **argv;\n-\tsize_t argc;\n-\tsize_t alloc;\n+\tconst char **items;\n+\tint nr;\n+\tint alloc;\n };\n \n #define STRVEC_INIT { empty_strvec, 0, 0 }\n@@ -78,7 +78,7 @@ void strvec_split(struct strvec *, const char *);\n void strvec_clear(struct strvec *);\n \n /**\n- * Disconnect the `argv` member from the `strvec` struct and\n+ * Disconnect the `items` member from the `strvec` struct and\n  * return it. The caller is responsible for freeing the memory used\n  * by the array, and by the strings it references. After detaching,\n  * the `strvec` is in a reinitialized state and can be pushed\ndiff --git a/submodule.c b/submodule.c\nindex fb96d595b0..d9bc9c4696 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -269,7 +269,7 @@ int is_submodule_active(struct repository *repo, const char *path)\n \t\t\tstrvec_push(&args, item->string);\n \t\t}\n \n-\t\tparse_pathspec(&ps, 0, 0, NULL, args.argv);\n+\t\tparse_pathspec(&ps, 0, 0, NULL, args.items);\n \t\tret = match_pathspec(repo->index, &ps, path, strlen(path), 0, NULL, 1);\n \n \t\tstrvec_clear(&args);\n@@ -842,7 +842,7 @@ static void collect_changed_submodules(struct repository *r,\n \tconst struct commit *commit;\n \n \trepo_init_revisions(r, &rev, NULL);\n-\tsetup_revisions(argv->argc, argv->argv, &rev, NULL);\n+\tsetup_revisions(argv->nr, argv->items, &rev, NULL);\n \tif (prepare_revision_walk(&rev))\n \t\tdie(_(\"revision walk setup failed\"));\n \n@@ -1014,7 +1014,7 @@ int find_unpushed_submodules(struct repository *r,\n \tstruct string_list_item *name;\n \tstruct strvec argv = STRVEC_INIT;\n \n-\t/* argv.argv[0] will be ignored by setup_revisions */\n+\t/* argv.items[0] will be ignored by setup_revisions */\n \tstrvec_push(&argv, \"find_unpushed_submodules\");\n \toid_array_for_each_unique(commits, append_oid_to_argv, &argv);\n \tstrvec_push(&argv, \"--not\");\n@@ -1453,7 +1453,7 @@ static int get_next_submodule(struct child_process *cp,\n \t\t\t\tstrbuf_addf(err, _(\"Fetching submodule %s%s\\n\"),\n \t\t\t\t\t    spf->prefix, ce->name);\n \t\t\tstrvec_init(&cp->args);\n-\t\t\tstrvec_pushv(&cp->args, spf->args.argv);\n+\t\t\tstrvec_pushv(&cp->args, spf->args.items);\n \t\t\tstrvec_push(&cp->args, default_argv);\n \t\t\tstrvec_push(&cp->args, \"--submodule-prefix\");\n \n@@ -1501,7 +1501,7 @@ static int get_next_submodule(struct child_process *cp,\n \t\tcp->dir = task->repo->gitdir;\n \n \t\tstrvec_init(&cp->args);\n-\t\tstrvec_pushv(&cp->args, spf->args.argv);\n+\t\tstrvec_pushv(&cp->args, spf->args.items);\n \t\tstrvec_push(&cp->args, \"on-demand\");\n \t\tstrvec_push(&cp->args, \"--submodule-prefix\");\n \t\tstrvec_push(&cp->args, submodule_prefix.buf);\n@@ -1619,8 +1619,8 @@ int fetch_populated_submodules(struct repository *r,\n \t\tdie(_(\"index file corrupt\"));\n \n \tstrvec_push(&spf.args, \"fetch\");\n-\tfor (i = 0; i < options->argc; i++)\n-\t\tstrvec_push(&spf.args, options->argv[i]);\n+\tfor (i = 0; i < options->nr; i++)\n+\t\tstrvec_push(&spf.args, options->items[i]);\n \tstrvec_push(&spf.args, \"--recurse-submodules-default\");\n \t/* default value, \"--submodule-prefix\" and its value are added later */\n \ndiff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c\nindex 726835fcc2..605135be42 100644\n--- a/t/helper/test-run-command.c\n+++ b/t/helper/test-run-command.c\n@@ -248,7 +248,7 @@ static int quote_stress_test(int argc, const char **argv)\n \t\telse\n \t\t\tstrvec_pushl(&args, \"test-tool\", \"run-command\",\n \t\t\t\t     \"quote-echo\", NULL);\n-\t\targ_offset = args.argc;\n+\t\targ_offset = args.nr;\n \n \t\tif (argc > 0) {\n \t\t\ttrials = 1;\n@@ -275,13 +275,13 @@ static int quote_stress_test(int argc, const char **argv)\n \t\tif (i < skip)\n \t\t\tcontinue;\n \n-\t\tcp.argv = args.argv;\n+\t\tcp.argv = args.items;\n \t\tstrbuf_reset(&out);\n \t\tif (pipe_command(&cp, NULL, 0, &out, 0, NULL, 0) < 0)\n \t\t\treturn error(\"Failed to spawn child process\");\n \n \t\tfor (j = 0, k = 0; j < arg_count; j++) {\n-\t\t\tconst char *arg = args.argv[j + arg_offset];\n+\t\t\tconst char *arg = args.items[j + arg_offset];\n \n \t\t\tif (strcmp(arg, out.buf + k))\n \t\t\t\tret = error(\"incorrectly quoted arg: '%s', \"\n@@ -298,7 +298,7 @@ static int quote_stress_test(int argc, const char **argv)\n \t\t\tfprintf(stderr, \"Trial #%d failed. Arguments:\\n\", i);\n \t\t\tfor (j = 0; j < arg_count; j++)\n \t\t\t\tfprintf(stderr, \"arg #%d: '%s'\\n\",\n-\t\t\t\t\t(int)j, args.argv[j + arg_offset]);\n+\t\t\t\t\t(int)j, args.items[j + arg_offset]);\n \n \t\t\tstrbuf_release(&out);\n \t\t\tstrvec_clear(&args);\ndiff --git a/tmp-objdir.c b/tmp-objdir.c\nindex e78e481d8e..e21bef6cca 100644\n--- a/tmp-objdir.c\n+++ b/tmp-objdir.c\n@@ -283,7 +283,7 @@ const char **tmp_objdir_env(const struct tmp_objdir *t)\n {\n \tif (!t)\n \t\treturn NULL;\n-\treturn t->env.argv;\n+\treturn t->env.items;\n }\n \n void tmp_objdir_add_as_alternate(const struct tmp_objdir *t)\ndiff --git a/transport-helper.c b/transport-helper.c\nindex ae8011e9d5..8abdf09faa 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -138,7 +138,7 @@ static struct child_process *get_helper(struct transport *transport)\n \t\tstrvec_pushf(&helper->env_array, \"%s=%s\",\n \t\t\t     GIT_DIR_ENVIRONMENT, get_git_dir());\n \n-\thelper->trace2_child_class = helper->args.argv[0]; /* \"remote-<name>\" */\n+\thelper->trace2_child_class = helper->args.items[0]; /* \"remote-<name>\" */\n \n \tcode = start_command(helper);\n \tif (code < 0 && errno == ENOENT)\ndiff --git a/upload-pack.c b/upload-pack.c\nindex 4a7918e04e..5783e23dcb 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -897,7 +897,7 @@ static int send_shallow_list(struct upload_pack_data *data)\n \t\t\tstruct object *o = data->want_obj.objects[i].item;\n \t\t\tstrvec_push(&av, oid_to_hex(&o->oid));\n \t\t}\n-\t\tdeepen_by_rev_list(data, av.argc, av.argv);\n+\t\tdeepen_by_rev_list(data, av.nr, av.items);\n \t\tstrvec_clear(&av);\n \t\tret = 1;\n \t} else {\n-- \n2.28.0.rc2.475.g53c7e1c7f4\n"},{"id":"402249","messageId":"xmqqr1svcpcn.fsf@gitster.c.googlers.com","threadId":"53940","inReplyTo":"20200728202823.GK1021513@coredump.intra.peff.net","subject":"Re: [PATCH 11/11] strvec: rename struct fields","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-07-28T21:16:24Z","receivedAt":"2020-07-28T21:16:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> The \"argc\" and \"argv\" names made sense when the struct was argv_array,\n> but now they're just confusing. Let's rename them to our usual \"nr\" and\n> \"items\" (which we use for string_list, as well as many ALLOC_GROW()\n> arrays).\n>\n> Note that we have to update all of the callers immediately. Playing\n> tricks with the preprocessor is hard here, because we wouldn't want to\n> rewrite unrelated tokens.\n>\n> Signed-off-by: Jeff King <peff@peff.net>\n> ---\n> I'm actually not that fond of \"items\". I almost went with just:\n>\n>   const char **v;\n>\n> as the variable name which contains it usually provides sufficient\n> context. But I worried that people would consider that too inscrutable.\n\nI'd agree that v[] is a good name.  If it is too short, I can live\nwith item[], but not with items[].  Clearly we are mostly accessing\none element at a time much more often than treating the set as a\nwhole, so signaling \"there are multiple things in the set\" with\na plural name is much less important than being able to say item[4]\nto name the 4th item in the collection.\n\n\n"},{"id":"402251","messageId":"xmqqmu3jcp9u.fsf@gitster.c.googlers.com","threadId":"53940","inReplyTo":"xmqqr1svcpcn.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 11/11] strvec: rename struct fields","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-07-28T21:18:05Z","receivedAt":"2020-07-28T21:18:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> I'm actually not that fond of \"items\". I almost went with just:\n>>\n>>   const char **v;\n>>\n>> as the variable name which contains it usually provides sufficient\n>> context. But I worried that people would consider that too inscrutable.\n>\n> I'd agree that v[] is a good name.  If it is too short, I can live\n> with item[], but not with items[]....\n\nWhat are individual component of a vector called?  An element?  If\nso, elem[] would be much better name than item[].\n\n"},{"id":"402250","messageId":"20200728212008.GA1621333@coredump.intra.peff.net","threadId":"53940","inReplyTo":"xmqqr1svcpcn.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 11/11] strvec: rename struct fields","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-28T21:20:08Z","receivedAt":"2020-07-28T21:20:10Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jul 28, 2020 at 02:16:24PM -0700, Junio C Hamano wrote:\n\n> > I'm actually not that fond of \"items\". I almost went with just:\n> >\n> >   const char **v;\n> >\n> > as the variable name which contains it usually provides sufficient\n> > context. But I worried that people would consider that too inscrutable.\n> \n> I'd agree that v[] is a good name.  If it is too short, I can live\n> with item[], but not with items[].  Clearly we are mostly accessing\n> one element at a time much more often than treating the set as a\n> whole, so signaling \"there are multiple things in the set\" with\n> a plural name is much less important than being able to say item[4]\n> to name the 4th item in the collection.\n\nI'd worry that \"item\" versus string_list \"items\" would be unfriendly\n(though I am not opposed to changing string_list to match).\n\nYour \"elem\" suggestion from elsewhere may be better still, but if you\nare OK with \"v\",  that is my preference. I'll see if anybody else chimes\nin, but if not, then I'd probably switch to that. :)\n\n-Peff\n"},{"id":"402262","messageId":"xmqq5za7cm8e.fsf@gitster.c.googlers.com","threadId":"53940","inReplyTo":"20200728202709.GJ1021513@coredump.intra.peff.net","subject":"Re: [PATCH 10/11] strvec: drop argv_array compatibility layer","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-07-28T22:23:45Z","receivedAt":"2020-07-28T22:23:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> There are no callers which need it anymore. Any topics in flight will\n> need to be updated as they get merged in (but the compiler will make\n> that quite clear).\n>\n> Signed-off-by: Jeff King <peff@peff.net>\n> ---\n>  strvec.h | 13 -------------\n>  1 file changed, 13 deletions(-)\n>\n> diff --git a/strvec.h b/strvec.h\n> index 4be39c8a48..bd35de1ce4 100644\n> --- a/strvec.h\n> +++ b/strvec.h\n> @@ -86,17 +86,4 @@ void strvec_clear(struct strvec *);\n>   */\n>  const char **strvec_detach(struct strvec *);\n>  \n> -/* compatibility for historic argv_array interface */\n> -#define argv_array strvec\n> -#define ARGV_ARRAY_INIT STRVEC_INIT\n> -#define argv_array_init strvec_init\n> -#define argv_array_push strvec_push\n> -#define argv_array_pushf strvec_pushf\n> -#define argv_array_pushl strvec_pushl\n> -#define argv_array_pushv strvec_pushv\n> -#define argv_array_pop strvec_pop\n> -#define argv_array_split strvec_split\n> -#define argv_array_clear strvec_clear\n> -#define argv_array_detach strvec_detach\n> -\n>  #endif /* STRVEC_H */\n\nIt was more painful than I would have thought to merge this topic,\nas we seem to have gained quite a few new calling sites (it shows\nhow popular and useful this API is).  Hopefully some of the merge\nconflict resolutions would be resurrected automatically from the\nrerere database ;-)\n\n"},{"id":"402264","messageId":"CA+P7+xq08K3MNn7jLoVS8Sqnj79yOSqnXeXU6uob=SKJYKmBxg@mail.gmail.com","threadId":"53940","inReplyTo":"20200728202631.GH1021513@coredump.intra.peff.net","subject":"Re: [PATCH 08/11] strvec: fix indentation in renamed calls","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2020-07-28T22:43:59Z","receivedAt":"2020-07-28T22:44:14Z","isPatch":true,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Tue, Jul 28, 2020 at 1:29 PM Jeff King <peff@peff.net> wrote:\n> Let's fix these up to align the arguments with the opening paren. I did\n> this manually by sifting through the results of:\n>\n>   git jump grep 'strvec_.*,$'\n>\n\nI haven't seen this before. Some sort of alias that lets you open each\ngrep spot in an editor?\n"},{"id":"402265","messageId":"CA+P7+xqrV7yvQ2XihDnjuuT5Ro0_qvb4WS6tNH2GGn5DQzoLNw@mail.gmail.com","threadId":"53940","inReplyTo":"20200728202124.GA1021264@coredump.intra.peff.net","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2020-07-28T22:45:08Z","receivedAt":"2020-07-28T22:45:22Z","isPatch":true,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Tue, Jul 28, 2020 at 1:25 PM Jeff King <peff@peff.net> wrote:\n>\n> The argv_array data type has turned out to be useful in our code base,\n> but the name isn't very good. From patch 2 of this series:\n>\n>   The name \"argv-array\" isn't very good, because it describes what the\n>   data type can be used for (program argument arrays), not what it\n>   actually is (a dynamically-growing string array that maintains a\n>   NULL-terminator invariant). This leads to people being hesitant to use\n>   it for other cases where it would actually be a good fit. The existing\n>   name is also clunky to use. It's overly long, and the name often leads\n>   to saying things like \"argv.argv\" (i.e., the field names overlap with\n>   variable names, since they're describing the use, not the type). Let's\n>   give it a more neutral name.\n>\n> This has bugged me for a while, so I decided to finally fix it. It\n> wasn't _too_ painful, though I'm sure there will be a little fallout\n> with topics in flight.\n>\n> I tried to split out the mechanical bits into their own patches to make\n> reviewing easier. Patches 5-7 really could be a single patch, but\n> they're too big for the mailing list. I'm OK to leave them separate, or\n> they could be squashed together.\n>\n> We could stop at patch 9 for now and allow topics in flight to catch up\n> before removing the compat layers. But the struct field renaming has to\n> happen as a single step, so it will be a pain whenever we do it. If\n> we're going to go this route, I'd just as soon do it all now and deal\n> with other topics as they get merged.\n>\n>   [01/11]: argv-array: use size_t for count and alloc\n>   [02/11]: argv-array: rename to strvec\n>   [03/11]: strvec: rename files from argv-array to strvec\n>   [04/11]: quote: rename sq_dequote_to_argv_array to mention strvec\n>   [05/11]: strvec: convert builtin/ callers away from argv_array name\n>   [06/11]: strvec: convert more callers away from argv_array name\n>   [07/11]: strvec: convert remaining callers away from argv_array name\n>   [08/11]: strvec: fix indentation in renamed calls\n>   [09/11]: strvec: update documention to avoid argv_array\n>   [10/11]: strvec: drop argv_array compatibility layer\n>   [11/11]: strvec: rename struct fields\n>\n\nI like this. It definitely helps to name the API after what it does.\n\nOne thing I thought I would see but I guess we simply don't have one\nis a technical doc that details the strvec. I guess we just never had\none for argv_array? Probably worth adding one at some point.\n\nThanks,\nJake\n"},{"id":"402268","messageId":"xmqqwo2nb4it.fsf@gitster.c.googlers.com","threadId":"53940","inReplyTo":"CA+P7+xq08K3MNn7jLoVS8Sqnj79yOSqnXeXU6uob=SKJYKmBxg@mail.gmail.com","subject":"Re: [PATCH 08/11] strvec: fix indentation in renamed calls","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-07-28T23:31:38Z","receivedAt":"2020-07-28T23:31:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jacob Keller <jacob.keller@gmail.com> writes:\n\n> On Tue, Jul 28, 2020 at 1:29 PM Jeff King <peff@peff.net> wrote:\n>> Let's fix these up to align the arguments with the opening paren. I did\n>> this manually by sifting through the results of:\n>>\n>>   git jump grep 'strvec_.*,$'\n>>\n>\n> I haven't seen this before. Some sort of alias that lets you open each\n> grep spot in an editor?\n\nin contrib/\n"},{"id":"402309","messageId":"20200729000430.GA1623001@coredump.intra.peff.net","threadId":"53940","inReplyTo":"xmqq5za7cm8e.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 10/11] strvec: drop argv_array compatibility layer","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-29T00:04:30Z","receivedAt":"2020-07-29T00:04:33Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jul 28, 2020 at 03:23:45PM -0700, Junio C Hamano wrote:\n\n> It was more painful than I would have thought to merge this topic,\n> as we seem to have gained quite a few new calling sites (it shows\n> how popular and useful this API is).  Hopefully some of the merge\n> conflict resolutions would be resurrected automatically from the\n> rerere database ;-)\n\nI'm not too surprised; it made a little chaos with my personal topics,\ntoo. I'm happy to help with resolutions, but it looks like you've\nalready merged it to \"seen\", which means the worst of it is mostly over.\n\nI did specifically wait on it until until after a release, but I think\nwe pretty much always have topics in flight these days. There is no\nquiet time. :)\n\nIf I swap out the final patch with \"s/items/v/\" that may cause a\n_little_ more trouble, but perhaps not quite as much (only some of the\nsites access the fields directly).\n\n-Peff\n"},{"id":"402310","messageId":"20200729000628.GB1623001@coredump.intra.peff.net","threadId":"53940","inReplyTo":"CA+P7+xqrV7yvQ2XihDnjuuT5Ro0_qvb4WS6tNH2GGn5DQzoLNw@mail.gmail.com","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-29T00:06:28Z","receivedAt":"2020-07-29T00:06:31Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jul 28, 2020 at 03:45:08PM -0700, Jacob Keller wrote:\n\n> One thing I thought I would see but I guess we simply don't have one\n> is a technical doc that details the strvec. I guess we just never had\n> one for argv_array? Probably worth adding one at some point.\n\nIt all got moved into the header file in 971b1f24a2 (argv-array: move\ndoc to argv-array.h, 2019-11-17). It got the same s/argv_array/strvec/\nas the code in patch 2. I think what's there is pretty reasonable, but\npatches welcome if you have suggestions about what could be added. :)\n\n-Peff\n"},{"id":"402312","messageId":"20200729003720.GA1653374@coredump.intra.peff.net","threadId":"53940","inReplyTo":"20200729000430.GA1623001@coredump.intra.peff.net","subject":"Re: [PATCH 10/11] strvec: drop argv_array compatibility layer","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-29T00:37:20Z","receivedAt":"2020-07-29T00:37:28Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jul 28, 2020 at 08:04:31PM -0400, Jeff King wrote:\n\n> On Tue, Jul 28, 2020 at 03:23:45PM -0700, Junio C Hamano wrote:\n> \n> > It was more painful than I would have thought to merge this topic,\n> > as we seem to have gained quite a few new calling sites (it shows\n> > how popular and useful this API is).  Hopefully some of the merge\n> > conflict resolutions would be resurrected automatically from the\n> > rerere database ;-)\n> \n> I'm not too surprised; it made a little chaos with my personal topics,\n> too. I'm happy to help with resolutions, but it looks like you've\n> already merged it to \"seen\", which means the worst of it is mostly over.\n\nWorse than the resolutions are all the new calls which needed to be\nfixed up. I know your scripts keep a fix-up commit for this, but I don't\nthink you publish it. :) I repeated the process as a cross-check and got\na byte-for-byte identical result to what you have at the tip of \"seen\".\n\n> If I swap out the final patch with \"s/items/v/\" that may cause a\n> _little_ more trouble, but perhaps not quite as much (only some of the\n> sites access the fields directly).\n\nHere's the \"v\" version, which can replace the top patch. I'll follow-up\nwith some notes on merging to \"seen\".\n\n-- >8 --\nSubject: [PATCH] strvec: rename struct fields\n\nThe \"argc\" and \"argv\" names made sense when the struct was argv_array,\nbut now they're just confusing. Let's rename them to \"nr\" (which we use\nfor counts elsewhere) and \"v\" (which is rather terse, but reads well\nwhen combined with typical variable names like \"args.v\").\n\nNote that we have to update all of the callers immediately. Playing\ntricks with the preprocessor is hard here, because we wouldn't want to\nrewrite unrelated tokens.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n add-interactive.c           |  4 ++--\n add-patch.c                 |  8 +++----\n bisect.c                    |  2 +-\n builtin/add.c               |  2 +-\n builtin/am.c                | 16 +++++++-------\n builtin/annotate.c          |  2 +-\n builtin/bisect--helper.c    |  4 ++--\n builtin/clone.c             |  4 ++--\n builtin/commit.c            |  2 +-\n builtin/describe.c          |  6 ++---\n builtin/difftool.c          |  2 +-\n builtin/fetch.c             |  6 ++---\n builtin/gc.c                | 24 ++++++++++----------\n builtin/pack-objects.c      |  2 +-\n builtin/pull.c              | 16 +++++++-------\n builtin/rebase.c            | 16 +++++++-------\n builtin/receive-pack.c      | 14 ++++++------\n builtin/remote.c            |  4 ++--\n builtin/replace.c           |  2 +-\n builtin/show-branch.c       |  8 +++----\n builtin/stash.c             |  8 +++----\n builtin/submodule--helper.c |  6 ++---\n builtin/upload-archive.c    |  4 ++--\n builtin/worktree.c          |  6 ++---\n bundle.c                    |  2 +-\n commit.c                    |  2 +-\n connect.c                   | 16 +++++++-------\n daemon.c                    |  8 +++----\n diff.c                      |  2 +-\n environment.c               |  2 +-\n exec-cmd.c                  |  6 ++---\n git.c                       | 10 ++++-----\n graph.c                     |  4 ++--\n http-push.c                 |  2 +-\n ls-refs.c                   |  6 ++---\n merge.c                     |  2 +-\n pathspec.c                  |  2 +-\n range-diff.c                |  2 +-\n ref-filter.c                |  4 ++--\n remote-curl.c               |  6 ++---\n remote.c                    |  2 +-\n revision.c                  |  4 ++--\n run-command.c               | 20 ++++++++---------\n sequencer.c                 |  4 ++--\n serve.c                     |  6 ++---\n strvec.c                    | 44 ++++++++++++++++++-------------------\n strvec.h                    | 20 ++++++++---------\n submodule.c                 | 14 ++++++------\n t/helper/test-run-command.c |  8 +++----\n tmp-objdir.c                |  2 +-\n transport-helper.c          |  2 +-\n upload-pack.c               |  2 +-\n 52 files changed, 186 insertions(+), 186 deletions(-)\n\ndiff --git a/add-interactive.c b/add-interactive.c\nindex 458f3a3e69..555c4abf32 100644\n--- a/add-interactive.c\n+++ b/add-interactive.c\n@@ -944,7 +944,7 @@ static int run_patch(struct add_i_state *s, const struct pathspec *ps,\n \t\t\t\t\t    files->items.items[i].string);\n \t\tparse_pathspec(&ps_selected,\n \t\t\t       PATHSPEC_ALL_MAGIC & ~PATHSPEC_LITERAL,\n-\t\t\t       PATHSPEC_LITERAL_PATH, \"\", args.argv);\n+\t\t\t       PATHSPEC_LITERAL_PATH, \"\", args.v);\n \t\tres = run_add_p(s->r, ADD_P_ADD, NULL, &ps_selected);\n \t\tstrvec_clear(&args);\n \t\tclear_pathspec(&ps_selected);\n@@ -986,7 +986,7 @@ static int run_diff(struct add_i_state *s, const struct pathspec *ps,\n \t\t\tif (files->selected[i])\n \t\t\t\tstrvec_push(&args,\n \t\t\t\t\t    files->items.items[i].string);\n-\t\tres = run_command_v_opt(args.argv, 0);\n+\t\tres = run_command_v_opt(args.v, 0);\n \t\tstrvec_clear(&args);\n \t}\n \ndiff --git a/add-patch.c b/add-patch.c\nindex 8c0772803b..0f68eb665e 100644\n--- a/add-patch.c\n+++ b/add-patch.c\n@@ -391,14 +391,14 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)\n \t\t\t    get_oid(\"HEAD\", &oid) ?\n \t\t\t    empty_tree_oid_hex() : s->revision);\n \t}\n-\tcolor_arg_index = args.argc;\n+\tcolor_arg_index = args.nr;\n \t/* Use `--no-color` explicitly, just in case `diff.color = always`. */\n \tstrvec_pushl(&args, \"--no-color\", \"-p\", \"--\", NULL);\n \tfor (i = 0; i < ps->nr; i++)\n \t\tstrvec_push(&args, ps->items[i].original);\n \n \tsetup_child_process(s, &cp, NULL);\n-\tcp.argv = args.argv;\n+\tcp.argv = args.v;\n \tres = capture_command(&cp, plain, 0);\n \tif (res) {\n \t\tstrvec_clear(&args);\n@@ -415,8 +415,8 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)\n \t\tconst char *diff_filter = s->s.interactive_diff_filter;\n \n \t\tsetup_child_process(s, &colored_cp, NULL);\n-\t\txsnprintf((char *)args.argv[color_arg_index], 8, \"--color\");\n-\t\tcolored_cp.argv = args.argv;\n+\t\txsnprintf((char *)args.v[color_arg_index], 8, \"--color\");\n+\t\tcolored_cp.argv = args.v;\n \t\tcolored = &s->colored;\n \t\tres = capture_command(&colored_cp, colored, 0);\n \t\tstrvec_clear(&args);\ndiff --git a/bisect.c b/bisect.c\nindex 99ff694960..6959fb8aad 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -649,7 +649,7 @@ static void bisect_rev_setup(struct repository *r, struct rev_info *revs,\n \tif (read_paths)\n \t\tread_bisect_paths(&rev_argv);\n \n-\tsetup_revisions(rev_argv.argc, rev_argv.argv, revs, NULL);\n+\tsetup_revisions(rev_argv.nr, rev_argv.v, revs, NULL);\n \t/* XXX leak rev_argv, as \"revs\" may still be pointing to it */\n }\n \ndiff --git a/builtin/add.c b/builtin/add.c\nindex 6185dd12a8..ab39a60a0d 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -228,7 +228,7 @@ int run_add_interactive(const char *revision, const char *patch_mode,\n \t\t/* pass original pathspec, to be re-parsed */\n \t\tstrvec_push(&argv, pathspec->items[i].original);\n \n-\tstatus = run_command_v_opt(argv.argv, RUN_GIT_CMD);\n+\tstatus = run_command_v_opt(argv.v, RUN_GIT_CMD);\n \tstrvec_clear(&argv);\n \treturn status;\n }\ndiff --git a/builtin/am.c b/builtin/am.c\nindex 992ab3ca27..dd4e6c2d9b 100644\n--- a/builtin/am.c\n+++ b/builtin/am.c\n@@ -812,7 +812,7 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths,\n \tstrbuf_release(&sb);\n \tfree(series_dir_buf);\n \n-\tret = split_mail_conv(stgit_patch_to_mail, state, patches.argv, keep_cr);\n+\tret = split_mail_conv(stgit_patch_to_mail, state, patches.v, keep_cr);\n \n \tstrvec_clear(&patches);\n \treturn ret;\n@@ -1002,7 +1002,7 @@ static void am_setup(struct am_state *state, enum patch_format patch_format,\n \t}\n \twrite_state_text(state, \"scissors\", str);\n \n-\tsq_quote_argv(&sb, state->git_apply_opts.argv);\n+\tsq_quote_argv(&sb, state->git_apply_opts.v);\n \twrite_state_text(state, \"apply-opt\", sb.buf);\n \n \tif (state->rebasing)\n@@ -1401,9 +1401,9 @@ static int run_apply(const struct am_state *state, const char *index_file)\n \t\tBUG(\"init_apply_state() failed\");\n \n \tstrvec_push(&apply_opts, \"apply\");\n-\tstrvec_pushv(&apply_opts, state->git_apply_opts.argv);\n+\tstrvec_pushv(&apply_opts, state->git_apply_opts.v);\n \n-\topts_left = apply_parse_options(apply_opts.argc, apply_opts.argv,\n+\topts_left = apply_parse_options(apply_opts.nr, apply_opts.v,\n \t\t\t\t\t&apply_state, &force_apply, &options,\n \t\t\t\t\tNULL);\n \n@@ -1428,7 +1428,7 @@ static int run_apply(const struct am_state *state, const char *index_file)\n \n \tstrvec_push(&apply_paths, am_path(state, \"patch\"));\n \n-\tres = apply_all_patches(&apply_state, apply_paths.argc, apply_paths.argv, options);\n+\tres = apply_all_patches(&apply_state, apply_paths.nr, apply_paths.v, options);\n \n \tstrvec_clear(&apply_paths);\n \tstrvec_clear(&apply_opts);\n@@ -1455,7 +1455,7 @@ static int build_fake_ancestor(const struct am_state *state, const char *index_f\n \n \tcp.git_cmd = 1;\n \tstrvec_push(&cp.args, \"apply\");\n-\tstrvec_pushv(&cp.args, state->git_apply_opts.argv);\n+\tstrvec_pushv(&cp.args, state->git_apply_opts.v);\n \tstrvec_pushf(&cp.args, \"--build-fake-ancestor=%s\", index_file);\n \tstrvec_push(&cp.args, am_path(state, \"patch\"));\n \n@@ -2376,10 +2376,10 @@ int cmd_am(int argc, const char **argv, const char *prefix)\n \t\t\t\tstrvec_push(&paths, mkpath(\"%s/%s\", prefix, argv[i]));\n \t\t}\n \n-\t\tif (state.interactive && !paths.argc)\n+\t\tif (state.interactive && !paths.nr)\n \t\t\tdie(_(\"interactive mode requires patches on the command line\"));\n \n-\t\tam_setup(&state, patch_format, paths.argv, keep_cr);\n+\t\tam_setup(&state, patch_format, paths.v, keep_cr);\n \n \t\tstrvec_clear(&paths);\n \t}\ndiff --git a/builtin/annotate.c b/builtin/annotate.c\nindex 7b7ecd366d..58ff977a23 100644\n--- a/builtin/annotate.c\n+++ b/builtin/annotate.c\n@@ -18,5 +18,5 @@ int cmd_annotate(int argc, const char **argv, const char *prefix)\n \t\tstrvec_push(&args, argv[i]);\n \t}\n \n-\treturn cmd_blame(args.argc, args.argv, prefix);\n+\treturn cmd_blame(args.nr, args.v, prefix);\n }\ndiff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c\nindex dd52878413..b46de0489e 100644\n--- a/builtin/bisect--helper.c\n+++ b/builtin/bisect--helper.c\n@@ -168,7 +168,7 @@ static int bisect_reset(const char *commit)\n \t\tstruct strvec argv = STRVEC_INIT;\n \n \t\tstrvec_pushl(&argv, \"checkout\", branch.buf, \"--\", NULL);\n-\t\tif (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {\n+\t\tif (run_command_v_opt(argv.v, RUN_GIT_CMD)) {\n \t\t\terror(_(\"could not check out original\"\n \t\t\t\t\" HEAD '%s'. Try 'git bisect\"\n \t\t\t\t\" reset <commit>'.\"), branch.buf);\n@@ -530,7 +530,7 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout,\n \n \t\t\tstrvec_pushl(&argv, \"checkout\", start_head.buf,\n \t\t\t\t     \"--\", NULL);\n-\t\t\tif (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {\n+\t\t\tif (run_command_v_opt(argv.v, RUN_GIT_CMD)) {\n \t\t\t\tres = error(_(\"checking out '%s' failed.\"\n \t\t\t\t\t\t \" Try 'git bisect start \"\n \t\t\t\t\t\t \"<valid-branch>'.\"),\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex e26bd82dc4..fccc814a54 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -752,7 +752,7 @@ static int git_sparse_checkout_init(const char *repo)\n \t */\n \tcore_apply_sparse_checkout = 1;\n \n-\tif (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {\n+\tif (run_command_v_opt(argv.v, RUN_GIT_CMD)) {\n \t\terror(_(\"failed to initialize sparse-checkout\"));\n \t\tresult = 1;\n \t}\n@@ -844,7 +844,7 @@ static int checkout(int submodule_progress)\n \t\t\t\t\t       \"--single-branch\" :\n \t\t\t\t\t       \"--no-single-branch\");\n \n-\t\terr = run_command_v_opt(args.argv, RUN_GIT_CMD);\n+\t\terr = run_command_v_opt(args.v, RUN_GIT_CMD);\n \t\tstrvec_clear(&args);\n \t}\n \ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex c3f4067537..69ac78d5e5 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1008,7 +1008,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tstruct strvec env = STRVEC_INIT;\n \n \t\tstrvec_pushf(&env, \"GIT_INDEX_FILE=%s\", index_file);\n-\t\tif (launch_editor(git_path_commit_editmsg(), NULL, env.argv)) {\n+\t\tif (launch_editor(git_path_commit_editmsg(), NULL, env.v)) {\n \t\t\tfprintf(stderr,\n \t\t\t_(\"Please supply the message using either -m or -F option.\\n\"));\n \t\t\texit(1);\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex e3cac8002c..7668591d57 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -509,7 +509,7 @@ static void describe_blob(struct object_id oid, struct strbuf *dst)\n \t\t     NULL);\n \n \trepo_init_revisions(the_repository, &revs, NULL);\n-\tif (setup_revisions(args.argc, args.argv, &revs, NULL) > 1)\n+\tif (setup_revisions(args.nr, args.v, &revs, NULL) > 1)\n \t\tBUG(\"setup_revisions could not handle all args?\");\n \n \tif (prepare_revision_walk(&revs))\n@@ -613,7 +613,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \t\t\tstrvec_pushv(&args, argv);\n \t\telse\n \t\t\tstrvec_push(&args, \"HEAD\");\n-\t\treturn cmd_name_rev(args.argc, args.argv, prefix);\n+\t\treturn cmd_name_rev(args.nr, args.v, prefix);\n \t}\n \n \thashmap_init(&names, commit_name_neq, NULL, 0);\n@@ -659,7 +659,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \n \t\t\trepo_init_revisions(the_repository, &revs, prefix);\n \t\t\tstrvec_pushv(&args, diff_index_args);\n-\t\t\tif (setup_revisions(args.argc, args.argv, &revs, NULL) != 1)\n+\t\t\tif (setup_revisions(args.nr, args.v, &revs, NULL) != 1)\n \t\t\t\tBUG(\"malformed internal diff-index command line\");\n \t\t\tresult = run_diff_index(&revs, 0);\n \ndiff --git a/builtin/difftool.c b/builtin/difftool.c\nindex 5ac021a1d4..7ac432b881 100644\n--- a/builtin/difftool.c\n+++ b/builtin/difftool.c\n@@ -683,7 +683,7 @@ static int run_file_diff(int prompt, const char *prefix,\n \tstrvec_push(&args, \"diff\");\n \tfor (i = 0; i < argc; i++)\n \t\tstrvec_push(&args, argv[i]);\n-\tret = run_command_v_opt_cd_env(args.argv, RUN_GIT_CMD, prefix, env);\n+\tret = run_command_v_opt_cd_env(args.v, RUN_GIT_CMD, prefix, env);\n \texit(ret);\n }\n \ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex c2e7afeb6a..c49f0e9752 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -1354,7 +1354,7 @@ static int do_fetch(struct transport *transport,\n \n \tif (tags == TAGS_SET || tags == TAGS_DEFAULT) {\n \t\tmust_list_refs = 1;\n-\t\tif (ref_prefixes.argc)\n+\t\tif (ref_prefixes.nr)\n \t\t\tstrvec_push(&ref_prefixes, \"refs/tags/\");\n \t}\n \n@@ -1605,7 +1605,7 @@ static int fetch_multiple(struct string_list *list, int max_children)\n \tadd_options_to_argv(&argv);\n \n \tif (max_children != 1 && list->nr != 1) {\n-\t\tstruct parallel_fetch_state state = { argv.argv, list, 0, 0 };\n+\t\tstruct parallel_fetch_state state = { argv.v, list, 0, 0 };\n \n \t\tstrvec_push(&argv, \"--end-of-options\");\n \t\tresult = run_processes_parallel_tr2(max_children,\n@@ -1623,7 +1623,7 @@ static int fetch_multiple(struct string_list *list, int max_children)\n \t\t\tstrvec_push(&argv, name);\n \t\t\tif (verbosity >= 0)\n \t\t\t\tprintf(_(\"Fetching %s\\n\"), name);\n-\t\t\tif (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {\n+\t\t\tif (run_command_v_opt(argv.v, RUN_GIT_CMD)) {\n \t\t\t\terror(_(\"Could not fetch %s\"), name);\n \t\t\t\tresult = 1;\n \t\t\t}\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 98719800a3..aafa0946f5 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -514,11 +514,11 @@ static void gc_before_repack(void)\n \tif (done++)\n \t\treturn;\n \n-\tif (pack_refs && run_command_v_opt(pack_refs_cmd.argv, RUN_GIT_CMD))\n-\t\tdie(FAILED_RUN, pack_refs_cmd.argv[0]);\n+\tif (pack_refs && run_command_v_opt(pack_refs_cmd.v, RUN_GIT_CMD))\n+\t\tdie(FAILED_RUN, pack_refs_cmd.v[0]);\n \n-\tif (prune_reflogs && run_command_v_opt(reflog.argv, RUN_GIT_CMD))\n-\t\tdie(FAILED_RUN, reflog.argv[0]);\n+\tif (prune_reflogs && run_command_v_opt(reflog.v, RUN_GIT_CMD))\n+\t\tdie(FAILED_RUN, reflog.v[0]);\n }\n \n int cmd_gc(int argc, const char **argv, const char *prefix)\n@@ -653,8 +653,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \n \tif (!repository_format_precious_objects) {\n \t\tclose_object_store(the_repository->objects);\n-\t\tif (run_command_v_opt(repack.argv, RUN_GIT_CMD))\n-\t\t\tdie(FAILED_RUN, repack.argv[0]);\n+\t\tif (run_command_v_opt(repack.v, RUN_GIT_CMD))\n+\t\t\tdie(FAILED_RUN, repack.v[0]);\n \n \t\tif (prune_expire) {\n \t\t\tstrvec_push(&prune, prune_expire);\n@@ -663,19 +663,19 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \t\t\tif (has_promisor_remote())\n \t\t\t\tstrvec_push(&prune,\n \t\t\t\t\t    \"--exclude-promisor-objects\");\n-\t\t\tif (run_command_v_opt(prune.argv, RUN_GIT_CMD))\n-\t\t\t\tdie(FAILED_RUN, prune.argv[0]);\n+\t\t\tif (run_command_v_opt(prune.v, RUN_GIT_CMD))\n+\t\t\t\tdie(FAILED_RUN, prune.v[0]);\n \t\t}\n \t}\n \n \tif (prune_worktrees_expire) {\n \t\tstrvec_push(&prune_worktrees, prune_worktrees_expire);\n-\t\tif (run_command_v_opt(prune_worktrees.argv, RUN_GIT_CMD))\n-\t\t\tdie(FAILED_RUN, prune_worktrees.argv[0]);\n+\t\tif (run_command_v_opt(prune_worktrees.v, RUN_GIT_CMD))\n+\t\t\tdie(FAILED_RUN, prune_worktrees.v[0]);\n \t}\n \n-\tif (run_command_v_opt(rerere.argv, RUN_GIT_CMD))\n-\t\tdie(FAILED_RUN, rerere.argv[0]);\n+\tif (run_command_v_opt(rerere.v, RUN_GIT_CMD))\n+\t\tdie(FAILED_RUN, rerere.v[0]);\n \n \treport_garbage = report_pack_garbage;\n \treprepare_packed_git(the_repository);\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 323f8bce80..f00ae80796 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -3704,7 +3704,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)\n \tif (!use_internal_rev_list)\n \t\tread_object_list_from_stdin();\n \telse {\n-\t\tget_object_list(rp.argc, rp.argv);\n+\t\tget_object_list(rp.nr, rp.v);\n \t\tstrvec_clear(&rp);\n \t}\n \tcleanup_preferred_base();\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex dae8766646..015f6ded0b 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -584,14 +584,14 @@ static int run_fetch(const char *repo, const char **refspecs)\n \t\tstrvec_push(&args, \"--no-show-forced-updates\");\n \tif (set_upstream)\n \t\tstrvec_push(&args, set_upstream);\n-\tstrvec_pushv(&args, opt_fetch.argv);\n+\tstrvec_pushv(&args, opt_fetch.v);\n \n \tif (repo) {\n \t\tstrvec_push(&args, repo);\n \t\tstrvec_pushv(&args, refspecs);\n \t} else if (*refspecs)\n \t\tBUG(\"refspecs without repo?\");\n-\tret = run_command_v_opt(args.argv, RUN_GIT_CMD);\n+\tret = run_command_v_opt(args.v, RUN_GIT_CMD);\n \tstrvec_clear(&args);\n \treturn ret;\n }\n@@ -691,8 +691,8 @@ static int run_merge(void)\n \t\tstrvec_push(&args, opt_ff);\n \tif (opt_verify_signatures)\n \t\tstrvec_push(&args, opt_verify_signatures);\n-\tstrvec_pushv(&args, opt_strategies.argv);\n-\tstrvec_pushv(&args, opt_strategy_opts.argv);\n+\tstrvec_pushv(&args, opt_strategies.v);\n+\tstrvec_pushv(&args, opt_strategy_opts.v);\n \tif (opt_gpg_sign)\n \t\tstrvec_push(&args, opt_gpg_sign);\n \tif (opt_autostash == 0)\n@@ -703,7 +703,7 @@ static int run_merge(void)\n \t\tstrvec_push(&args, \"--allow-unrelated-histories\");\n \n \tstrvec_push(&args, \"FETCH_HEAD\");\n-\tret = run_command_v_opt(args.argv, RUN_GIT_CMD);\n+\tret = run_command_v_opt(args.v, RUN_GIT_CMD);\n \tstrvec_clear(&args);\n \treturn ret;\n }\n@@ -882,8 +882,8 @@ static int run_rebase(const struct object_id *curr_head,\n \t\tstrvec_push(&args, \"--interactive\");\n \tif (opt_diffstat)\n \t\tstrvec_push(&args, opt_diffstat);\n-\tstrvec_pushv(&args, opt_strategies.argv);\n-\tstrvec_pushv(&args, opt_strategy_opts.argv);\n+\tstrvec_pushv(&args, opt_strategies.v);\n+\tstrvec_pushv(&args, opt_strategy_opts.v);\n \tif (opt_gpg_sign)\n \t\tstrvec_push(&args, opt_gpg_sign);\n \tif (opt_autostash == 0)\n@@ -902,7 +902,7 @@ static int run_rebase(const struct object_id *curr_head,\n \telse\n \t\tstrvec_push(&args, oid_to_hex(merge_head));\n \n-\tret = run_command_v_opt(args.argv, RUN_GIT_CMD);\n+\tret = run_command_v_opt(args.v, RUN_GIT_CMD);\n \tstrvec_clear(&args);\n \treturn ret;\n }\ndiff --git a/builtin/rebase.c b/builtin/rebase.c\nindex 35aeb8effc..dadb52fa92 100644\n--- a/builtin/rebase.c\n+++ b/builtin/rebase.c\n@@ -351,7 +351,7 @@ static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)\n \t\t\t     oid_to_hex(&opts->restrict_revision->object.oid));\n \n \tret = sequencer_make_script(the_repository, &todo_list.buf,\n-\t\t\t\t    make_script_args.argc, make_script_args.argv,\n+\t\t\t\t    make_script_args.nr, make_script_args.v,\n \t\t\t\t    flags);\n \n \tif (ret)\n@@ -900,7 +900,7 @@ static int run_am(struct rebase_options *opts)\n \t\treturn status;\n \t}\n \n-\tstrvec_pushv(&am.args, opts->git_am_opts.argv);\n+\tstrvec_pushv(&am.args, opts->git_am_opts.v);\n \tstrvec_push(&am.args, \"--rebasing\");\n \tstrvec_pushf(&am.args, \"--resolvemsg=%s\", resolvemsg);\n \tstrvec_push(&am.args, \"--patch-format=mboxrd\");\n@@ -969,7 +969,7 @@ static int run_specific_rebase(struct rebase_options *opts, enum action action)\n \tadd_var(&script_snippet, \"revisions\", opts->revisions);\n \tadd_var(&script_snippet, \"restrict_revision\", opts->restrict_revision ?\n \t\toid_to_hex(&opts->restrict_revision->object.oid) : NULL);\n-\tsq_quote_argv_pretty(&buf, opts->git_am_opts.argv);\n+\tsq_quote_argv_pretty(&buf, opts->git_am_opts.v);\n \tadd_var(&script_snippet, \"git_am_opt\", buf.buf);\n \tstrbuf_release(&buf);\n \tadd_var(&script_snippet, \"verbose\",\n@@ -1625,8 +1625,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)\n \t\tallow_preemptive_ff = 0;\n \t}\n \n-\tfor (i = 0; i < options.git_am_opts.argc; i++) {\n-\t\tconst char *option = options.git_am_opts.argv[i], *p;\n+\tfor (i = 0; i < options.git_am_opts.nr; i++) {\n+\t\tconst char *option = options.git_am_opts.v[i], *p;\n \t\tif (!strcmp(option, \"--committer-date-is-author-date\") ||\n \t\t    !strcmp(option, \"--ignore-date\") ||\n \t\t    !strcmp(option, \"--whitespace=fix\") ||\n@@ -1721,10 +1721,10 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)\n \tif (isatty(2) && options.flags & REBASE_NO_QUIET)\n \t\tstrbuf_addstr(&options.git_format_patch_opt, \" --progress\");\n \n-\tif (options.git_am_opts.argc || options.type == REBASE_APPLY) {\n+\tif (options.git_am_opts.nr || options.type == REBASE_APPLY) {\n \t\t/* all am options except -q are compatible only with --apply */\n-\t\tfor (i = options.git_am_opts.argc - 1; i >= 0; i--)\n-\t\t\tif (strcmp(options.git_am_opts.argv[i], \"-q\"))\n+\t\tfor (i = options.git_am_opts.nr - 1; i >= 0; i--)\n+\t\t\tif (strcmp(options.git_am_opts.v[i], \"-q\"))\n \t\t\t\tbreak;\n \n \t\tif (i >= 0) {\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex 1fc69cf5bc..439f29d6c7 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -950,7 +950,7 @@ static const char *push_to_deploy(unsigned char *sha1,\n \tstruct child_process child = CHILD_PROCESS_INIT;\n \n \tchild.argv = update_refresh;\n-\tchild.env = env->argv;\n+\tchild.env = env->v;\n \tchild.dir = work_tree;\n \tchild.no_stdin = 1;\n \tchild.stdout_to_stderr = 1;\n@@ -961,7 +961,7 @@ static const char *push_to_deploy(unsigned char *sha1,\n \t/* run_command() does not clean up completely; reinitialize */\n \tchild_process_init(&child);\n \tchild.argv = diff_files;\n-\tchild.env = env->argv;\n+\tchild.env = env->v;\n \tchild.dir = work_tree;\n \tchild.no_stdin = 1;\n \tchild.stdout_to_stderr = 1;\n@@ -974,7 +974,7 @@ static const char *push_to_deploy(unsigned char *sha1,\n \n \tchild_process_init(&child);\n \tchild.argv = diff_index;\n-\tchild.env = env->argv;\n+\tchild.env = env->v;\n \tchild.no_stdin = 1;\n \tchild.no_stdout = 1;\n \tchild.stdout_to_stderr = 0;\n@@ -985,7 +985,7 @@ static const char *push_to_deploy(unsigned char *sha1,\n \tread_tree[3] = hash_to_hex(sha1);\n \tchild_process_init(&child);\n \tchild.argv = read_tree;\n-\tchild.env = env->argv;\n+\tchild.env = env->v;\n \tchild.dir = work_tree;\n \tchild.no_stdin = 1;\n \tchild.no_stdout = 1;\n@@ -1004,7 +1004,7 @@ static const char *push_to_checkout(unsigned char *hash,\n \t\t\t\t    const char *work_tree)\n {\n \tstrvec_pushf(env, \"GIT_WORK_TREE=%s\", absolute_path(work_tree));\n-\tif (run_hook_le(env->argv, push_to_checkout_hook,\n+\tif (run_hook_le(env->v, push_to_checkout_hook,\n \t\t\thash_to_hex(hash), NULL))\n \t\treturn \"push-to-checkout hook declined\";\n \telse\n@@ -1205,11 +1205,11 @@ static void run_update_post_hook(struct command *commands)\n \tfor (cmd = commands; cmd; cmd = cmd->next) {\n \t\tif (cmd->error_string || cmd->did_not_exist)\n \t\t\tcontinue;\n-\t\tif (!proc.args.argc)\n+\t\tif (!proc.args.nr)\n \t\t\tstrvec_push(&proc.args, hook);\n \t\tstrvec_push(&proc.args, cmd->ref_name);\n \t}\n-\tif (!proc.args.argc)\n+\tif (!proc.args.nr)\n \t\treturn;\n \n \tproc.no_stdin = 1;\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex a3b33c2c88..c8240e9fcd 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -1470,15 +1470,15 @@ static int update(int argc, const char **argv)\n \tfor (i = 1; i < argc; i++)\n \t\tstrvec_push(&fetch_argv, argv[i]);\n \n-\tif (strcmp(fetch_argv.argv[fetch_argv.argc-1], \"default\") == 0) {\n+\tif (strcmp(fetch_argv.v[fetch_argv.nr-1], \"default\") == 0) {\n \t\tgit_config(get_remote_default, &default_defined);\n \t\tif (!default_defined) {\n \t\t\tstrvec_pop(&fetch_argv);\n \t\t\tstrvec_push(&fetch_argv, \"--all\");\n \t\t}\n \t}\n \n-\tretval = run_command_v_opt(fetch_argv.argv, RUN_GIT_CMD);\n+\tretval = run_command_v_opt(fetch_argv.v, RUN_GIT_CMD);\n \tstrvec_clear(&fetch_argv);\n \treturn retval;\n }\ndiff --git a/builtin/replace.c b/builtin/replace.c\nindex 7bc5d66ed9..cd48765911 100644\n--- a/builtin/replace.c\n+++ b/builtin/replace.c\n@@ -513,7 +513,7 @@ static int convert_graft_file(int force)\n \t\t\tcontinue;\n \n \t\tstrvec_split(&args, buf.buf);\n-\t\tif (args.argc && create_graft(args.argc, args.argv, force, 1))\n+\t\tif (args.nr && create_graft(args.nr, args.v, force, 1))\n \t\t\tstrbuf_addf(&err, \"\\n\\t%s\", buf.buf);\n \t\tstrvec_clear(&args);\n \t}\ndiff --git a/builtin/show-branch.c b/builtin/show-branch.c\nindex 4c918ce90d..7eae5f3801 100644\n--- a/builtin/show-branch.c\n+++ b/builtin/show-branch.c\n@@ -561,7 +561,7 @@ static int git_show_branch_config(const char *var, const char *value, void *cb)\n \t\t * default_arg is now passed to parse_options(), so we need to\n \t\t * mimic the real argv a bit better.\n \t\t */\n-\t\tif (!default_args.argc)\n+\t\tif (!default_args.nr)\n \t\t\tstrvec_push(&default_args, \"show-branch\");\n \t\tstrvec_push(&default_args, value);\n \t\treturn 0;\n@@ -684,9 +684,9 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)\n \tgit_config(git_show_branch_config, NULL);\n \n \t/* If nothing is specified, try the default first */\n-\tif (ac == 1 && default_args.argc) {\n-\t\tac = default_args.argc;\n-\t\tav = default_args.argv;\n+\tif (ac == 1 && default_args.nr) {\n+\t\tac = default_args.nr;\n+\t\tav = default_args.v;\n \t}\n \n \tac = parse_options(ac, av, prefix, builtin_show_branch_options,\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex bfdbafae89..10d87630cd 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -745,7 +745,7 @@ static int show_stash(int argc, const char **argv, const char *prefix)\n \t\t\tstrvec_push(&revision_args, argv[i]);\n \t}\n \n-\tret = get_stash_info(&info, stash_args.argc, stash_args.argv);\n+\tret = get_stash_info(&info, stash_args.nr, stash_args.v);\n \tstrvec_clear(&stash_args);\n \tif (ret)\n \t\treturn -1;\n@@ -754,7 +754,7 @@ static int show_stash(int argc, const char **argv, const char *prefix)\n \t * The config settings are applied only if there are not passed\n \t * any options.\n \t */\n-\tif (revision_args.argc == 1) {\n+\tif (revision_args.nr == 1) {\n \t\tif (show_stat)\n \t\t\trev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT;\n \n@@ -767,7 +767,7 @@ static int show_stash(int argc, const char **argv, const char *prefix)\n \t\t}\n \t}\n \n-\targc = setup_revisions(revision_args.argc, revision_args.argv, &rev, NULL);\n+\targc = setup_revisions(revision_args.nr, revision_args.v, &rev, NULL);\n \tif (argc > 1) {\n \t\tfree_stash_info(&info);\n \t\tusage_with_options(git_stash_show_usage, options);\n@@ -1611,5 +1611,5 @@ int cmd_stash(int argc, const char **argv, const char *prefix)\n \t/* Assume 'stash push' */\n \tstrvec_push(&args, \"push\");\n \tstrvec_pushv(&args, argv);\n-\treturn !!push_stash(args.argc, args.argv, prefix, 1);\n+\treturn !!push_stash(args.nr, args.v, prefix, 1);\n }\ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex 665db1ffed..df135abbf1 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -817,9 +817,9 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,\n \n \trepo_init_revisions(the_repository, &rev, NULL);\n \trev.abbrev = 0;\n-\tdiff_files_args.argc = setup_revisions(diff_files_args.argc,\n-\t\t\t\t\t       diff_files_args.argv,\n-\t\t\t\t\t       &rev, NULL);\n+\tdiff_files_args.nr = setup_revisions(diff_files_args.nr,\n+\t\t\t\t\t     diff_files_args.v,\n+\t\t\t\t\t     &rev, NULL);\n \tdiff_files_result = run_diff_files(&rev, 0);\n \n \tif (!diff_result_code(&rev.diffopt, diff_files_result)) {\ndiff --git a/builtin/upload-archive.c b/builtin/upload-archive.c\nindex f02bb0ea15..24654b4c9b 100644\n--- a/builtin/upload-archive.c\n+++ b/builtin/upload-archive.c\n@@ -36,7 +36,7 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)\n \t\tchar *buf = packet_read_line(0, NULL);\n \t\tif (!buf)\n \t\t\tbreak;\t/* got a flush */\n-\t\tif (sent_argv.argc > MAX_ARGS)\n+\t\tif (sent_argv.nr > MAX_ARGS)\n \t\t\tdie(\"Too many options (>%d)\", MAX_ARGS - 1);\n \n \t\tif (!starts_with(buf, arg_cmd))\n@@ -45,7 +45,7 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)\n \t}\n \n \t/* parse all options sent by the client */\n-\treturn write_archive(sent_argv.argc, sent_argv.argv, prefix,\n+\treturn write_archive(sent_argv.nr, sent_argv.v, prefix,\n \t\t\t     the_repository, NULL, 1);\n }\n \ndiff --git a/builtin/worktree.c b/builtin/worktree.c\nindex be5d84f0a0..378f332b5d 100644\n--- a/builtin/worktree.c\n+++ b/builtin/worktree.c\n@@ -422,7 +422,7 @@ static int add_worktree(const char *path, const char *refname,\n \t\t\tstrvec_push(&cp.args, \"--quiet\");\n \t}\n \n-\tcp.env = child_env.argv;\n+\tcp.env = child_env.v;\n \tret = run_command(&cp);\n \tif (ret)\n \t\tgoto done;\n@@ -433,7 +433,7 @@ static int add_worktree(const char *path, const char *refname,\n \t\tstrvec_pushl(&cp.args, \"reset\", \"--hard\", \"--no-recurse-submodules\", NULL);\n \t\tif (opts->quiet)\n \t\t\tstrvec_push(&cp.args, \"--quiet\");\n-\t\tcp.env = child_env.argv;\n+\t\tcp.env = child_env.v;\n \t\tret = run_command(&cp);\n \t\tif (ret)\n \t\t\tgoto done;\n@@ -943,7 +943,7 @@ static void check_clean_worktree(struct worktree *wt,\n \tstrvec_pushl(&cp.args, \"status\",\n \t\t     \"--porcelain\", \"--ignore-submodules=none\",\n \t\t     NULL);\n-\tcp.env = child_env.argv;\n+\tcp.env = child_env.v;\n \tcp.git_cmd = 1;\n \tcp.dir = wt->path;\n \tcp.out = -1;\ndiff --git a/bundle.c b/bundle.c\nindex 565d05367f..7ef9c3a7c3 100644\n--- a/bundle.c\n+++ b/bundle.c\n@@ -278,7 +278,7 @@ static int write_pack_data(int bundle_fd, struct rev_info *revs, struct strvec *\n \t\t     \"pack-objects\",\n \t\t     \"--stdout\", \"--thin\", \"--delta-base-offset\",\n \t\t     NULL);\n-\tstrvec_pushv(&pack_objects.args, pack_options->argv);\n+\tstrvec_pushv(&pack_objects.args, pack_options->v);\n \tpack_objects.in = -1;\n \tpack_objects.out = bundle_fd;\n \tpack_objects.git_cmd = 1;\ndiff --git a/commit.c b/commit.c\nindex a5176a25bd..4ce8cb38d5 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -1643,7 +1643,7 @@ int run_commit_hook(int editor_is_used, const char *index_file,\n \t\tstrvec_push(&hook_env, \"GIT_EDITOR=:\");\n \n \tva_start(args, name);\n-\tret = run_hook_ve(hook_env.argv,name, args);\n+\tret = run_hook_ve(hook_env.v, name, args);\n \tva_end(args);\n \tstrvec_clear(&hook_env);\n \ndiff --git a/connect.c b/connect.c\nindex 3299ea956a..0b6aba177e 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -70,9 +70,9 @@ int server_supports_v2(const char *c, int die_on_error)\n {\n \tint i;\n \n-\tfor (i = 0; i < server_capabilities_v2.argc; i++) {\n+\tfor (i = 0; i < server_capabilities_v2.nr; i++) {\n \t\tconst char *out;\n-\t\tif (skip_prefix(server_capabilities_v2.argv[i], c, &out) &&\n+\t\tif (skip_prefix(server_capabilities_v2.v[i], c, &out) &&\n \t\t    (!*out || *out == '='))\n \t\t\treturn 1;\n \t}\n@@ -87,9 +87,9 @@ int server_feature_v2(const char *c, const char **v)\n {\n \tint i;\n \n-\tfor (i = 0; i < server_capabilities_v2.argc; i++) {\n+\tfor (i = 0; i < server_capabilities_v2.nr; i++) {\n \t\tconst char *out;\n-\t\tif (skip_prefix(server_capabilities_v2.argv[i], c, &out) &&\n+\t\tif (skip_prefix(server_capabilities_v2.v[i], c, &out) &&\n \t\t    (*out == '=')) {\n \t\t\t*v = out + 1;\n \t\t\treturn 1;\n@@ -103,9 +103,9 @@ int server_supports_feature(const char *c, const char *feature,\n {\n \tint i;\n \n-\tfor (i = 0; i < server_capabilities_v2.argc; i++) {\n+\tfor (i = 0; i < server_capabilities_v2.nr; i++) {\n \t\tconst char *out;\n-\t\tif (skip_prefix(server_capabilities_v2.argv[i], c, &out) &&\n+\t\tif (skip_prefix(server_capabilities_v2.v[i], c, &out) &&\n \t\t    (!*out || *(out++) == '=')) {\n \t\t\tif (parse_feature_request(out, feature))\n \t\t\t\treturn 1;\n@@ -488,9 +488,9 @@ struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,\n \tif (!for_push)\n \t\tpacket_write_fmt(fd_out, \"peel\\n\");\n \tpacket_write_fmt(fd_out, \"symrefs\\n\");\n-\tfor (i = 0; ref_prefixes && i < ref_prefixes->argc; i++) {\n+\tfor (i = 0; ref_prefixes && i < ref_prefixes->nr; i++) {\n \t\tpacket_write_fmt(fd_out, \"ref-prefix %s\\n\",\n-\t\t\t\t ref_prefixes->argv[i]);\n+\t\t\t\t ref_prefixes->v[i]);\n \t}\n \tpacket_flush(fd_out);\n \ndiff --git a/daemon.c b/daemon.c\nindex 0dec89fa02..2ab7ea82eb 100644\n--- a/daemon.c\n+++ b/daemon.c\n@@ -482,7 +482,7 @@ static int upload_pack(const struct strvec *env)\n \tstrvec_pushl(&cld.args, \"upload-pack\", \"--strict\", NULL);\n \tstrvec_pushf(&cld.args, \"--timeout=%u\", timeout);\n \n-\tstrvec_pushv(&cld.env_array, env->argv);\n+\tstrvec_pushv(&cld.env_array, env->v);\n \n \treturn run_service_command(&cld);\n }\n@@ -492,7 +492,7 @@ static int upload_archive(const struct strvec *env)\n \tstruct child_process cld = CHILD_PROCESS_INIT;\n \tstrvec_push(&cld.args, \"upload-archive\");\n \n-\tstrvec_pushv(&cld.env_array, env->argv);\n+\tstrvec_pushv(&cld.env_array, env->v);\n \n \treturn run_service_command(&cld);\n }\n@@ -502,7 +502,7 @@ static int receive_pack(const struct strvec *env)\n \tstruct child_process cld = CHILD_PROCESS_INIT;\n \tstrvec_push(&cld.args, \"receive-pack\");\n \n-\tstrvec_pushv(&cld.env_array, env->argv);\n+\tstrvec_pushv(&cld.env_array, env->v);\n \n \treturn run_service_command(&cld);\n }\n@@ -927,7 +927,7 @@ static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)\n #endif\n \t}\n \n-\tcld.argv = cld_argv.argv;\n+\tcld.argv = cld_argv.v;\n \tcld.in = incoming;\n \tcld.out = dup(incoming);\n \ndiff --git a/diff.c b/diff.c\nindex f1a3758922..f9709de7b4 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -4239,7 +4239,7 @@ static void run_external_diff(const char *pgm,\n \n \tdiff_free_filespec_data(one);\n \tdiff_free_filespec_data(two);\n-\tif (run_command_v_opt_cd_env(argv.argv, RUN_USING_SHELL, NULL, env.argv))\n+\tif (run_command_v_opt_cd_env(argv.v, RUN_USING_SHELL, NULL, env.v))\n \t\tdie(_(\"external diff died, stopping at %s\"), name);\n \n \tremove_tempfile();\ndiff --git a/environment.c b/environment.c\nindex 00fe20e496..52e0c979ba 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -164,7 +164,7 @@ static const char *getenv_safe(struct strvec *argv, const char *name)\n \t\treturn NULL;\n \n \tstrvec_push(argv, value);\n-\treturn argv->argv[argv->argc - 1];\n+\treturn argv->v[argv->nr - 1];\n }\n \n void setup_git_env(const char *git_dir)\ndiff --git a/exec-cmd.c b/exec-cmd.c\nindex 0f8e888424..eeb2ee52b8 100644\n--- a/exec-cmd.c\n+++ b/exec-cmd.c\n@@ -324,18 +324,18 @@ const char **prepare_git_cmd(struct strvec *out, const char **argv)\n {\n \tstrvec_push(out, \"git\");\n \tstrvec_pushv(out, argv);\n-\treturn out->argv;\n+\treturn out->v;\n }\n \n int execv_git_cmd(const char **argv)\n {\n \tstruct strvec nargv = STRVEC_INIT;\n \n \tprepare_git_cmd(&nargv, argv);\n-\ttrace_argv_printf(nargv.argv, \"trace: exec:\");\n+\ttrace_argv_printf(nargv.v, \"trace: exec:\");\n \n \t/* execvp() can only ever return if it fails */\n-\tsane_execvp(\"git\", (char **)nargv.argv);\n+\tsane_execvp(\"git\", (char **)nargv.v);\n \n \ttrace_printf(\"trace: exec failed: %s\\n\", strerror(errno));\n \ndiff --git a/git.c b/git.c\nindex 258035cfb1..8bd1d7551d 100644\n--- a/git.c\n+++ b/git.c\n@@ -352,7 +352,7 @@ static int handle_alias(int *argcp, const char ***argv)\n \t\t\tstrvec_push(&child.args, alias_string + 1);\n \t\t\tstrvec_pushv(&child.args, (*argv) + 1);\n \n-\t\t\ttrace2_cmd_alias(alias_command, child.args.argv);\n+\t\t\ttrace2_cmd_alias(alias_command, child.args.v);\n \t\t\ttrace2_cmd_list_config();\n \t\t\ttrace2_cmd_list_env_vars();\n \t\t\ttrace2_cmd_name(\"_run_shell_alias_\");\n@@ -667,7 +667,7 @@ static void handle_builtin(int argc, const char **argv)\n \t\t}\n \n \t\targc++;\n-\t\targv = args.argv;\n+\t\targv = args.v;\n \t}\n \n \tbuiltin = get_builtin(cmd);\n@@ -701,7 +701,7 @@ static void execv_dashed_external(const char **argv)\n \t * The code in run_command() logs trace2 child_start/child_exit\n \t * events, so we do not need to report exec/exec_result events here.\n \t */\n-\ttrace_argv_printf(cmd.args.argv, \"trace: exec:\");\n+\ttrace_argv_printf(cmd.args.v, \"trace: exec:\");\n \n \t/*\n \t * If we fail because the command is not found, it is\n@@ -762,13 +762,13 @@ static int run_argv(int *argcp, const char ***argv)\n \t\t\tfor (i = 0; i < *argcp; i++)\n \t\t\t\tstrvec_push(&args, (*argv)[i]);\n \n-\t\t\ttrace_argv_printf(args.argv, \"trace: exec:\");\n+\t\t\ttrace_argv_printf(args.v, \"trace: exec:\");\n \n \t\t\t/*\n \t\t\t * if we fail because the command is not found, it is\n \t\t\t * OK to return. Otherwise, we just pass along the status code.\n \t\t\t */\n-\t\t\ti = run_command_v_opt_tr2(args.argv, RUN_SILENT_EXEC_FAILURE |\n+\t\t\ti = run_command_v_opt_tr2(args.v, RUN_SILENT_EXEC_FAILURE |\n \t\t\t\t\t\t  RUN_CLEAN_ON_EXIT | RUN_WAIT_AFTER_CLEAN, \"git_alias\");\n \t\t\tif (i >= 0 || errno != ENOENT)\n \t\t\t\texit(i);\ndiff --git a/graph.c b/graph.c\nindex 09c9cc968c..c128ad0cce 100644\n--- a/graph.c\n+++ b/graph.c\n@@ -355,8 +355,8 @@ struct git_graph *graph_init(struct rev_info *opt)\n \t\t\tparse_graph_colors_config(&custom_colors, string);\n \t\t\tfree(string);\n \t\t\t/* graph_set_column_colors takes a max-index, not a count */\n-\t\t\tgraph_set_column_colors(custom_colors.argv,\n-\t\t\t\t\t\tcustom_colors.argc - 1);\n+\t\t\tgraph_set_column_colors(custom_colors.v,\n+\t\t\t\t\t\tcustom_colors.nr - 1);\n \t\t}\n \t}\n \ndiff --git a/http-push.c b/http-push.c\nindex 31911aa345..6a4a43e07f 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -1931,7 +1931,7 @@ int cmd_main(int argc, const char **argv)\n \t\t\tstrvec_pushf(&commit_argv, \"^%s\",\n \t\t\t\t     oid_to_hex(&ref->old_oid));\n \t\trepo_init_revisions(the_repository, &revs, setup_git_directory());\n-\t\tsetup_revisions(commit_argv.argc, commit_argv.argv, &revs, NULL);\n+\t\tsetup_revisions(commit_argv.nr, commit_argv.v, &revs, NULL);\n \t\trevs.edge_hint = 0; /* just in case */\n \n \t\t/* Generate a list of objects that need to be pushed */\ndiff --git a/ls-refs.c b/ls-refs.c\nindex 8192c949f4..a1e0b473e4 100644\n--- a/ls-refs.c\n+++ b/ls-refs.c\n@@ -15,11 +15,11 @@ static int ref_match(const struct strvec *prefixes, const char *refname)\n {\n \tint i;\n \n-\tif (!prefixes->argc)\n+\tif (!prefixes->nr)\n \t\treturn 1; /* no restriction */\n \n-\tfor (i = 0; i < prefixes->argc; i++) {\n-\t\tconst char *prefix = prefixes->argv[i];\n+\tfor (i = 0; i < prefixes->nr; i++) {\n+\t\tconst char *prefix = prefixes->v[i];\n \n \t\tif (starts_with(refname, prefix))\n \t\t\treturn 1;\ndiff --git a/merge.c b/merge.c\nindex a05b054faa..753e461659 100644\n--- a/merge.c\n+++ b/merge.c\n@@ -33,7 +33,7 @@ int try_merge_command(struct repository *r,\n \tfor (j = remotes; j; j = j->next)\n \t\tstrvec_push(&args, merge_argument(j->item));\n \n-\tret = run_command_v_opt(args.argv, RUN_GIT_CMD);\n+\tret = run_command_v_opt(args.v, RUN_GIT_CMD);\n \tstrvec_clear(&args);\n \n \tdiscard_index(r->index);\ndiff --git a/pathspec.c b/pathspec.c\nindex c303126f37..7a229d8d22 100644\n--- a/pathspec.c\n+++ b/pathspec.c\n@@ -652,7 +652,7 @@ void parse_pathspec_file(struct pathspec *pathspec, unsigned magic_mask,\n \tif (in != stdin)\n \t\tfclose(in);\n \n-\tparse_pathspec(pathspec, magic_mask, flags, prefix, parsed_file.argv);\n+\tparse_pathspec(pathspec, magic_mask, flags, prefix, parsed_file.v);\n \tstrvec_clear(&parsed_file);\n }\n \ndiff --git a/range-diff.c b/range-diff.c\nindex 831c490bf2..24dc435e48 100644\n--- a/range-diff.c\n+++ b/range-diff.c\n@@ -67,7 +67,7 @@ static int read_patches(const char *range, struct string_list *list,\n \t\t     \"--notes\",\n \t\t     NULL);\n \tif (other_arg)\n-\t\tstrvec_pushv(&cp.args, other_arg->argv);\n+\t\tstrvec_pushv(&cp.args, other_arg->v);\n \tstrvec_push(&cp.args, range);\n \tcp.out = -1;\n \tcp.no_stdin = 1;\ndiff --git a/ref-filter.c b/ref-filter.c\nindex 7f013851ed..0d3a56b79b 100644\n--- a/ref-filter.c\n+++ b/ref-filter.c\n@@ -1918,9 +1918,9 @@ static void find_longest_prefixes(struct string_list *out,\n \tstruct strbuf prefix = STRBUF_INIT;\n \n \tstrvec_pushv(&sorted, patterns);\n-\tQSORT(sorted.argv, sorted.argc, qsort_strcmp);\n+\tQSORT(sorted.v, sorted.nr, qsort_strcmp);\n \n-\tfind_longest_prefixes_1(out, &prefix, sorted.argv, sorted.argc);\n+\tfind_longest_prefixes_1(out, &prefix, sorted.v, sorted.nr);\n \n \tstrvec_clear(&sorted);\n \tstrbuf_release(&prefix);\ndiff --git a/remote-curl.c b/remote-curl.c\nindex 7feaddc003..41c3ac5c92 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -1190,7 +1190,7 @@ static int fetch_git(struct discovery *heads,\n \trpc.service_name = \"git-upload-pack\",\n \trpc.gzip_request = 1;\n \n-\terr = rpc_service(&rpc, heads, args.argv, &preamble, &rpc_result);\n+\terr = rpc_service(&rpc, heads, args.v, &preamble, &rpc_result);\n \tif (rpc_result.len)\n \t\twrite_or_die(1, rpc_result.buf, rpc_result.len);\n \tstrbuf_release(&rpc_result);\n@@ -1325,7 +1325,7 @@ static int push_git(struct discovery *heads, int nr_spec, const char **specs)\n \tmemset(&rpc, 0, sizeof(rpc));\n \trpc.service_name = \"git-receive-pack\",\n \n-\terr = rpc_service(&rpc, heads, args.argv, &preamble, &rpc_result);\n+\terr = rpc_service(&rpc, heads, args.v, &preamble, &rpc_result);\n \tif (rpc_result.len)\n \t\twrite_or_die(1, rpc_result.buf, rpc_result.len);\n \tstrbuf_release(&rpc_result);\n@@ -1366,7 +1366,7 @@ static void parse_push(struct strbuf *buf)\n \t\t\tbreak;\n \t} while (1);\n \n-\tret = push(specs.argc, specs.argv);\n+\tret = push(specs.nr, specs.v);\n \tprintf(\"\\n\");\n \tfflush(stdout);\n \ndiff --git a/remote.c b/remote.c\nindex b4665fe5a3..c5ed74f91c 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -1919,7 +1919,7 @@ static int stat_branch_pair(const char *branch_name, const char *base,\n \tstrvec_push(&argv, \"--\");\n \n \trepo_init_revisions(the_repository, &revs, NULL);\n-\tsetup_revisions(argv.argc, argv.argv, &revs, NULL);\n+\tsetup_revisions(argv.nr, argv.v, &revs, NULL);\n \tif (prepare_revision_walk(&revs))\n \t\tdie(_(\"revision walk setup failed\"));\n \ndiff --git a/revision.c b/revision.c\nindex e144132ae9..bc69f19141 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -2767,7 +2767,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s\n \t\t\tgot_rev_arg = 1;\n \t}\n \n-\tif (prune_data.argc) {\n+\tif (prune_data.nr) {\n \t\t/*\n \t\t * If we need to introduce the magic \"a lone ':' means no\n \t\t * pathspec whatsoever\", here is the place to do so.\n@@ -2783,7 +2783,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s\n \t\t * }\n \t\t */\n \t\tparse_pathspec(&revs->prune_data, 0, 0,\n-\t\t\t       revs->prefix, prune_data.argv);\n+\t\t\t       revs->prefix, prune_data.v);\n \t}\n \tstrvec_clear(&prune_data);\n \ndiff --git a/run-command.c b/run-command.c\nindex b9630a1b5f..cc9c3296ba 100644\n--- a/run-command.c\n+++ b/run-command.c\n@@ -287,7 +287,7 @@ static const char **prepare_shell_cmd(struct strvec *out, const char **argv)\n \t}\n \n \tstrvec_pushv(out, argv);\n-\treturn out->argv;\n+\treturn out->v;\n }\n \n #ifndef GIT_WINDOWS_NATIVE\n@@ -426,11 +426,11 @@ static int prepare_cmd(struct strvec *out, const struct child_process *cmd)\n \t * there are dir separator characters, we have exec attempt to invoke\n \t * the command directly.\n \t */\n-\tif (!has_dir_sep(out->argv[1])) {\n-\t\tchar *program = locate_in_PATH(out->argv[1]);\n+\tif (!has_dir_sep(out->v[1])) {\n+\t\tchar *program = locate_in_PATH(out->v[1]);\n \t\tif (program) {\n-\t\t\tfree((char *)out->argv[1]);\n-\t\t\tout->argv[1] = program;\n+\t\t\tfree((char *)out->v[1]);\n+\t\t\tout->v[1] = program;\n \t\t} else {\n \t\t\tstrvec_clear(out);\n \t\t\terrno = ENOENT;\n@@ -672,9 +672,9 @@ int start_command(struct child_process *cmd)\n \tchar *str;\n \n \tif (!cmd->argv)\n-\t\tcmd->argv = cmd->args.argv;\n+\t\tcmd->argv = cmd->args.v;\n \tif (!cmd->env)\n-\t\tcmd->env = cmd->env_array.argv;\n+\t\tcmd->env = cmd->env_array.v;\n \n \t/*\n \t * In case of errors we must keep the promise to close FDs\n@@ -846,10 +846,10 @@ int start_command(struct child_process *cmd)\n \t\t * be used in the event exec failed with ENOEXEC at which point\n \t\t * we will try to interpret the command using 'sh'.\n \t\t */\n-\t\texecve(argv.argv[1], (char *const *) argv.argv + 1,\n+\t\texecve(argv.v[1], (char *const *) argv.v + 1,\n \t\t       (char *const *) childenv);\n \t\tif (errno == ENOEXEC)\n-\t\t\texecve(argv.argv[0], (char *const *) argv.argv,\n+\t\t\texecve(argv.v[0], (char *const *) argv.v,\n \t\t\t       (char *const *) childenv);\n \n \t\tif (errno == ENOENT) {\n@@ -1874,7 +1874,7 @@ int run_auto_gc(int quiet)\n \tstrvec_pushl(&argv_gc_auto, \"gc\", \"--auto\", NULL);\n \tif (quiet)\n \t\tstrvec_push(&argv_gc_auto, \"--quiet\");\n-\tstatus = run_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD);\n+\tstatus = run_command_v_opt(argv_gc_auto.v, RUN_GIT_CMD);\n \tstrvec_clear(&argv_gc_auto);\n \treturn status;\n }\ndiff --git a/sequencer.c b/sequencer.c\nindex 31a2b1ab55..cc3f8fa88e 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -2761,7 +2761,7 @@ static int reset_merge(const struct object_id *oid)\n \tif (!is_null_oid(oid))\n \t\tstrvec_push(&argv, oid_to_hex(oid));\n \n-\tret = run_command_v_opt(argv.argv, RUN_GIT_CMD);\n+\tret = run_command_v_opt(argv.v, RUN_GIT_CMD);\n \tstrvec_clear(&argv);\n \n \treturn ret;\n@@ -3135,7 +3135,7 @@ static int do_exec(struct repository *r, const char *command_line)\n \tstrvec_pushf(&child_env, \"GIT_WORK_TREE=%s\",\n \t\t     absolute_path(get_git_work_tree()));\n \tstatus = run_command_v_opt_cd_env(child_argv, RUN_USING_SHELL, NULL,\n-\t\t\t\t\t  child_env.argv);\n+\t\t\t\t\t  child_env.v);\n \n \t/* force re-reading of the cache */\n \tif (discard_index(r->index) < 0 || repo_read_index(r) < 0)\ndiff --git a/serve.c b/serve.c\nindex 523a9be32d..f6341206c4 100644\n--- a/serve.c\n+++ b/serve.c\n@@ -146,9 +146,9 @@ int has_capability(const struct strvec *keys, const char *capability,\n \t\t   const char **value)\n {\n \tint i;\n-\tfor (i = 0; i < keys->argc; i++) {\n+\tfor (i = 0; i < keys->nr; i++) {\n \t\tconst char *out;\n-\t\tif (skip_prefix(keys->argv[i], capability, &out) &&\n+\t\tif (skip_prefix(keys->v[i], capability, &out) &&\n \t\t    (!*out || *out == '=')) {\n \t\t\tif (value) {\n \t\t\t\tif (*out == '=')\n@@ -223,7 +223,7 @@ static int process_request(void)\n \t\t\t * If no command and no keys were given then the client\n \t\t\t * wanted to terminate the connection.\n \t\t\t */\n-\t\t\tif (!keys.argc)\n+\t\t\tif (!keys.nr)\n \t\t\t\treturn 1;\n \n \t\t\t/*\ndiff --git a/strvec.c b/strvec.c\nindex 9e76ab9295..21dce0a7a4 100644\n--- a/strvec.c\n+++ b/strvec.c\n@@ -6,25 +6,25 @@ const char *empty_strvec[] = { NULL };\n \n void strvec_init(struct strvec *array)\n {\n-\tarray->argv = empty_strvec;\n-\tarray->argc = 0;\n+\tarray->v = empty_strvec;\n+\tarray->nr = 0;\n \tarray->alloc = 0;\n }\n \n static void strvec_push_nodup(struct strvec *array, const char *value)\n {\n-\tif (array->argv == empty_strvec)\n-\t\tarray->argv = NULL;\n+\tif (array->v == empty_strvec)\n+\t\tarray->v = NULL;\n \n-\tALLOC_GROW(array->argv, array->argc + 2, array->alloc);\n-\tarray->argv[array->argc++] = value;\n-\tarray->argv[array->argc] = NULL;\n+\tALLOC_GROW(array->v, array->nr + 2, array->alloc);\n+\tarray->v[array->nr++] = value;\n+\tarray->v[array->nr] = NULL;\n }\n \n const char *strvec_push(struct strvec *array, const char *value)\n {\n \tstrvec_push_nodup(array, xstrdup(value));\n-\treturn array->argv[array->argc - 1];\n+\treturn array->v[array->nr - 1];\n }\n \n const char *strvec_pushf(struct strvec *array, const char *fmt, ...)\n@@ -37,7 +37,7 @@ const char *strvec_pushf(struct strvec *array, const char *fmt, ...)\n \tva_end(ap);\n \n \tstrvec_push_nodup(array, strbuf_detach(&v, NULL));\n-\treturn array->argv[array->argc - 1];\n+\treturn array->v[array->nr - 1];\n }\n \n void strvec_pushl(struct strvec *array, ...)\n@@ -51,19 +51,19 @@ void strvec_pushl(struct strvec *array, ...)\n \tva_end(ap);\n }\n \n-void strvec_pushv(struct strvec *array, const char **argv)\n+void strvec_pushv(struct strvec *array, const char **items)\n {\n-\tfor (; *argv; argv++)\n-\t\tstrvec_push(array, *argv);\n+\tfor (; *items; items++)\n+\t\tstrvec_push(array, *items);\n }\n \n void strvec_pop(struct strvec *array)\n {\n-\tif (!array->argc)\n+\tif (!array->nr)\n \t\treturn;\n-\tfree((char *)array->argv[array->argc - 1]);\n-\tarray->argv[array->argc - 1] = NULL;\n-\tarray->argc--;\n+\tfree((char *)array->v[array->nr - 1]);\n+\tarray->v[array->nr - 1] = NULL;\n+\tarray->nr--;\n }\n \n void strvec_split(struct strvec *array, const char *to_split)\n@@ -88,21 +88,21 @@ void strvec_split(struct strvec *array, const char *to_split)\n \n void strvec_clear(struct strvec *array)\n {\n-\tif (array->argv != empty_strvec) {\n+\tif (array->v != empty_strvec) {\n \t\tint i;\n-\t\tfor (i = 0; i < array->argc; i++)\n-\t\t\tfree((char *)array->argv[i]);\n-\t\tfree(array->argv);\n+\t\tfor (i = 0; i < array->nr; i++)\n+\t\t\tfree((char *)array->v[i]);\n+\t\tfree(array->v);\n \t}\n \tstrvec_init(array);\n }\n \n const char **strvec_detach(struct strvec *array)\n {\n-\tif (array->argv == empty_strvec)\n+\tif (array->v == empty_strvec)\n \t\treturn xcalloc(1, sizeof(const char *));\n \telse {\n-\t\tconst char **ret = array->argv;\n+\t\tconst char **ret = array->v;\n \t\tstrvec_init(array);\n \t\treturn ret;\n \t}\ndiff --git a/strvec.h b/strvec.h\nindex bd35de1ce4..fdcad75b45 100644\n--- a/strvec.h\n+++ b/strvec.h\n@@ -2,10 +2,10 @@\n #define STRVEC_H\n \n /**\n- * The argv-array API allows one to dynamically build and store\n- * NULL-terminated lists.  An argv-array maintains the invariant that the\n- * `argv` member always points to a non-NULL array, and that the array is\n- * always NULL-terminated at the element pointed to by `argv[argc]`. This\n+ * The strvec API allows one to dynamically build and store\n+ * NULL-terminated arrays of strings. A strvec maintains the invariant that the\n+ * `items` member always points to a non-NULL array, and that the array is\n+ * always NULL-terminated at the element pointed to by `items[nr]`. This\n  * makes the result suitable for passing to functions expecting to receive\n  * argv from main().\n  *\n@@ -22,15 +22,15 @@ extern const char *empty_strvec[];\n \n /**\n  * A single array. This should be initialized by assignment from\n- * `STRVEC_INIT`, or by calling `strvec_init`. The `argv`\n- * member contains the actual array; the `argc` member contains the\n+ * `STRVEC_INIT`, or by calling `strvec_init`. The `items`\n+ * member contains the actual array; the `nr` member contains the\n  * number of elements in the array, not including the terminating\n  * NULL.\n  */\n struct strvec {\n-\tconst char **argv;\n-\tsize_t argc;\n-\tsize_t alloc;\n+\tconst char **v;\n+\tint nr;\n+\tint alloc;\n };\n \n #define STRVEC_INIT { empty_strvec, 0, 0 }\n@@ -78,7 +78,7 @@ void strvec_split(struct strvec *, const char *);\n void strvec_clear(struct strvec *);\n \n /**\n- * Disconnect the `argv` member from the `strvec` struct and\n+ * Disconnect the `items` member from the `strvec` struct and\n  * return it. The caller is responsible for freeing the memory used\n  * by the array, and by the strings it references. After detaching,\n  * the `strvec` is in a reinitialized state and can be pushed\ndiff --git a/submodule.c b/submodule.c\nindex fb96d595b0..a52b93a87f 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -269,7 +269,7 @@ int is_submodule_active(struct repository *repo, const char *path)\n \t\t\tstrvec_push(&args, item->string);\n \t\t}\n \n-\t\tparse_pathspec(&ps, 0, 0, NULL, args.argv);\n+\t\tparse_pathspec(&ps, 0, 0, NULL, args.v);\n \t\tret = match_pathspec(repo->index, &ps, path, strlen(path), 0, NULL, 1);\n \n \t\tstrvec_clear(&args);\n@@ -842,7 +842,7 @@ static void collect_changed_submodules(struct repository *r,\n \tconst struct commit *commit;\n \n \trepo_init_revisions(r, &rev, NULL);\n-\tsetup_revisions(argv->argc, argv->argv, &rev, NULL);\n+\tsetup_revisions(argv->nr, argv->v, &rev, NULL);\n \tif (prepare_revision_walk(&rev))\n \t\tdie(_(\"revision walk setup failed\"));\n \n@@ -1014,7 +1014,7 @@ int find_unpushed_submodules(struct repository *r,\n \tstruct string_list_item *name;\n \tstruct strvec argv = STRVEC_INIT;\n \n-\t/* argv.argv[0] will be ignored by setup_revisions */\n+\t/* argv.v[0] will be ignored by setup_revisions */\n \tstrvec_push(&argv, \"find_unpushed_submodules\");\n \toid_array_for_each_unique(commits, append_oid_to_argv, &argv);\n \tstrvec_push(&argv, \"--not\");\n@@ -1453,7 +1453,7 @@ static int get_next_submodule(struct child_process *cp,\n \t\t\t\tstrbuf_addf(err, _(\"Fetching submodule %s%s\\n\"),\n \t\t\t\t\t    spf->prefix, ce->name);\n \t\t\tstrvec_init(&cp->args);\n-\t\t\tstrvec_pushv(&cp->args, spf->args.argv);\n+\t\t\tstrvec_pushv(&cp->args, spf->args.v);\n \t\t\tstrvec_push(&cp->args, default_argv);\n \t\t\tstrvec_push(&cp->args, \"--submodule-prefix\");\n \n@@ -1501,7 +1501,7 @@ static int get_next_submodule(struct child_process *cp,\n \t\tcp->dir = task->repo->gitdir;\n \n \t\tstrvec_init(&cp->args);\n-\t\tstrvec_pushv(&cp->args, spf->args.argv);\n+\t\tstrvec_pushv(&cp->args, spf->args.v);\n \t\tstrvec_push(&cp->args, \"on-demand\");\n \t\tstrvec_push(&cp->args, \"--submodule-prefix\");\n \t\tstrvec_push(&cp->args, submodule_prefix.buf);\n@@ -1619,8 +1619,8 @@ int fetch_populated_submodules(struct repository *r,\n \t\tdie(_(\"index file corrupt\"));\n \n \tstrvec_push(&spf.args, \"fetch\");\n-\tfor (i = 0; i < options->argc; i++)\n-\t\tstrvec_push(&spf.args, options->argv[i]);\n+\tfor (i = 0; i < options->nr; i++)\n+\t\tstrvec_push(&spf.args, options->v[i]);\n \tstrvec_push(&spf.args, \"--recurse-submodules-default\");\n \t/* default value, \"--submodule-prefix\" and its value are added later */\n \ndiff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c\nindex 726835fcc2..7ae03dc712 100644\n--- a/t/helper/test-run-command.c\n+++ b/t/helper/test-run-command.c\n@@ -248,7 +248,7 @@ static int quote_stress_test(int argc, const char **argv)\n \t\telse\n \t\t\tstrvec_pushl(&args, \"test-tool\", \"run-command\",\n \t\t\t\t     \"quote-echo\", NULL);\n-\t\targ_offset = args.argc;\n+\t\targ_offset = args.nr;\n \n \t\tif (argc > 0) {\n \t\t\ttrials = 1;\n@@ -275,13 +275,13 @@ static int quote_stress_test(int argc, const char **argv)\n \t\tif (i < skip)\n \t\t\tcontinue;\n \n-\t\tcp.argv = args.argv;\n+\t\tcp.argv = args.v;\n \t\tstrbuf_reset(&out);\n \t\tif (pipe_command(&cp, NULL, 0, &out, 0, NULL, 0) < 0)\n \t\t\treturn error(\"Failed to spawn child process\");\n \n \t\tfor (j = 0, k = 0; j < arg_count; j++) {\n-\t\t\tconst char *arg = args.argv[j + arg_offset];\n+\t\t\tconst char *arg = args.v[j + arg_offset];\n \n \t\t\tif (strcmp(arg, out.buf + k))\n \t\t\t\tret = error(\"incorrectly quoted arg: '%s', \"\n@@ -298,7 +298,7 @@ static int quote_stress_test(int argc, const char **argv)\n \t\t\tfprintf(stderr, \"Trial #%d failed. Arguments:\\n\", i);\n \t\t\tfor (j = 0; j < arg_count; j++)\n \t\t\t\tfprintf(stderr, \"arg #%d: '%s'\\n\",\n-\t\t\t\t\t(int)j, args.argv[j + arg_offset]);\n+\t\t\t\t\t(int)j, args.v[j + arg_offset]);\n \n \t\t\tstrbuf_release(&out);\n \t\t\tstrvec_clear(&args);\ndiff --git a/tmp-objdir.c b/tmp-objdir.c\nindex e78e481d8e..42ed4db5d3 100644\n--- a/tmp-objdir.c\n+++ b/tmp-objdir.c\n@@ -283,7 +283,7 @@ const char **tmp_objdir_env(const struct tmp_objdir *t)\n {\n \tif (!t)\n \t\treturn NULL;\n-\treturn t->env.argv;\n+\treturn t->env.v;\n }\n \n void tmp_objdir_add_as_alternate(const struct tmp_objdir *t)\ndiff --git a/transport-helper.c b/transport-helper.c\nindex ae8011e9d5..defafbf4c1 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -138,7 +138,7 @@ static struct child_process *get_helper(struct transport *transport)\n \t\tstrvec_pushf(&helper->env_array, \"%s=%s\",\n \t\t\t     GIT_DIR_ENVIRONMENT, get_git_dir());\n \n-\thelper->trace2_child_class = helper->args.argv[0]; /* \"remote-<name>\" */\n+\thelper->trace2_child_class = helper->args.v[0]; /* \"remote-<name>\" */\n \n \tcode = start_command(helper);\n \tif (code < 0 && errno == ENOENT)\ndiff --git a/upload-pack.c b/upload-pack.c\nindex 4a7918e04e..db8c6509fe 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -897,7 +897,7 @@ static int send_shallow_list(struct upload_pack_data *data)\n \t\t\tstruct object *o = data->want_obj.objects[i].item;\n \t\t\tstrvec_push(&av, oid_to_hex(&o->oid));\n \t\t}\n-\t\tdeepen_by_rev_list(data, av.argc, av.argv);\n+\t\tdeepen_by_rev_list(data, av.nr, av.v);\n \t\tstrvec_clear(&av);\n \t\tret = 1;\n \t} else {\n-- \n2.28.0.465.g6cda80caa8\n\n"},{"id":"402313","messageId":"20200729004009.GB1653374@coredump.intra.peff.net","threadId":"53940","inReplyTo":"20200729003720.GA1653374@coredump.intra.peff.net","subject":"Re: [PATCH 10/11] strvec: drop argv_array compatibility layer","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-29T00:40:09Z","receivedAt":"2020-07-29T00:40:16Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jul 28, 2020 at 08:37:21PM -0400, Jeff King wrote:\n\n> > If I swap out the final patch with \"s/items/v/\" that may cause a\n> > _little_ more trouble, but perhaps not quite as much (only some of the\n> > sites access the fields directly).\n> \n> Here's the \"v\" version, which can replace the top patch. I'll follow-up\n> with some notes on merging to \"seen\".\n\nAnd here's a diff between your current \"seen\" tip and what I get by\nmerging in this updated version and then doing any necessary resolution\nor fixups on top. I'll leave it as an exercise for how you might want to\npull the content across. :)\n\nI do note that most of the new call-sites are ones that would be better\noff using child_process.args, and reviewers (myself and others) have\nsuggested that. So those direct uses of the \"argv\" member may go away\nanyway.\n\n---\ndiff --git a/add-interactive.c b/add-interactive.c\nindex 659289905c..555c4abf32 100644\n--- a/add-interactive.c\n+++ b/add-interactive.c\n@@ -944,7 +944,7 @@ static int run_patch(struct add_i_state *s, const struct pathspec *ps,\n \t\t\t\t\t    files->items.items[i].string);\n \t\tparse_pathspec(&ps_selected,\n \t\t\t       PATHSPEC_ALL_MAGIC & ~PATHSPEC_LITERAL,\n-\t\t\t       PATHSPEC_LITERAL_PATH, \"\", args.items);\n+\t\t\t       PATHSPEC_LITERAL_PATH, \"\", args.v);\n \t\tres = run_add_p(s->r, ADD_P_ADD, NULL, &ps_selected);\n \t\tstrvec_clear(&args);\n \t\tclear_pathspec(&ps_selected);\n@@ -986,7 +986,7 @@ static int run_diff(struct add_i_state *s, const struct pathspec *ps,\n \t\t\tif (files->selected[i])\n \t\t\t\tstrvec_push(&args,\n \t\t\t\t\t    files->items.items[i].string);\n-\t\tres = run_command_v_opt(args.items, 0);\n+\t\tres = run_command_v_opt(args.v, 0);\n \t\tstrvec_clear(&args);\n \t}\n \ndiff --git a/add-patch.c b/add-patch.c\nindex df170d29ef..0f68eb665e 100644\n--- a/add-patch.c\n+++ b/add-patch.c\n@@ -398,7 +398,7 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)\n \t\tstrvec_push(&args, ps->items[i].original);\n \n \tsetup_child_process(s, &cp, NULL);\n-\tcp.argv = args.items;\n+\tcp.argv = args.v;\n \tres = capture_command(&cp, plain, 0);\n \tif (res) {\n \t\tstrvec_clear(&args);\n@@ -415,8 +415,8 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)\n \t\tconst char *diff_filter = s->s.interactive_diff_filter;\n \n \t\tsetup_child_process(s, &colored_cp, NULL);\n-\t\txsnprintf((char *)args.items[color_arg_index], 8, \"--color\");\n-\t\tcolored_cp.argv = args.items;\n+\t\txsnprintf((char *)args.v[color_arg_index], 8, \"--color\");\n+\t\tcolored_cp.argv = args.v;\n \t\tcolored = &s->colored;\n \t\tres = capture_command(&colored_cp, colored, 0);\n \t\tstrvec_clear(&args);\ndiff --git a/bisect.c b/bisect.c\nindex 9ca3c5c52e..5c7710034a 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -649,7 +649,7 @@ static void bisect_rev_setup(struct repository *r, struct rev_info *revs,\n \tif (read_paths)\n \t\tread_bisect_paths(&rev_argv);\n \n-\tsetup_revisions(rev_argv.nr, rev_argv.items, revs, NULL);\n+\tsetup_revisions(rev_argv.nr, rev_argv.v, revs, NULL);\n \t/* XXX leak rev_argv, as \"revs\" may still be pointing to it */\n }\n \ndiff --git a/builtin/add.c b/builtin/add.c\nindex eb6457da05..ab39a60a0d 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -228,7 +228,7 @@ int run_add_interactive(const char *revision, const char *patch_mode,\n \t\t/* pass original pathspec, to be re-parsed */\n \t\tstrvec_push(&argv, pathspec->items[i].original);\n \n-\tstatus = run_command_v_opt(argv.items, RUN_GIT_CMD);\n+\tstatus = run_command_v_opt(argv.v, RUN_GIT_CMD);\n \tstrvec_clear(&argv);\n \treturn status;\n }\ndiff --git a/builtin/am.c b/builtin/am.c\nindex 2ca363f72e..68e9d17379 100644\n--- a/builtin/am.c\n+++ b/builtin/am.c\n@@ -812,7 +812,7 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths,\n \tstrbuf_release(&sb);\n \tfree(series_dir_buf);\n \n-\tret = split_mail_conv(stgit_patch_to_mail, state, patches.items, keep_cr);\n+\tret = split_mail_conv(stgit_patch_to_mail, state, patches.v, keep_cr);\n \n \tstrvec_clear(&patches);\n \treturn ret;\n@@ -1002,7 +1002,7 @@ static void am_setup(struct am_state *state, enum patch_format patch_format,\n \t}\n \twrite_state_text(state, \"scissors\", str);\n \n-\tsq_quote_argv(&sb, state->git_apply_opts.items);\n+\tsq_quote_argv(&sb, state->git_apply_opts.v);\n \twrite_state_text(state, \"apply-opt\", sb.buf);\n \n \tif (state->rebasing)\n@@ -1401,9 +1401,9 @@ static int run_apply(const struct am_state *state, const char *index_file)\n \t\tBUG(\"init_apply_state() failed\");\n \n \tstrvec_push(&apply_opts, \"apply\");\n-\tstrvec_pushv(&apply_opts, state->git_apply_opts.items);\n+\tstrvec_pushv(&apply_opts, state->git_apply_opts.v);\n \n-\topts_left = apply_parse_options(apply_opts.nr, apply_opts.items,\n+\topts_left = apply_parse_options(apply_opts.nr, apply_opts.v,\n \t\t\t\t\t&apply_state, &force_apply, &options,\n \t\t\t\t\tNULL);\n \n@@ -1428,7 +1428,7 @@ static int run_apply(const struct am_state *state, const char *index_file)\n \n \tstrvec_push(&apply_paths, am_path(state, \"patch\"));\n \n-\tres = apply_all_patches(&apply_state, apply_paths.nr, apply_paths.items, options);\n+\tres = apply_all_patches(&apply_state, apply_paths.nr, apply_paths.v, options);\n \n \tstrvec_clear(&apply_paths);\n \tstrvec_clear(&apply_opts);\n@@ -1455,7 +1455,7 @@ static int build_fake_ancestor(const struct am_state *state, const char *index_f\n \n \tcp.git_cmd = 1;\n \tstrvec_push(&cp.args, \"apply\");\n-\tstrvec_pushv(&cp.args, state->git_apply_opts.items);\n+\tstrvec_pushv(&cp.args, state->git_apply_opts.v);\n \tstrvec_pushf(&cp.args, \"--build-fake-ancestor=%s\", index_file);\n \tstrvec_push(&cp.args, am_path(state, \"patch\"));\n \n@@ -2379,7 +2379,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)\n \t\tif (state.interactive && !paths.nr)\n \t\t\tdie(_(\"interactive mode requires patches on the command line\"));\n \n-\t\tam_setup(&state, patch_format, paths.items, keep_cr);\n+\t\tam_setup(&state, patch_format, paths.v, keep_cr);\n \n \t\tstrvec_clear(&paths);\n \t}\ndiff --git a/builtin/annotate.c b/builtin/annotate.c\nindex b9ab710740..58ff977a23 100644\n--- a/builtin/annotate.c\n+++ b/builtin/annotate.c\n@@ -18,5 +18,5 @@ int cmd_annotate(int argc, const char **argv, const char *prefix)\n \t\tstrvec_push(&args, argv[i]);\n \t}\n \n-\treturn cmd_blame(args.nr, args.items, prefix);\n+\treturn cmd_blame(args.nr, args.v, prefix);\n }\ndiff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c\nindex 272c303ee4..0ba43f71ff 100644\n--- a/builtin/bisect--helper.c\n+++ b/builtin/bisect--helper.c\n@@ -204,7 +204,7 @@ static int bisect_reset(const char *commit)\n \t\tstruct strvec argv = STRVEC_INIT;\n \n \t\tstrvec_pushl(&argv, \"checkout\", branch.buf, \"--\", NULL);\n-\t\tif (run_command_v_opt(argv.items, RUN_GIT_CMD)) {\n+\t\tif (run_command_v_opt(argv.v, RUN_GIT_CMD)) {\n \t\t\terror(_(\"could not check out original\"\n \t\t\t\t\" HEAD '%s'. Try 'git bisect\"\n \t\t\t\t\" reset <commit>'.\"), branch.buf);\n@@ -707,7 +707,7 @@ static enum bisect_error bisect_start(struct bisect_terms *terms, int no_checkou\n \n \t\t\tstrvec_pushl(&argv, \"checkout\", start_head.buf,\n \t\t\t\t     \"--\", NULL);\n-\t\t\tif (run_command_v_opt(argv.items, RUN_GIT_CMD)) {\n+\t\t\tif (run_command_v_opt(argv.v, RUN_GIT_CMD)) {\n \t\t\t\tres = error(_(\"checking out '%s' failed.\"\n \t\t\t\t\t\t \" Try 'git bisect start \"\n \t\t\t\t\t\t \"<valid-branch>'.\"),\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 0bd57a9124..b087ee40c2 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -752,7 +752,7 @@ static int git_sparse_checkout_init(const char *repo)\n \t */\n \tcore_apply_sparse_checkout = 1;\n \n-\tif (run_command_v_opt(argv.items, RUN_GIT_CMD)) {\n+\tif (run_command_v_opt(argv.v, RUN_GIT_CMD)) {\n \t\terror(_(\"failed to initialize sparse-checkout\"));\n \t\tresult = 1;\n \t}\n@@ -844,7 +844,7 @@ static int checkout(int submodule_progress)\n \t\t\t\t\t       \"--single-branch\" :\n \t\t\t\t\t       \"--no-single-branch\");\n \n-\t\terr = run_command_v_opt(args.items, RUN_GIT_CMD);\n+\t\terr = run_command_v_opt(args.v, RUN_GIT_CMD);\n \t\tstrvec_clear(&args);\n \t}\n \ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 9705bfb0cf..f9b0a0c05d 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1008,7 +1008,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,\n \t\tstruct strvec env = STRVEC_INIT;\n \n \t\tstrvec_pushf(&env, \"GIT_INDEX_FILE=%s\", index_file);\n-\t\tif (launch_editor(git_path_commit_editmsg(), NULL, env.items)) {\n+\t\tif (launch_editor(git_path_commit_editmsg(), NULL, env.v)) {\n \t\t\tfprintf(stderr,\n \t\t\t_(\"Please supply the message using either -m or -F option.\\n\"));\n \t\t\texit(1);\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex 85c1504065..7668591d57 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -509,7 +509,7 @@ static void describe_blob(struct object_id oid, struct strbuf *dst)\n \t\t     NULL);\n \n \trepo_init_revisions(the_repository, &revs, NULL);\n-\tif (setup_revisions(args.nr, args.items, &revs, NULL) > 1)\n+\tif (setup_revisions(args.nr, args.v, &revs, NULL) > 1)\n \t\tBUG(\"setup_revisions could not handle all args?\");\n \n \tif (prepare_revision_walk(&revs))\n@@ -613,7 +613,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \t\t\tstrvec_pushv(&args, argv);\n \t\telse\n \t\t\tstrvec_push(&args, \"HEAD\");\n-\t\treturn cmd_name_rev(args.nr, args.items, prefix);\n+\t\treturn cmd_name_rev(args.nr, args.v, prefix);\n \t}\n \n \thashmap_init(&names, commit_name_neq, NULL, 0);\n@@ -659,7 +659,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \n \t\t\trepo_init_revisions(the_repository, &revs, prefix);\n \t\t\tstrvec_pushv(&args, diff_index_args);\n-\t\t\tif (setup_revisions(args.nr, args.items, &revs, NULL) != 1)\n+\t\t\tif (setup_revisions(args.nr, args.v, &revs, NULL) != 1)\n \t\t\t\tBUG(\"malformed internal diff-index command line\");\n \t\t\tresult = run_diff_index(&revs, 0);\n \ndiff --git a/builtin/difftool.c b/builtin/difftool.c\nindex 78ea697325..7ac432b881 100644\n--- a/builtin/difftool.c\n+++ b/builtin/difftool.c\n@@ -683,7 +683,7 @@ static int run_file_diff(int prompt, const char *prefix,\n \tstrvec_push(&args, \"diff\");\n \tfor (i = 0; i < argc; i++)\n \t\tstrvec_push(&args, argv[i]);\n-\tret = run_command_v_opt_cd_env(args.items, RUN_GIT_CMD, prefix, env);\n+\tret = run_command_v_opt_cd_env(args.v, RUN_GIT_CMD, prefix, env);\n \texit(ret);\n }\n \ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex 4c6d7c4428..ee52ae734e 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -1616,7 +1616,7 @@ static int fetch_multiple(struct string_list *list, int max_children)\n \tadd_options_to_argv(&argv);\n \n \tif (max_children != 1 && list->nr != 1) {\n-\t\tstruct parallel_fetch_state state = { argv.items, list, 0, 0 };\n+\t\tstruct parallel_fetch_state state = { argv.v, list, 0, 0 };\n \n \t\tstrvec_push(&argv, \"--end-of-options\");\n \t\tresult = run_processes_parallel_tr2(max_children,\n@@ -1634,7 +1634,7 @@ static int fetch_multiple(struct string_list *list, int max_children)\n \t\t\tstrvec_push(&argv, name);\n \t\t\tif (verbosity >= 0)\n \t\t\t\tprintf(_(\"Fetching %s\\n\"), name);\n-\t\t\tif (run_command_v_opt(argv.items, RUN_GIT_CMD)) {\n+\t\t\tif (run_command_v_opt(argv.v, RUN_GIT_CMD)) {\n \t\t\t\terror(_(\"Could not fetch %s\"), name);\n \t\t\t\tresult = 1;\n \t\t\t}\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex c87505ba21..5cacf78bba 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -518,11 +518,11 @@ static void gc_before_repack(void)\n \tif (done++)\n \t\treturn;\n \n-\tif (pack_refs && run_command_v_opt(pack_refs_cmd.items, RUN_GIT_CMD))\n-\t\tdie(FAILED_RUN, pack_refs_cmd.items[0]);\n+\tif (pack_refs && run_command_v_opt(pack_refs_cmd.v, RUN_GIT_CMD))\n+\t\tdie(FAILED_RUN, pack_refs_cmd.v[0]);\n \n-\tif (prune_reflogs && run_command_v_opt(reflog.items, RUN_GIT_CMD))\n-\t\tdie(FAILED_RUN, reflog.items[0]);\n+\tif (prune_reflogs && run_command_v_opt(reflog.v, RUN_GIT_CMD))\n+\t\tdie(FAILED_RUN, reflog.v[0]);\n }\n \n int cmd_gc(int argc, const char **argv, const char *prefix)\n@@ -657,8 +657,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \n \tif (!repository_format_precious_objects) {\n \t\tclose_object_store(the_repository->objects);\n-\t\tif (run_command_v_opt(repack.items, RUN_GIT_CMD))\n-\t\t\tdie(FAILED_RUN, repack.items[0]);\n+\t\tif (run_command_v_opt(repack.v, RUN_GIT_CMD))\n+\t\t\tdie(FAILED_RUN, repack.v[0]);\n \n \t\tif (prune_expire) {\n \t\t\tstrvec_push(&prune, prune_expire);\n@@ -667,19 +667,19 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \t\t\tif (has_promisor_remote())\n \t\t\t\tstrvec_push(&prune,\n \t\t\t\t\t    \"--exclude-promisor-objects\");\n-\t\t\tif (run_command_v_opt(prune.items, RUN_GIT_CMD))\n-\t\t\t\tdie(FAILED_RUN, prune.items[0]);\n+\t\t\tif (run_command_v_opt(prune.v, RUN_GIT_CMD))\n+\t\t\t\tdie(FAILED_RUN, prune.v[0]);\n \t\t}\n \t}\n \n \tif (prune_worktrees_expire) {\n \t\tstrvec_push(&prune_worktrees, prune_worktrees_expire);\n-\t\tif (run_command_v_opt(prune_worktrees.items, RUN_GIT_CMD))\n-\t\t\tdie(FAILED_RUN, prune_worktrees.items[0]);\n+\t\tif (run_command_v_opt(prune_worktrees.v, RUN_GIT_CMD))\n+\t\t\tdie(FAILED_RUN, prune_worktrees.v[0]);\n \t}\n \n-\tif (run_command_v_opt(rerere.items, RUN_GIT_CMD))\n-\t\tdie(FAILED_RUN, rerere.items[0]);\n+\tif (run_command_v_opt(rerere.v, RUN_GIT_CMD))\n+\t\tdie(FAILED_RUN, rerere.v[0]);\n \n \treport_garbage = report_pack_garbage;\n \treprepare_packed_git(the_repository);\n@@ -802,7 +802,7 @@ static int run_write_commit_graph(void)\n \tif (opts.quiet)\n \t\tstrvec_push(&cmd, \"--no-progress\");\n \n-\tresult = run_command_v_opt(cmd.items, RUN_GIT_CMD);\n+\tresult = run_command_v_opt(cmd.v, RUN_GIT_CMD);\n \tstrvec_clear(&cmd);\n \n \treturn result;\n@@ -819,7 +819,7 @@ static int run_verify_commit_graph(void)\n \tif (opts.quiet)\n \t\tstrvec_push(&cmd, \"--no-progress\");\n \n-\tresult = run_command_v_opt(cmd.items, RUN_GIT_CMD);\n+\tresult = run_command_v_opt(cmd.v, RUN_GIT_CMD);\n \tstrvec_clear(&cmd);\n \n \treturn result;\n@@ -874,7 +874,7 @@ static int fetch_remote(const char *remote)\n \tif (opts.quiet)\n \t\tstrvec_push(&cmd, \"--quiet\");\n \n-\tresult = run_command_v_opt(cmd.items, RUN_GIT_CMD);\n+\tresult = run_command_v_opt(cmd.v, RUN_GIT_CMD);\n \n \tstrbuf_release(&refmap);\n \treturn result;\n@@ -929,7 +929,7 @@ static int maintenance_task_gc(void)\n \t\tstrvec_pushl(&cmd, \"--quiet\", NULL);\n \n \tclose_object_store(the_repository->objects);\n-\tresult = run_command_v_opt(cmd.items, RUN_GIT_CMD);\n+\tresult = run_command_v_opt(cmd.v, RUN_GIT_CMD);\n \tstrvec_clear(&cmd);\n \n \treturn result;\n@@ -943,7 +943,7 @@ static int prune_packed(void)\n \tif (opts.quiet)\n \t\tstrvec_push(&cmd, \"--quiet\");\n \n-\treturn run_command_v_opt(cmd.items, RUN_GIT_CMD);\n+\treturn run_command_v_opt(cmd.v, RUN_GIT_CMD);\n }\n \n struct write_loose_object_data {\n@@ -1102,7 +1102,7 @@ static int multi_pack_index_write(void)\n \tif (opts.quiet)\n \t\tstrvec_push(&cmd, \"--no-progress\");\n \n-\tresult = run_command_v_opt(cmd.items, RUN_GIT_CMD);\n+\tresult = run_command_v_opt(cmd.v, RUN_GIT_CMD);\n \tstrvec_clear(&cmd);\n \n \treturn result;\n@@ -1133,7 +1133,7 @@ static int multi_pack_index_verify(void)\n \tif (opts.quiet)\n \t\tstrvec_push(&cmd, \"--no-progress\");\n \n-\tresult = run_command_v_opt(cmd.items, RUN_GIT_CMD);\n+\tresult = run_command_v_opt(cmd.v, RUN_GIT_CMD);\n \tstrvec_clear(&cmd);\n \n \treturn result;\n@@ -1149,7 +1149,7 @@ static int multi_pack_index_expire(void)\n \t\tstrvec_push(&cmd, \"--no-progress\");\n \n \tclose_object_store(the_repository->objects);\n-\tresult = run_command_v_opt(cmd.items, RUN_GIT_CMD);\n+\tresult = run_command_v_opt(cmd.v, RUN_GIT_CMD);\n \tstrvec_clear(&cmd);\n \n \treturn result;\n@@ -1212,7 +1212,7 @@ static int multi_pack_index_repack(void)\n \tstrvec_push(&cmd, batch_arg.buf);\n \n \tclose_object_store(the_repository->objects);\n-\tresult = run_command_v_opt(cmd.items, RUN_GIT_CMD);\n+\tresult = run_command_v_opt(cmd.v, RUN_GIT_CMD);\n \tstrbuf_release(&batch_arg);\n \n \tif (result && multi_pack_index_verify()) {\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 0de05ee567..fac58865da 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -3737,7 +3737,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)\n \tif (!use_internal_rev_list)\n \t\tread_object_list_from_stdin();\n \telse {\n-\t\tget_object_list(rp.nr, rp.items);\n+\t\tget_object_list(rp.nr, rp.v);\n \t\tstrvec_clear(&rp);\n \t}\n \tcleanup_preferred_base();\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex 4c66db1468..5ef3434e1f 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -585,14 +585,14 @@ static int run_fetch(const char *repo, const char **refspecs)\n \t\tstrvec_push(&args, \"--no-show-forced-updates\");\n \tif (set_upstream)\n \t\tstrvec_push(&args, set_upstream);\n-\tstrvec_pushv(&args, opt_fetch.items);\n+\tstrvec_pushv(&args, opt_fetch.v);\n \n \tif (repo) {\n \t\tstrvec_push(&args, repo);\n \t\tstrvec_pushv(&args, refspecs);\n \t} else if (*refspecs)\n \t\tBUG(\"refspecs without repo?\");\n-\tret = run_command_v_opt(args.items, RUN_GIT_CMD);\n+\tret = run_command_v_opt(args.v, RUN_GIT_CMD);\n \tstrvec_clear(&args);\n \treturn ret;\n }\n@@ -692,8 +692,8 @@ static int run_merge(void)\n \t\tstrvec_push(&args, opt_ff);\n \tif (opt_verify_signatures)\n \t\tstrvec_push(&args, opt_verify_signatures);\n-\tstrvec_pushv(&args, opt_strategies.items);\n-\tstrvec_pushv(&args, opt_strategy_opts.items);\n+\tstrvec_pushv(&args, opt_strategies.v);\n+\tstrvec_pushv(&args, opt_strategy_opts.v);\n \tif (opt_gpg_sign)\n \t\tstrvec_push(&args, opt_gpg_sign);\n \tif (opt_autostash == 0)\n@@ -704,7 +704,7 @@ static int run_merge(void)\n \t\tstrvec_push(&args, \"--allow-unrelated-histories\");\n \n \tstrvec_push(&args, \"FETCH_HEAD\");\n-\tret = run_command_v_opt(args.items, RUN_GIT_CMD);\n+\tret = run_command_v_opt(args.v, RUN_GIT_CMD);\n \tstrvec_clear(&args);\n \treturn ret;\n }\n@@ -883,8 +883,8 @@ static int run_rebase(const struct object_id *curr_head,\n \t\tstrvec_push(&args, \"--interactive\");\n \tif (opt_diffstat)\n \t\tstrvec_push(&args, opt_diffstat);\n-\tstrvec_pushv(&args, opt_strategies.items);\n-\tstrvec_pushv(&args, opt_strategy_opts.items);\n+\tstrvec_pushv(&args, opt_strategies.v);\n+\tstrvec_pushv(&args, opt_strategy_opts.v);\n \tif (opt_gpg_sign)\n \t\tstrvec_push(&args, opt_gpg_sign);\n \tif (opt_autostash == 0)\n@@ -903,7 +903,7 @@ static int run_rebase(const struct object_id *curr_head,\n \telse\n \t\tstrvec_push(&args, oid_to_hex(merge_head));\n \n-\tret = run_command_v_opt(args.items, RUN_GIT_CMD);\n+\tret = run_command_v_opt(args.v, RUN_GIT_CMD);\n \tstrvec_clear(&args);\n \treturn ret;\n }\ndiff --git a/builtin/rebase.c b/builtin/rebase.c\nindex 3a9d6672f2..eeca53382f 100644\n--- a/builtin/rebase.c\n+++ b/builtin/rebase.c\n@@ -357,7 +357,7 @@ static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)\n \t\t\t     oid_to_hex(&opts->restrict_revision->object.oid));\n \n \tret = sequencer_make_script(the_repository, &todo_list.buf,\n-\t\t\t\t    make_script_args.nr, make_script_args.items,\n+\t\t\t\t    make_script_args.nr, make_script_args.v,\n \t\t\t\t    flags);\n \n \tif (ret)\n@@ -906,7 +906,7 @@ static int run_am(struct rebase_options *opts)\n \t\treturn status;\n \t}\n \n-\tstrvec_pushv(&am.args, opts->git_am_opts.items);\n+\tstrvec_pushv(&am.args, opts->git_am_opts.v);\n \tstrvec_push(&am.args, \"--rebasing\");\n \tstrvec_pushf(&am.args, \"--resolvemsg=%s\", resolvemsg);\n \tstrvec_push(&am.args, \"--patch-format=mboxrd\");\n@@ -975,7 +975,7 @@ static int run_specific_rebase(struct rebase_options *opts, enum action action)\n \tadd_var(&script_snippet, \"revisions\", opts->revisions);\n \tadd_var(&script_snippet, \"restrict_revision\", opts->restrict_revision ?\n \t\toid_to_hex(&opts->restrict_revision->object.oid) : NULL);\n-\tsq_quote_argv_pretty(&buf, opts->git_am_opts.items);\n+\tsq_quote_argv_pretty(&buf, opts->git_am_opts.v);\n \tadd_var(&script_snippet, \"git_am_opt\", buf.buf);\n \tstrbuf_release(&buf);\n \tadd_var(&script_snippet, \"verbose\",\n@@ -1636,7 +1636,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)\n \t\toptions.flags |= REBASE_FORCE;\n \n \tfor (i = 0; i < options.git_am_opts.nr; i++) {\n-\t\tconst char *option = options.git_am_opts.items[i], *p;\n+\t\tconst char *option = options.git_am_opts.v[i], *p;\n \t\tif (!strcmp(option, \"--whitespace=fix\") ||\n \t\t    !strcmp(option, \"--whitespace=strip\"))\n \t\t\tallow_preemptive_ff = 0;\n@@ -1749,7 +1749,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)\n \tif (options.git_am_opts.nr || options.type == REBASE_APPLY) {\n \t\t/* all am options except -q are compatible only with --apply */\n \t\tfor (i = options.git_am_opts.nr - 1; i >= 0; i--)\n-\t\t\tif (strcmp(options.git_am_opts.items[i], \"-q\"))\n+\t\t\tif (strcmp(options.git_am_opts.v[i], \"-q\"))\n \t\t\t\tbreak;\n \n \t\tif (i >= 0) {\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex 1158d184f5..b9615e8441 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -1252,7 +1252,7 @@ static const char *push_to_deploy(unsigned char *sha1,\n \tstruct child_process child = CHILD_PROCESS_INIT;\n \n \tchild.argv = update_refresh;\n-\tchild.env = env->items;\n+\tchild.env = env->v;\n \tchild.dir = work_tree;\n \tchild.no_stdin = 1;\n \tchild.stdout_to_stderr = 1;\n@@ -1263,7 +1263,7 @@ static const char *push_to_deploy(unsigned char *sha1,\n \t/* run_command() does not clean up completely; reinitialize */\n \tchild_process_init(&child);\n \tchild.argv = diff_files;\n-\tchild.env = env->items;\n+\tchild.env = env->v;\n \tchild.dir = work_tree;\n \tchild.no_stdin = 1;\n \tchild.stdout_to_stderr = 1;\n@@ -1276,7 +1276,7 @@ static const char *push_to_deploy(unsigned char *sha1,\n \n \tchild_process_init(&child);\n \tchild.argv = diff_index;\n-\tchild.env = env->items;\n+\tchild.env = env->v;\n \tchild.no_stdin = 1;\n \tchild.no_stdout = 1;\n \tchild.stdout_to_stderr = 0;\n@@ -1287,7 +1287,7 @@ static const char *push_to_deploy(unsigned char *sha1,\n \tread_tree[3] = hash_to_hex(sha1);\n \tchild_process_init(&child);\n \tchild.argv = read_tree;\n-\tchild.env = env->items;\n+\tchild.env = env->v;\n \tchild.dir = work_tree;\n \tchild.no_stdin = 1;\n \tchild.no_stdout = 1;\n@@ -1306,7 +1306,7 @@ static const char *push_to_checkout(unsigned char *hash,\n \t\t\t\t    const char *work_tree)\n {\n \tstrvec_pushf(env, \"GIT_WORK_TREE=%s\", absolute_path(work_tree));\n-\tif (run_hook_le(env->items, push_to_checkout_hook,\n+\tif (run_hook_le(env->v, push_to_checkout_hook,\n \t\t\thash_to_hex(hash), NULL))\n \t\treturn \"push-to-checkout hook declined\";\n \telse\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex 9a98e77a5e..c8240e9fcd 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -1470,15 +1470,15 @@ static int update(int argc, const char **argv)\n \tfor (i = 1; i < argc; i++)\n \t\tstrvec_push(&fetch_argv, argv[i]);\n \n-\tif (strcmp(fetch_argv.items[fetch_argv.nr-1], \"default\") == 0) {\n+\tif (strcmp(fetch_argv.v[fetch_argv.nr-1], \"default\") == 0) {\n \t\tgit_config(get_remote_default, &default_defined);\n \t\tif (!default_defined) {\n \t\t\tstrvec_pop(&fetch_argv);\n \t\t\tstrvec_push(&fetch_argv, \"--all\");\n \t\t}\n \t}\n \n-\tretval = run_command_v_opt(fetch_argv.items, RUN_GIT_CMD);\n+\tretval = run_command_v_opt(fetch_argv.v, RUN_GIT_CMD);\n \tstrvec_clear(&fetch_argv);\n \treturn retval;\n }\ndiff --git a/builtin/replace.c b/builtin/replace.c\nindex 038b7f874b..cd48765911 100644\n--- a/builtin/replace.c\n+++ b/builtin/replace.c\n@@ -513,7 +513,7 @@ static int convert_graft_file(int force)\n \t\t\tcontinue;\n \n \t\tstrvec_split(&args, buf.buf);\n-\t\tif (args.nr && create_graft(args.nr, args.items, force, 1))\n+\t\tif (args.nr && create_graft(args.nr, args.v, force, 1))\n \t\t\tstrbuf_addf(&err, \"\\n\\t%s\", buf.buf);\n \t\tstrvec_clear(&args);\n \t}\ndiff --git a/builtin/show-branch.c b/builtin/show-branch.c\nindex de27703297..7eae5f3801 100644\n--- a/builtin/show-branch.c\n+++ b/builtin/show-branch.c\n@@ -686,7 +686,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)\n \t/* If nothing is specified, try the default first */\n \tif (ac == 1 && default_args.nr) {\n \t\tac = default_args.nr;\n-\t\tav = default_args.items;\n+\t\tav = default_args.v;\n \t}\n \n \tac = parse_options(ac, av, prefix, builtin_show_branch_options,\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex 0134c6b0d6..10d87630cd 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -745,7 +745,7 @@ static int show_stash(int argc, const char **argv, const char *prefix)\n \t\t\tstrvec_push(&revision_args, argv[i]);\n \t}\n \n-\tret = get_stash_info(&info, stash_args.nr, stash_args.items);\n+\tret = get_stash_info(&info, stash_args.nr, stash_args.v);\n \tstrvec_clear(&stash_args);\n \tif (ret)\n \t\treturn -1;\n@@ -767,7 +767,7 @@ static int show_stash(int argc, const char **argv, const char *prefix)\n \t\t}\n \t}\n \n-\targc = setup_revisions(revision_args.nr, revision_args.items, &rev, NULL);\n+\targc = setup_revisions(revision_args.nr, revision_args.v, &rev, NULL);\n \tif (argc > 1) {\n \t\tfree_stash_info(&info);\n \t\tusage_with_options(git_stash_show_usage, options);\n@@ -1611,5 +1611,5 @@ int cmd_stash(int argc, const char **argv, const char *prefix)\n \t/* Assume 'stash push' */\n \tstrvec_push(&args, \"push\");\n \tstrvec_pushv(&args, argv);\n-\treturn !!push_stash(args.nr, args.items, prefix, 1);\n+\treturn !!push_stash(args.nr, args.v, prefix, 1);\n }\ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex 6bbed9f92a..df135abbf1 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -818,7 +818,7 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,\n \trepo_init_revisions(the_repository, &rev, NULL);\n \trev.abbrev = 0;\n \tdiff_files_args.nr = setup_revisions(diff_files_args.nr,\n-\t\t\t\t\t     diff_files_args.items,\n+\t\t\t\t\t     diff_files_args.v,\n \t\t\t\t\t     &rev, NULL);\n \tdiff_files_result = run_diff_files(&rev, 0);\n \ndiff --git a/builtin/upload-archive.c b/builtin/upload-archive.c\nindex 8ded611092..24654b4c9b 100644\n--- a/builtin/upload-archive.c\n+++ b/builtin/upload-archive.c\n@@ -45,7 +45,7 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)\n \t}\n \n \t/* parse all options sent by the client */\n-\treturn write_archive(sent_argv.nr, sent_argv.items, prefix,\n+\treturn write_archive(sent_argv.nr, sent_argv.v, prefix,\n \t\t\t     the_repository, NULL, 1);\n }\n \ndiff --git a/builtin/verify-pack.c b/builtin/verify-pack.c\nindex 9a5b787912..ef24e11243 100644\n--- a/builtin/verify-pack.c\n+++ b/builtin/verify-pack.c\n@@ -40,7 +40,7 @@ static int verify_one_pack(const char *path, unsigned int flags, const char *has\n \t\tstrbuf_addstr(&arg, \".pack\");\n \tstrvec_push(&argv, arg.buf);\n \n-\tindex_pack.argv = argv.items;\n+\tindex_pack.argv = argv.v;\n \tindex_pack.git_cmd = 1;\n \n \terr = run_command(&index_pack);\ndiff --git a/builtin/worktree.c b/builtin/worktree.c\nindex 1d6b9455da..378f332b5d 100644\n--- a/builtin/worktree.c\n+++ b/builtin/worktree.c\n@@ -422,7 +422,7 @@ static int add_worktree(const char *path, const char *refname,\n \t\t\tstrvec_push(&cp.args, \"--quiet\");\n \t}\n \n-\tcp.env = child_env.items;\n+\tcp.env = child_env.v;\n \tret = run_command(&cp);\n \tif (ret)\n \t\tgoto done;\n@@ -433,7 +433,7 @@ static int add_worktree(const char *path, const char *refname,\n \t\tstrvec_pushl(&cp.args, \"reset\", \"--hard\", \"--no-recurse-submodules\", NULL);\n \t\tif (opts->quiet)\n \t\t\tstrvec_push(&cp.args, \"--quiet\");\n-\t\tcp.env = child_env.items;\n+\t\tcp.env = child_env.v;\n \t\tret = run_command(&cp);\n \t\tif (ret)\n \t\t\tgoto done;\n@@ -943,7 +943,7 @@ static void check_clean_worktree(struct worktree *wt,\n \tstrvec_pushl(&cp.args, \"status\",\n \t\t     \"--porcelain\", \"--ignore-submodules=none\",\n \t\t     NULL);\n-\tcp.env = child_env.items;\n+\tcp.env = child_env.v;\n \tcp.git_cmd = 1;\n \tcp.dir = wt->path;\n \tcp.out = -1;\ndiff --git a/bundle.c b/bundle.c\nindex 762177e1fd..47e478c9a5 100644\n--- a/bundle.c\n+++ b/bundle.c\n@@ -304,7 +304,7 @@ static int write_pack_data(int bundle_fd, struct rev_info *revs, struct strvec *\n \t\t     \"pack-objects\",\n \t\t     \"--stdout\", \"--thin\", \"--delta-base-offset\",\n \t\t     NULL);\n-\tstrvec_pushv(&pack_objects.args, pack_options->items);\n+\tstrvec_pushv(&pack_objects.args, pack_options->v);\n \tpack_objects.in = -1;\n \tpack_objects.out = bundle_fd;\n \tpack_objects.git_cmd = 1;\ndiff --git a/commit.c b/commit.c\nindex c8fd6931a6..4ce8cb38d5 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -1643,7 +1643,7 @@ int run_commit_hook(int editor_is_used, const char *index_file,\n \t\tstrvec_push(&hook_env, \"GIT_EDITOR=:\");\n \n \tva_start(args, name);\n-\tret = run_hook_ve(hook_env.items, name, args);\n+\tret = run_hook_ve(hook_env.v, name, args);\n \tva_end(args);\n \tstrvec_clear(&hook_env);\n \ndiff --git a/connect.c b/connect.c\nindex e3a08179d4..0b6aba177e 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -72,7 +72,7 @@ int server_supports_v2(const char *c, int die_on_error)\n \n \tfor (i = 0; i < server_capabilities_v2.nr; i++) {\n \t\tconst char *out;\n-\t\tif (skip_prefix(server_capabilities_v2.items[i], c, &out) &&\n+\t\tif (skip_prefix(server_capabilities_v2.v[i], c, &out) &&\n \t\t    (!*out || *out == '='))\n \t\t\treturn 1;\n \t}\n@@ -89,7 +89,7 @@ int server_feature_v2(const char *c, const char **v)\n \n \tfor (i = 0; i < server_capabilities_v2.nr; i++) {\n \t\tconst char *out;\n-\t\tif (skip_prefix(server_capabilities_v2.items[i], c, &out) &&\n+\t\tif (skip_prefix(server_capabilities_v2.v[i], c, &out) &&\n \t\t    (*out == '=')) {\n \t\t\t*v = out + 1;\n \t\t\treturn 1;\n@@ -105,7 +105,7 @@ int server_supports_feature(const char *c, const char *feature,\n \n \tfor (i = 0; i < server_capabilities_v2.nr; i++) {\n \t\tconst char *out;\n-\t\tif (skip_prefix(server_capabilities_v2.items[i], c, &out) &&\n+\t\tif (skip_prefix(server_capabilities_v2.v[i], c, &out) &&\n \t\t    (!*out || *(out++) == '=')) {\n \t\t\tif (parse_feature_request(out, feature))\n \t\t\t\treturn 1;\n@@ -490,7 +490,7 @@ struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,\n \tpacket_write_fmt(fd_out, \"symrefs\\n\");\n \tfor (i = 0; ref_prefixes && i < ref_prefixes->nr; i++) {\n \t\tpacket_write_fmt(fd_out, \"ref-prefix %s\\n\",\n-\t\t\t\t ref_prefixes->items[i]);\n+\t\t\t\t ref_prefixes->v[i]);\n \t}\n \tpacket_flush(fd_out);\n \ndiff --git a/daemon.c b/daemon.c\nindex ee66002a6f..2ab7ea82eb 100644\n--- a/daemon.c\n+++ b/daemon.c\n@@ -482,7 +482,7 @@ static int upload_pack(const struct strvec *env)\n \tstrvec_pushl(&cld.args, \"upload-pack\", \"--strict\", NULL);\n \tstrvec_pushf(&cld.args, \"--timeout=%u\", timeout);\n \n-\tstrvec_pushv(&cld.env_array, env->items);\n+\tstrvec_pushv(&cld.env_array, env->v);\n \n \treturn run_service_command(&cld);\n }\n@@ -492,7 +492,7 @@ static int upload_archive(const struct strvec *env)\n \tstruct child_process cld = CHILD_PROCESS_INIT;\n \tstrvec_push(&cld.args, \"upload-archive\");\n \n-\tstrvec_pushv(&cld.env_array, env->items);\n+\tstrvec_pushv(&cld.env_array, env->v);\n \n \treturn run_service_command(&cld);\n }\n@@ -502,7 +502,7 @@ static int receive_pack(const struct strvec *env)\n \tstruct child_process cld = CHILD_PROCESS_INIT;\n \tstrvec_push(&cld.args, \"receive-pack\");\n \n-\tstrvec_pushv(&cld.env_array, env->items);\n+\tstrvec_pushv(&cld.env_array, env->v);\n \n \treturn run_service_command(&cld);\n }\n@@ -927,7 +927,7 @@ static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)\n #endif\n \t}\n \n-\tcld.argv = cld_argv.items;\n+\tcld.argv = cld_argv.v;\n \tcld.in = incoming;\n \tcld.out = dup(incoming);\n \ndiff --git a/diff.c b/diff.c\nindex fb5462c532..f9709de7b4 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -4239,7 +4239,7 @@ static void run_external_diff(const char *pgm,\n \n \tdiff_free_filespec_data(one);\n \tdiff_free_filespec_data(two);\n-\tif (run_command_v_opt_cd_env(argv.items, RUN_USING_SHELL, NULL, env.items))\n+\tif (run_command_v_opt_cd_env(argv.v, RUN_USING_SHELL, NULL, env.v))\n \t\tdie(_(\"external diff died, stopping at %s\"), name);\n \n \tremove_tempfile();\ndiff --git a/environment.c b/environment.c\nindex 449a46995d..52e0c979ba 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -164,7 +164,7 @@ static const char *getenv_safe(struct strvec *argv, const char *name)\n \t\treturn NULL;\n \n \tstrvec_push(argv, value);\n-\treturn argv->items[argv->nr - 1];\n+\treturn argv->v[argv->nr - 1];\n }\n \n void setup_git_env(const char *git_dir)\ndiff --git a/exec-cmd.c b/exec-cmd.c\nindex d657c025c2..eeb2ee52b8 100644\n--- a/exec-cmd.c\n+++ b/exec-cmd.c\n@@ -324,18 +324,18 @@ const char **prepare_git_cmd(struct strvec *out, const char **argv)\n {\n \tstrvec_push(out, \"git\");\n \tstrvec_pushv(out, argv);\n-\treturn out->items;\n+\treturn out->v;\n }\n \n int execv_git_cmd(const char **argv)\n {\n \tstruct strvec nargv = STRVEC_INIT;\n \n \tprepare_git_cmd(&nargv, argv);\n-\ttrace_argv_printf(nargv.items, \"trace: exec:\");\n+\ttrace_argv_printf(nargv.v, \"trace: exec:\");\n \n \t/* execvp() can only ever return if it fails */\n-\tsane_execvp(\"git\", (char **)nargv.items);\n+\tsane_execvp(\"git\", (char **)nargv.v);\n \n \ttrace_printf(\"trace: exec failed: %s\\n\", strerror(errno));\n \ndiff --git a/git.c b/git.c\nindex 0b2c5531ae..866ee11a2a 100644\n--- a/git.c\n+++ b/git.c\n@@ -357,7 +357,7 @@ static int handle_alias(int *argcp, const char ***argv)\n \t\t\tstrvec_push(&child.args, alias_string + 1);\n \t\t\tstrvec_pushv(&child.args, (*argv) + 1);\n \n-\t\t\ttrace2_cmd_alias(alias_command, child.args.items);\n+\t\t\ttrace2_cmd_alias(alias_command, child.args.v);\n \t\t\ttrace2_cmd_list_config();\n \t\t\ttrace2_cmd_list_env_vars();\n \t\t\ttrace2_cmd_name(\"_run_shell_alias_\");\n@@ -674,7 +674,7 @@ static void handle_builtin(int argc, const char **argv)\n \t\t}\n \n \t\targc++;\n-\t\targv = args.items;\n+\t\targv = args.v;\n \t}\n \n \tbuiltin = get_builtin(cmd);\n@@ -708,7 +708,7 @@ static void execv_dashed_external(const char **argv)\n \t * The code in run_command() logs trace2 child_start/child_exit\n \t * events, so we do not need to report exec/exec_result events here.\n \t */\n-\ttrace_argv_printf(cmd.args.items, \"trace: exec:\");\n+\ttrace_argv_printf(cmd.args.v, \"trace: exec:\");\n \n \t/*\n \t * If we fail because the command is not found, it is\n@@ -769,13 +769,13 @@ static int run_argv(int *argcp, const char ***argv)\n \t\t\tfor (i = 0; i < *argcp; i++)\n \t\t\t\tstrvec_push(&args, (*argv)[i]);\n \n-\t\t\ttrace_argv_printf(args.items, \"trace: exec:\");\n+\t\t\ttrace_argv_printf(args.v, \"trace: exec:\");\n \n \t\t\t/*\n \t\t\t * if we fail because the command is not found, it is\n \t\t\t * OK to return. Otherwise, we just pass along the status code.\n \t\t\t */\n-\t\t\ti = run_command_v_opt_tr2(args.items, RUN_SILENT_EXEC_FAILURE |\n+\t\t\ti = run_command_v_opt_tr2(args.v, RUN_SILENT_EXEC_FAILURE |\n \t\t\t\t\t\t  RUN_CLEAN_ON_EXIT | RUN_WAIT_AFTER_CLEAN, \"git_alias\");\n \t\t\tif (i >= 0 || errno != ENOENT)\n \t\t\t\texit(i);\ndiff --git a/graph.c b/graph.c\nindex 1d68fffa24..c128ad0cce 100644\n--- a/graph.c\n+++ b/graph.c\n@@ -355,7 +355,7 @@ struct git_graph *graph_init(struct rev_info *opt)\n \t\t\tparse_graph_colors_config(&custom_colors, string);\n \t\t\tfree(string);\n \t\t\t/* graph_set_column_colors takes a max-index, not a count */\n-\t\t\tgraph_set_column_colors(custom_colors.items,\n+\t\t\tgraph_set_column_colors(custom_colors.v,\n \t\t\t\t\t\tcustom_colors.nr - 1);\n \t\t}\n \t}\ndiff --git a/http-push.c b/http-push.c\nindex c4e3825609..6a4a43e07f 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -1931,7 +1931,7 @@ int cmd_main(int argc, const char **argv)\n \t\t\tstrvec_pushf(&commit_argv, \"^%s\",\n \t\t\t\t     oid_to_hex(&ref->old_oid));\n \t\trepo_init_revisions(the_repository, &revs, setup_git_directory());\n-\t\tsetup_revisions(commit_argv.nr, commit_argv.items, &revs, NULL);\n+\t\tsetup_revisions(commit_argv.nr, commit_argv.v, &revs, NULL);\n \t\trevs.edge_hint = 0; /* just in case */\n \n \t\t/* Generate a list of objects that need to be pushed */\ndiff --git a/ls-refs.c b/ls-refs.c\nindex e6b8c9cf8e..a1e0b473e4 100644\n--- a/ls-refs.c\n+++ b/ls-refs.c\n@@ -19,7 +19,7 @@ static int ref_match(const struct strvec *prefixes, const char *refname)\n \t\treturn 1; /* no restriction */\n \n \tfor (i = 0; i < prefixes->nr; i++) {\n-\t\tconst char *prefix = prefixes->items[i];\n+\t\tconst char *prefix = prefixes->v[i];\n \n \t\tif (starts_with(refname, prefix))\n \t\t\treturn 1;\ndiff --git a/merge.c b/merge.c\nindex bcfb9dcf8a..753e461659 100644\n--- a/merge.c\n+++ b/merge.c\n@@ -33,7 +33,7 @@ int try_merge_command(struct repository *r,\n \tfor (j = remotes; j; j = j->next)\n \t\tstrvec_push(&args, merge_argument(j->item));\n \n-\tret = run_command_v_opt(args.items, RUN_GIT_CMD);\n+\tret = run_command_v_opt(args.v, RUN_GIT_CMD);\n \tstrvec_clear(&args);\n \n \tdiscard_index(r->index);\ndiff --git a/pathspec.c b/pathspec.c\nindex 75378f49d1..7a229d8d22 100644\n--- a/pathspec.c\n+++ b/pathspec.c\n@@ -652,7 +652,7 @@ void parse_pathspec_file(struct pathspec *pathspec, unsigned magic_mask,\n \tif (in != stdin)\n \t\tfclose(in);\n \n-\tparse_pathspec(pathspec, magic_mask, flags, prefix, parsed_file.items);\n+\tparse_pathspec(pathspec, magic_mask, flags, prefix, parsed_file.v);\n \tstrvec_clear(&parsed_file);\n }\n \ndiff --git a/range-diff.c b/range-diff.c\nindex 3fa3ac6cb5..24dc435e48 100644\n--- a/range-diff.c\n+++ b/range-diff.c\n@@ -67,7 +67,7 @@ static int read_patches(const char *range, struct string_list *list,\n \t\t     \"--notes\",\n \t\t     NULL);\n \tif (other_arg)\n-\t\tstrvec_pushv(&cp.args, other_arg->items);\n+\t\tstrvec_pushv(&cp.args, other_arg->v);\n \tstrvec_push(&cp.args, range);\n \tcp.out = -1;\n \tcp.no_stdin = 1;\ndiff --git a/ref-filter.c b/ref-filter.c\nindex 5b2a7684a1..d0e6ab525c 100644\n--- a/ref-filter.c\n+++ b/ref-filter.c\n@@ -1923,9 +1923,9 @@ static void find_longest_prefixes(struct string_list *out,\n \tstruct strbuf prefix = STRBUF_INIT;\n \n \tstrvec_pushv(&sorted, patterns);\n-\tQSORT(sorted.items, sorted.nr, qsort_strcmp);\n+\tQSORT(sorted.v, sorted.nr, qsort_strcmp);\n \n-\tfind_longest_prefixes_1(out, &prefix, sorted.items, sorted.nr);\n+\tfind_longest_prefixes_1(out, &prefix, sorted.v, sorted.nr);\n \n \tstrvec_clear(&sorted);\n \tstrbuf_release(&prefix);\ndiff --git a/remote-curl.c b/remote-curl.c\nindex 8a2f461824..62b3a45cde 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -1194,7 +1194,7 @@ static int fetch_git(struct discovery *heads,\n \trpc.service_name = \"git-upload-pack\",\n \trpc.gzip_request = 1;\n \n-\terr = rpc_service(&rpc, heads, args.items, &preamble, &rpc_result);\n+\terr = rpc_service(&rpc, heads, args.v, &preamble, &rpc_result);\n \tif (rpc_result.len)\n \t\twrite_or_die(1, rpc_result.buf, rpc_result.len);\n \tstrbuf_release(&rpc_result);\n@@ -1329,7 +1329,7 @@ static int push_git(struct discovery *heads, int nr_spec, const char **specs)\n \tmemset(&rpc, 0, sizeof(rpc));\n \trpc.service_name = \"git-receive-pack\",\n \n-\terr = rpc_service(&rpc, heads, args.items, &preamble, &rpc_result);\n+\terr = rpc_service(&rpc, heads, args.v, &preamble, &rpc_result);\n \tif (rpc_result.len)\n \t\twrite_or_die(1, rpc_result.buf, rpc_result.len);\n \tstrbuf_release(&rpc_result);\n@@ -1370,7 +1370,7 @@ static void parse_push(struct strbuf *buf)\n \t\t\tbreak;\n \t} while (1);\n \n-\tret = push(specs.nr, specs.items);\n+\tret = push(specs.nr, specs.v);\n \tprintf(\"\\n\");\n \tfflush(stdout);\n \ndiff --git a/remote.c b/remote.c\nindex cc4b77ead6..d9af0018af 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -1969,7 +1969,7 @@ static int stat_branch_pair(const char *branch_name, const char *base,\n \tstrvec_push(&argv, \"--\");\n \n \trepo_init_revisions(the_repository, &revs, NULL);\n-\tsetup_revisions(argv.nr, argv.items, &revs, NULL);\n+\tsetup_revisions(argv.nr, argv.v, &revs, NULL);\n \tif (prepare_revision_walk(&revs))\n \t\tdie(_(\"revision walk setup failed\"));\n \ndiff --git a/revision.c b/revision.c\nindex 358cc77c5c..3f909604e2 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -2807,7 +2807,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s\n \t\t * }\n \t\t */\n \t\tparse_pathspec(&revs->prune_data, 0, 0,\n-\t\t\t       revs->prefix, prune_data.items);\n+\t\t\t       revs->prefix, prune_data.v);\n \t}\n \tstrvec_clear(&prune_data);\n \ndiff --git a/run-command.c b/run-command.c\nindex 26f24e4459..30f1dfe3c5 100644\n--- a/run-command.c\n+++ b/run-command.c\n@@ -287,7 +287,7 @@ static const char **prepare_shell_cmd(struct strvec *out, const char **argv)\n \t}\n \n \tstrvec_pushv(out, argv);\n-\treturn out->items;\n+\treturn out->v;\n }\n \n #ifndef GIT_WINDOWS_NATIVE\n@@ -426,11 +426,11 @@ static int prepare_cmd(struct strvec *out, const struct child_process *cmd)\n \t * there are dir separator characters, we have exec attempt to invoke\n \t * the command directly.\n \t */\n-\tif (!has_dir_sep(out->items[1])) {\n-\t\tchar *program = locate_in_PATH(out->items[1]);\n+\tif (!has_dir_sep(out->v[1])) {\n+\t\tchar *program = locate_in_PATH(out->v[1]);\n \t\tif (program) {\n-\t\t\tfree((char *)out->items[1]);\n-\t\t\tout->items[1] = program;\n+\t\t\tfree((char *)out->v[1]);\n+\t\t\tout->v[1] = program;\n \t\t} else {\n \t\t\tstrvec_clear(out);\n \t\t\terrno = ENOENT;\n@@ -672,9 +672,9 @@ int start_command(struct child_process *cmd)\n \tchar *str;\n \n \tif (!cmd->argv)\n-\t\tcmd->argv = cmd->args.items;\n+\t\tcmd->argv = cmd->args.v;\n \tif (!cmd->env)\n-\t\tcmd->env = cmd->env_array.items;\n+\t\tcmd->env = cmd->env_array.v;\n \n \t/*\n \t * In case of errors we must keep the promise to close FDs\n@@ -846,10 +846,10 @@ int start_command(struct child_process *cmd)\n \t\t * be used in the event exec failed with ENOEXEC at which point\n \t\t * we will try to interpret the command using 'sh'.\n \t\t */\n-\t\texecve(argv.items[1], (char *const *) argv.items + 1,\n+\t\texecve(argv.v[1], (char *const *) argv.v + 1,\n \t\t       (char *const *) childenv);\n \t\tif (errno == ENOEXEC)\n-\t\t\texecve(argv.items[0], (char *const *) argv.items,\n+\t\t\texecve(argv.v[0], (char *const *) argv.v,\n \t\t\t       (char *const *) childenv);\n \n \t\tif (errno == ENOENT) {\n@@ -1877,7 +1877,7 @@ int run_auto_maintenance(int quiet)\n \telse\n \t\tstrvec_push(&argv_gc_auto, \"--no-quiet\");\n \n-\tstatus = run_command_v_opt(argv_gc_auto.items, RUN_GIT_CMD);\n+\tstatus = run_command_v_opt(argv_gc_auto.v, RUN_GIT_CMD);\n \tstrvec_clear(&argv_gc_auto);\n \treturn status;\n }\ndiff --git a/sequencer.c b/sequencer.c\nindex 10c83d0914..6b1795a844 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -871,8 +871,7 @@ static const char *author_date_from_env_array(const struct strvec *env)\n \tconst char *date;\n \n \tfor (i = 0; i < env->nr; i++)\n-\t\tif (skip_prefix(env->items[i],\n-\t\t\t\t\"GIT_AUTHOR_DATE=\", &date))\n+\t\tif (skip_prefix(env->v[i], \"GIT_AUTHOR_DATE=\", &date))\n \t\t\treturn date;\n \t/*\n \t * If GIT_AUTHOR_DATE is missing we should have already errored out when\n@@ -2855,7 +2854,7 @@ static int reset_merge(const struct object_id *oid)\n \tif (!is_null_oid(oid))\n \t\tstrvec_push(&argv, oid_to_hex(oid));\n \n-\tret = run_command_v_opt(argv.items, RUN_GIT_CMD);\n+\tret = run_command_v_opt(argv.v, RUN_GIT_CMD);\n \tstrvec_clear(&argv);\n \n \treturn ret;\n@@ -3229,7 +3228,7 @@ static int do_exec(struct repository *r, const char *command_line)\n \tstrvec_pushf(&child_env, \"GIT_WORK_TREE=%s\",\n \t\t     absolute_path(get_git_work_tree()));\n \tstatus = run_command_v_opt_cd_env(child_argv, RUN_USING_SHELL, NULL,\n-\t\t\t\t\t  child_env.items);\n+\t\t\t\t\t  child_env.v);\n \n \t/* force re-reading of the cache */\n \tif (discard_index(r->index) < 0 || repo_read_index(r) < 0)\ndiff --git a/serve.c b/serve.c\nindex 0db929beff..f6341206c4 100644\n--- a/serve.c\n+++ b/serve.c\n@@ -148,7 +148,7 @@ int has_capability(const struct strvec *keys, const char *capability,\n \tint i;\n \tfor (i = 0; i < keys->nr; i++) {\n \t\tconst char *out;\n-\t\tif (skip_prefix(keys->items[i], capability, &out) &&\n+\t\tif (skip_prefix(keys->v[i], capability, &out) &&\n \t\t    (!*out || *out == '=')) {\n \t\t\tif (value) {\n \t\t\t\tif (*out == '=')\ndiff --git a/strvec.c b/strvec.c\nindex 0e17597f80..21dce0a7a4 100644\n--- a/strvec.c\n+++ b/strvec.c\n@@ -6,25 +6,25 @@ const char *empty_strvec[] = { NULL };\n \n void strvec_init(struct strvec *array)\n {\n-\tarray->items = empty_strvec;\n+\tarray->v = empty_strvec;\n \tarray->nr = 0;\n \tarray->alloc = 0;\n }\n \n static void strvec_push_nodup(struct strvec *array, const char *value)\n {\n-\tif (array->items == empty_strvec)\n-\t\tarray->items = NULL;\n+\tif (array->v == empty_strvec)\n+\t\tarray->v = NULL;\n \n-\tALLOC_GROW(array->items, array->nr + 2, array->alloc);\n-\tarray->items[array->nr++] = value;\n-\tarray->items[array->nr] = NULL;\n+\tALLOC_GROW(array->v, array->nr + 2, array->alloc);\n+\tarray->v[array->nr++] = value;\n+\tarray->v[array->nr] = NULL;\n }\n \n const char *strvec_push(struct strvec *array, const char *value)\n {\n \tstrvec_push_nodup(array, xstrdup(value));\n-\treturn array->items[array->nr - 1];\n+\treturn array->v[array->nr - 1];\n }\n \n const char *strvec_pushf(struct strvec *array, const char *fmt, ...)\n@@ -37,7 +37,7 @@ const char *strvec_pushf(struct strvec *array, const char *fmt, ...)\n \tva_end(ap);\n \n \tstrvec_push_nodup(array, strbuf_detach(&v, NULL));\n-\treturn array->items[array->nr - 1];\n+\treturn array->v[array->nr - 1];\n }\n \n void strvec_pushl(struct strvec *array, ...)\n@@ -61,8 +61,8 @@ void strvec_pop(struct strvec *array)\n {\n \tif (!array->nr)\n \t\treturn;\n-\tfree((char *)array->items[array->nr - 1]);\n-\tarray->items[array->nr - 1] = NULL;\n+\tfree((char *)array->v[array->nr - 1]);\n+\tarray->v[array->nr - 1] = NULL;\n \tarray->nr--;\n }\n \n@@ -88,21 +88,21 @@ void strvec_split(struct strvec *array, const char *to_split)\n \n void strvec_clear(struct strvec *array)\n {\n-\tif (array->items != empty_strvec) {\n+\tif (array->v != empty_strvec) {\n \t\tint i;\n \t\tfor (i = 0; i < array->nr; i++)\n-\t\t\tfree((char *)array->items[i]);\n-\t\tfree(array->items);\n+\t\t\tfree((char *)array->v[i]);\n+\t\tfree(array->v);\n \t}\n \tstrvec_init(array);\n }\n \n const char **strvec_detach(struct strvec *array)\n {\n-\tif (array->items == empty_strvec)\n+\tif (array->v == empty_strvec)\n \t\treturn xcalloc(1, sizeof(const char *));\n \telse {\n-\t\tconst char **ret = array->items;\n+\t\tconst char **ret = array->v;\n \t\tstrvec_init(array);\n \t\treturn ret;\n \t}\ndiff --git a/strvec.h b/strvec.h\nindex fda1c81c86..fdcad75b45 100644\n--- a/strvec.h\n+++ b/strvec.h\n@@ -28,7 +28,7 @@ extern const char *empty_strvec[];\n  * NULL.\n  */\n struct strvec {\n-\tconst char **items;\n+\tconst char **v;\n \tint nr;\n \tint alloc;\n };\ndiff --git a/submodule.c b/submodule.c\nindex 51fdb9c365..48d6dea78d 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -269,7 +269,7 @@ int is_submodule_active(struct repository *repo, const char *path)\n \t\t\tstrvec_push(&args, item->string);\n \t\t}\n \n-\t\tparse_pathspec(&ps, 0, 0, NULL, args.items);\n+\t\tparse_pathspec(&ps, 0, 0, NULL, args.v);\n \t\tret = match_pathspec(repo->index, &ps, path, strlen(path), 0, NULL, 1);\n \n \t\tstrvec_clear(&args);\n@@ -842,7 +842,7 @@ static void collect_changed_submodules(struct repository *r,\n \tconst struct commit *commit;\n \n \trepo_init_revisions(r, &rev, NULL);\n-\tsetup_revisions(argv->nr, argv->items, &rev, NULL);\n+\tsetup_revisions(argv->nr, argv->v, &rev, NULL);\n \tif (prepare_revision_walk(&rev))\n \t\tdie(_(\"revision walk setup failed\"));\n \n@@ -1014,7 +1014,7 @@ int find_unpushed_submodules(struct repository *r,\n \tstruct string_list_item *name;\n \tstruct strvec argv = STRVEC_INIT;\n \n-\t/* argv.items[0] will be ignored by setup_revisions */\n+\t/* argv.v[0] will be ignored by setup_revisions */\n \tstrvec_push(&argv, \"find_unpushed_submodules\");\n \toid_array_for_each_unique(commits, append_oid_to_argv, &argv);\n \tstrvec_push(&argv, \"--not\");\n@@ -1453,7 +1453,7 @@ static int get_next_submodule(struct child_process *cp,\n \t\t\t\tstrbuf_addf(err, _(\"Fetching submodule %s%s\\n\"),\n \t\t\t\t\t    spf->prefix, ce->name);\n \t\t\tstrvec_init(&cp->args);\n-\t\t\tstrvec_pushv(&cp->args, spf->args.items);\n+\t\t\tstrvec_pushv(&cp->args, spf->args.v);\n \t\t\tstrvec_push(&cp->args, default_argv);\n \t\t\tstrvec_push(&cp->args, \"--submodule-prefix\");\n \n@@ -1501,7 +1501,7 @@ static int get_next_submodule(struct child_process *cp,\n \t\tcp->dir = task->repo->gitdir;\n \n \t\tstrvec_init(&cp->args);\n-\t\tstrvec_pushv(&cp->args, spf->args.items);\n+\t\tstrvec_pushv(&cp->args, spf->args.v);\n \t\tstrvec_push(&cp->args, \"on-demand\");\n \t\tstrvec_push(&cp->args, \"--submodule-prefix\");\n \t\tstrvec_push(&cp->args, submodule_prefix.buf);\n@@ -1620,7 +1620,7 @@ int fetch_populated_submodules(struct repository *r,\n \n \tstrvec_push(&spf.args, \"fetch\");\n \tfor (i = 0; i < options->nr; i++)\n-\t\tstrvec_push(&spf.args, options->items[i]);\n+\t\tstrvec_push(&spf.args, options->v[i]);\n \tstrvec_push(&spf.args, \"--recurse-submodules-default\");\n \t/* default value, \"--submodule-prefix\" and its value are added later */\n \ndiff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c\nindex 605135be42..7ae03dc712 100644\n--- a/t/helper/test-run-command.c\n+++ b/t/helper/test-run-command.c\n@@ -275,13 +275,13 @@ static int quote_stress_test(int argc, const char **argv)\n \t\tif (i < skip)\n \t\t\tcontinue;\n \n-\t\tcp.argv = args.items;\n+\t\tcp.argv = args.v;\n \t\tstrbuf_reset(&out);\n \t\tif (pipe_command(&cp, NULL, 0, &out, 0, NULL, 0) < 0)\n \t\t\treturn error(\"Failed to spawn child process\");\n \n \t\tfor (j = 0, k = 0; j < arg_count; j++) {\n-\t\t\tconst char *arg = args.items[j + arg_offset];\n+\t\t\tconst char *arg = args.v[j + arg_offset];\n \n \t\t\tif (strcmp(arg, out.buf + k))\n \t\t\t\tret = error(\"incorrectly quoted arg: '%s', \"\n@@ -298,7 +298,7 @@ static int quote_stress_test(int argc, const char **argv)\n \t\t\tfprintf(stderr, \"Trial #%d failed. Arguments:\\n\", i);\n \t\t\tfor (j = 0; j < arg_count; j++)\n \t\t\t\tfprintf(stderr, \"arg #%d: '%s'\\n\",\n-\t\t\t\t\t(int)j, args.items[j + arg_offset]);\n+\t\t\t\t\t(int)j, args.v[j + arg_offset]);\n \n \t\t\tstrbuf_release(&out);\n \t\t\tstrvec_clear(&args);\ndiff --git a/tmp-objdir.c b/tmp-objdir.c\nindex e21bef6cca..42ed4db5d3 100644\n--- a/tmp-objdir.c\n+++ b/tmp-objdir.c\n@@ -283,7 +283,7 @@ const char **tmp_objdir_env(const struct tmp_objdir *t)\n {\n \tif (!t)\n \t\treturn NULL;\n-\treturn t->env.items;\n+\treturn t->env.v;\n }\n \n void tmp_objdir_add_as_alternate(const struct tmp_objdir *t)\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 51b72a224d..0029ba18bd 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -138,7 +138,7 @@ static struct child_process *get_helper(struct transport *transport)\n \t\tstrvec_pushf(&helper->env_array, \"%s=%s\",\n \t\t\t     GIT_DIR_ENVIRONMENT, get_git_dir());\n \n-\thelper->trace2_child_class = helper->args.items[0]; /* \"remote-<name>\" */\n+\thelper->trace2_child_class = helper->args.v[0]; /* \"remote-<name>\" */\n \n \tcode = start_command(helper);\n \tif (code < 0 && errno == ENOENT)\ndiff --git a/upload-pack.c b/upload-pack.c\nindex bf677df48c..dd37000b23 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -906,7 +906,7 @@ static int send_shallow_list(struct upload_pack_data *data)\n \t\t\tstruct object *o = data->want_obj.objects[i].item;\n \t\t\tstrvec_push(&av, oid_to_hex(&o->oid));\n \t\t}\n-\t\tdeepen_by_rev_list(data, av.nr, av.items);\n+\t\tdeepen_by_rev_list(data, av.nr, av.v);\n \t\tstrvec_clear(&av);\n \t\tret = 1;\n \t} else {\n"},{"id":"402314","messageId":"xmqqpn8fb15l.fsf@gitster.c.googlers.com","threadId":"53940","inReplyTo":"20200729003720.GA1653374@coredump.intra.peff.net","subject":"Re: [PATCH 10/11] strvec: drop argv_array compatibility layer","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-07-29T00:44:22Z","receivedAt":"2020-07-29T00:44:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Worse than the resolutions are all the new calls which needed to be\n> fixed up. I know your scripts keep a fix-up commit for this, but I don't\n> think you publish it.\n\nThey are found in refs/merge-fix/$topicname, and the broken-out\nmirror repository https://github.com/gitster/git/ should have them.\n"},{"id":"402316","messageId":"xmqqlfj3b0zy.fsf@gitster.c.googlers.com","threadId":"53940","inReplyTo":"20200729004009.GB1653374@coredump.intra.peff.net","subject":"Re: [PATCH 10/11] strvec: drop argv_array compatibility layer","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-07-29T00:47:45Z","receivedAt":"2020-07-29T00:47:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> And here's a diff between your current \"seen\" tip and what I get by\n> merging in this updated version and then doing any necessary resolution\n> or fixups on top. I'll leave it as an exercise for how you might want to\n> pull the content across. :)\n>\n> I do note that most of the new call-sites are ones that would be better\n> off using child_process.args, and reviewers (myself and others) have\n> suggested that. So those direct uses of the \"argv\" member may go away\n> anyway.\n\nYup, I do not think we should spend too much cycles on this at this\npoint, as Stolee's topic and others that add new callsites are\nlikely to be rerolled at least one more time.\n\nIt is tempting to declare that these 11 patches are now perfect and\nwe'll stop the world and fast-track it down to 'master', while\ndiscarding any and all topics in flight that changes anything\nrelated to argv-array, and then we ask authors of these discarded\ntopics to send in a rebase on top of the 'master' with strvec API\nalready in.  But I somehow think we do not have to take such a\ndrastic measure to adjust the world around this topic ;-)\n\n"},{"id":"402325","messageId":"CAP8UFD26J6W50SeQqJiG0y04kcdNzr6RRT7ZeJmrQ2V-QTS3Lg@mail.gmail.com","threadId":"53940","inReplyTo":"20200728202124.GA1021264@coredump.intra.peff.net","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2020-07-29T06:15:54Z","receivedAt":"2020-07-29T06:16:10Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Tue, Jul 28, 2020 at 10:23 PM Jeff King <peff@peff.net> wrote:\n>\n> The argv_array data type has turned out to be useful in our code base,\n> but the name isn't very good. From patch 2 of this series:\n>\n>   The name \"argv-array\" isn't very good, because it describes what the\n>   data type can be used for (program argument arrays), not what it\n>   actually is (a dynamically-growing string array that maintains a\n>   NULL-terminator invariant).\n\nI cannot help but notice that you still use \"array\" when describing\nwhat it is. You actually use \"string array\" to describe what it is,\nand at the same time say that the name should describe what it is. So\nI would expect after the above sentence that you would rename it to\n\"string_array\" or \"str_array\".\n\nIn patch 2 you also say:\n\n> I settled on \"strvec\" because \"vector\" is the name for a dynamic array\n> type in many programming languages.\n\nin which you also use \"array\" to describe it.\n\n> \"strarray\" would work, too, but it's\n> longer and a bit more awkward to say (and don't we all say these things\n> in our mind as we type them?).\n\nIt's longer than \"strarray\" by 2 characters only.\n\nAlso we still use \"array\" in \"oid_array\" which is very similar to\nthis. And the implementation is based on the ALLOC_GROW macro which\nuses the REALLOC_ARRAY macro.\n\nWe also use ALLOC_ARRAY, FLEX_ARRAY, CALLOC_ARRAY, COPY_ARRAY and\nMOVE_ARRAY macros.\n\nSo if you don't like the \"array\" part of the name, are you going to\nalso change \"oid_array\" into \"oidvec\" and for example \"REALLOC_ARRAY\"\ninto \"REALLOC_VEC\" or \"REALLOC_VECTOR\"?\n\nIf you want to change only \"argv_array\" (and not also \"oid_array\",\n\"REALLOC_ARRAY\" and perhaps other *_ARRAY macros) into something else,\nthen I think it would be better to be consistent with them.\n"},{"id":"402326","messageId":"CAP8UFD1rXJ2WcnTmjj8avnzqJauBoT9swfoF5s2Fa+JfRUvy9Q@mail.gmail.com","threadId":"53940","inReplyTo":"CAP8UFD26J6W50SeQqJiG0y04kcdNzr6RRT7ZeJmrQ2V-QTS3Lg@mail.gmail.com","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2020-07-29T06:19:34Z","receivedAt":"2020-07-29T06:19:48Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Wed, Jul 29, 2020 at 8:15 AM Christian Couder\n<christian.couder@gmail.com> wrote:\n\n> > \"strarray\" would work, too, but it's\n> > longer and a bit more awkward to say (and don't we all say these things\n> > in our mind as we type them?).\n>\n> It's longer than \"strarray\" by 2 characters only.\n\nSorry, I mean it's shorter than \"strarray\" by 2 characters only.\n"},{"id":"402327","messageId":"CAP8UFD3Z86nQq_iZ3kqvuL4Vr9PxL+71VBgd7my+YUxgFyYvXA@mail.gmail.com","threadId":"53940","inReplyTo":"xmqqmu3jcp9u.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 11/11] strvec: rename struct fields","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2020-07-29T06:55:46Z","receivedAt":"2020-07-29T06:56:01Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Tue, Jul 28, 2020 at 11:19 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n> >> I'm actually not that fond of \"items\". I almost went with just:\n> >>\n> >>   const char **v;\n> >>\n> >> as the variable name which contains it usually provides sufficient\n> >> context. But I worried that people would consider that too inscrutable.\n> >\n> > I'd agree that v[] is a good name.  If it is too short, I can live\n> > with item[], but not with items[]....\n>\n> What are individual component of a vector called?  An element?  If\n> so, elem[] would be much better name than item[].\n\nIndividual components of a string vector or a string array are\nstrings, so \"str\" if we abbreviate \"string\" to \"str\".\n\nUsing \"str\" would be consistent with oid_array where the individual\ncomponent is called \"oid\" as it is defined this way:\n\nstruct oid_array {\n        struct object_id *oid;\n        size_t nr;\n        size_t alloc;\n        int sorted;\n};\n"},{"id":"402330","messageId":"CAPig+cQEqhpu3-_wXUFjfokSuesu2a5QdiaT8ks4kPiYkUsOvw@mail.gmail.com","threadId":"53940","inReplyTo":"CAP8UFD26J6W50SeQqJiG0y04kcdNzr6RRT7ZeJmrQ2V-QTS3Lg@mail.gmail.com","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2020-07-29T13:32:36Z","receivedAt":"2020-07-29T13:32:50Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Jul 29, 2020 at 2:16 AM Christian Couder\n<christian.couder@gmail.com> wrote:\n> I would expect after the above sentence that you would rename it to\n> \"string_array\" or \"str_array\".\n> [...]\n> Also we still use \"array\" in \"oid_array\" which is very similar to\n> this. And the implementation is based on the ALLOC_GROW macro which\n> uses the REALLOC_ARRAY macro.\n>\n> We also use ALLOC_ARRAY, FLEX_ARRAY, CALLOC_ARRAY, COPY_ARRAY and\n> MOVE_ARRAY macros.\n> [...]\n> If you want to change only \"argv_array\" (and not also \"oid_array\",\n> \"REALLOC_ARRAY\" and perhaps other *_ARRAY macros) into something else,\n> then I think it would be better to be consistent with them.\n\nDipping my toe into the bikeshed paint bucket...\n\nNaming consistency is certainly a valid concern, and if this was a\npublic API I might agree that such consistency should outweigh some\nother concerns, however, this is a private, project-specific API in\nwhich convenience and concision weigh more heavily in my opinion.\nThere is value in succinctness, not just when writing code (by having\nto type less), but also when reading it, for the same reason that we\nuse short and sweet variable and function names. To wit: short, well\nchosen, idiomatic names let the structure of the code show through\n(often) at-a-glance, whereas long names force us to laboriously read\ncode, making it harder to discern the overall structure and logic.\n\nThere is also value[1] in having \"vec\" (or \"v\") in the name as opposed\nto \"array\", specifically because this isn't just an array of strings;\nit is a NULL-terminated vector of strings. Thus, it is suitable for\nfunctions which accept such a datatype, which often have \"v\" in their\nnames, as well (for instance, execv()).\n\nOn the topic of a \"terminated array\": As a NULL-terminated array of\nstrings, the name \"strvec\" provides naming consistency and fits nicely\nalongside the name \"strbuf\", a NUL-terminated array of characters,\nwhile also sharing the relative concision of that name.\n\nIn my opinion, the name \"strvec\" is a good and reasonably succinct\ncompromise between other names, such as \"strv\"[2] and \"strs\"[3],\nproposed previously. It gets my \"+1\".\n\n[1]: https://lore.kernel.org/git/20180227221808.GE11187@sigill.intra.peff.net/\n[2]: https://lore.kernel.org/git/20180227220443.GB11187@sigill.intra.peff.net/\n[3]: https://lore.kernel.org/git/CAPig+cS+G-xC51n-Ud0Wbmcc-zeHBM3-5WQQAFm9gwm9LNk3Gg@mail.gmail.com/\n"},{"id":"402333","messageId":"20200729162204.GA2320983@coredump.intra.peff.net","threadId":"53940","inReplyTo":"xmqqpn8fb15l.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 10/11] strvec: drop argv_array compatibility layer","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-29T16:22:04Z","receivedAt":"2020-07-29T16:22:07Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jul 28, 2020 at 05:44:22PM -0700, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > Worse than the resolutions are all the new calls which needed to be\n> > fixed up. I know your scripts keep a fix-up commit for this, but I don't\n> > think you publish it.\n> \n> They are found in refs/merge-fix/$topicname, and the broken-out\n> mirror repository https://github.com/gitster/git/ should have them.\n\nOh indeed. I stupidly looked in my refs/remotes, but of course I didn't\nset up a refspec to fetch them. :)\n\n-Peff\n"},{"id":"402334","messageId":"20200729163305.GB2320983@coredump.intra.peff.net","threadId":"53940","inReplyTo":"CAP8UFD26J6W50SeQqJiG0y04kcdNzr6RRT7ZeJmrQ2V-QTS3Lg@mail.gmail.com","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-29T16:33:05Z","receivedAt":"2020-07-29T16:33:08Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jul 29, 2020 at 08:15:54AM +0200, Christian Couder wrote:\n\n> On Tue, Jul 28, 2020 at 10:23 PM Jeff King <peff@peff.net> wrote:\n> >\n> > The argv_array data type has turned out to be useful in our code base,\n> > but the name isn't very good. From patch 2 of this series:\n> >\n> >   The name \"argv-array\" isn't very good, because it describes what the\n> >   data type can be used for (program argument arrays), not what it\n> >   actually is (a dynamically-growing string array that maintains a\n> >   NULL-terminator invariant).\n> \n> I cannot help but notice that you still use \"array\" when describing\n> what it is. You actually use \"string array\" to describe what it is,\n> and at the same time say that the name should describe what it is. So\n> I would expect after the above sentence that you would rename it to\n> \"string_array\" or \"str_array\".\n\nI think one thing that leads me to \"vec\" is the \"v\" from \"argv\", which\nimplies the NULL-terminator (though of course that's _not_ implied by\n\"vector\" in other languages). None of the other \"array\" types have that\nfeature, and it's an important one here.\n\n> > \"strarray\" would work, too, but it's\n> > longer and a bit more awkward to say (and don't we all say these things\n> > in our mind as we type them?).\n> \n> It's longer than \"strarray\" by 2 characters only.\n\nYeah, I agree the length between the two is not super important. Mostly\nI find it harder to read and say. That's obviously subjective, but I do\nthink counts for something.\n\nWe use an underscore for \"oid_array\" (which I think makes sense because\nit's awkward to concatenate directly a word that starts with a vowel and\nhas multiple syllables). That makes it inconsistent with oidmap and\noidset. Likewise, I was hoping for consistency with strbuf here.\n\n> Also we still use \"array\" in \"oid_array\" which is very similar to\n> this. And the implementation is based on the ALLOC_GROW macro which\n> uses the REALLOC_ARRAY macro.\n> \n> We also use ALLOC_ARRAY, FLEX_ARRAY, CALLOC_ARRAY, COPY_ARRAY and\n> MOVE_ARRAY macros.\n\nThose macro names are pretty bulky, but I think it matters a lot less\nbecause they're used a lot less. The type name here is prepended to all\nof the \"method\" functions like strvec_pushf(), etc.\n\n> So if you don't like the \"array\" part of the name, are you going to\n> also change \"oid_array\" into \"oidvec\" and for example \"REALLOC_ARRAY\"\n> into \"REALLOC_VEC\" or \"REALLOC_VECTOR\"?\n\nI hadn't planned on it, just because I think the cost of changing versus\nthe benefit is not that high. If I were designing from scratch, I'd\ndefinitely consider oidvec (but probably not REALLOC_VEC for the reasons\nabove).\n\nI think the cost of changing away from argv_array _is_ worth it, and\nonce we're doing that, we can choose between the alternatives without\npaying an extra cost.\n\n> If you want to change only \"argv_array\" (and not also \"oid_array\",\n> \"REALLOC_ARRAY\" and perhaps other *_ARRAY macros) into something else,\n> then I think it would be better to be consistent with them.\n\nI definitely sympathize with the consistency argument, and I don't think\n'str_array\" is the end of the world. But I think there are many\ndimensions of inconsistency already, so without renaming every data\nstructure, we're going to be inconsistent with something. Mostly I just\nsubjectively find strvec easier to read, say, and type, and I don't\nthink the inconsistencies are so glaring that it's a problem.\n\n-Peff\n"},{"id":"402335","messageId":"20200729163419.GC2320983@coredump.intra.peff.net","threadId":"53940","inReplyTo":"CAP8UFD3Z86nQq_iZ3kqvuL4Vr9PxL+71VBgd7my+YUxgFyYvXA@mail.gmail.com","subject":"Re: [PATCH 11/11] strvec: rename struct fields","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-29T16:34:19Z","receivedAt":"2020-07-29T16:34:22Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jul 29, 2020 at 08:55:46AM +0200, Christian Couder wrote:\n\n> > > I'd agree that v[] is a good name.  If it is too short, I can live\n> > > with item[], but not with items[]....\n> >\n> > What are individual component of a vector called?  An element?  If\n> > so, elem[] would be much better name than item[].\n> \n> Individual components of a string vector or a string array are\n> strings, so \"str\" if we abbreviate \"string\" to \"str\".\n> \n> Using \"str\" would be consistent with oid_array where the individual\n> component is called \"oid\" as it is defined this way:\n> \n> struct oid_array {\n>         struct object_id *oid;\n>         size_t nr;\n>         size_t alloc;\n>         int sorted;\n> };\n\nYeah, I agree \"str\" is a reasonable name, and probably better than\n\"elem\" or \"items\". I do still like the super-concise \"v\" better, though.\n\n-Peff\n"},{"id":"402336","messageId":"30933a71-3130-5478-cbfd-0ca5bb308cf2@gmail.com","threadId":"53940","inReplyTo":"xmqqlfj3b0zy.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 10/11] strvec: drop argv_array compatibility layer","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2020-07-29T16:54:58Z","receivedAt":"2020-07-29T16:55:02Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 7/28/20 8:47 PM, Junio C Hamano wrote:\n> Jeff King <peff@peff.net> writes:\n> \n>> And here's a diff between your current \"seen\" tip and what I get by\n>> merging in this updated version and then doing any necessary resolution\n>> or fixups on top. I'll leave it as an exercise for how you might want to\n>> pull the content across. :)\n>>\n>> I do note that most of the new call-sites are ones that would be better\n>> off using child_process.args, and reviewers (myself and others) have\n>> suggested that. So those direct uses of the \"argv\" member may go away\n>> anyway.\n> \n> Yup, I do not think we should spend too much cycles on this at this\n> point, as Stolee's topic and others that add new callsites are\n> likely to be rerolled at least one more time.\n\nYes, I immediately thought that my topic would cause some headache\nfor this conversion. However, I'm happy to rebase onto 'master' if\nthis topic is merging quickly.\n\n> It is tempting to declare that these 11 patches are now perfect and\n> we'll stop the world and fast-track it down to 'master', while\n> discarding any and all topics in flight that changes anything\n> related to argv-array, and then we ask authors of these discarded\n> topics to send in a rebase on top of the 'master' with strvec API\n> already in.  But I somehow think we do not have to take such a\n> drastic measure to adjust the world around this topic ;-)\n\nI'll keep an eye out for how you plan to resolve this.\n\nThanks,\n-Stolee\n"},{"id":"402339","messageId":"xmqqd04eb3ld.fsf@gitster.c.googlers.com","threadId":"53940","inReplyTo":"20200729163419.GC2320983@coredump.intra.peff.net","subject":"Re: [PATCH 11/11] strvec: rename struct fields","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-07-29T18:03:58Z","receivedAt":"2020-07-29T18:04:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n>> Using \"str\" would be consistent with oid_array where the individual\n>> component is called \"oid\" as it is defined this way:\n>> \n>> struct oid_array {\n>>         struct object_id *oid;\n>>         size_t nr;\n>>         size_t alloc;\n>>         int sorted;\n>> };\n>\n> Yeah, I agree \"str\" is a reasonable name, and probably better than\n> \"elem\" or \"items\". I do still like the super-concise \"v\" better, though.\n\nOne problem with names like \"str\", \"string\", and \"oid\" is that it\nleads to this stupid pattern:\n\n    struct oid_array *oid;\n    oid_to_hex(oid->oid[0], ...);\n\nWe know the thing is object name by the pointer variable having the\nname oid already---there is no need to repeat we are talking about\noid again with the field name.\n\nSo, \"str\" being consistent with \"oid_array\" is not necessarily a\nplus.\n\nUltra-concise v[] that stands for value, or e[] that stands for\nelement, do not share this problem.\n\nOne plus about the redundant field name is that it is easier to run\n\n    grep -E -e \"([.]|->)oid\"\n\nbut I do not know how important that is.\n"},{"id":"403363","messageId":"82991f30-fe37-d6d2-ffd5-8b0878f46c83@web.de","threadId":"53940","inReplyTo":"20200728202124.GA1021264@coredump.intra.peff.net","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2020-08-11T16:08:22Z","receivedAt":"2020-08-11T16:08:34Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 28.07.20 um 22:21 schrieb Jeff King:\n> The argv_array data type has turned out to be useful in our code base,\n> but the name isn't very good. From patch 2 of this series:\n>\n>   The name \"argv-array\" isn't very good, because it describes what the\n>   data type can be used for (program argument arrays), not what it\n>   actually is (a dynamically-growing string array that maintains a\n>   NULL-terminator invariant). This leads to people being hesitant to use\n>   it for other cases where it would actually be a good fit. The existing\n>   name is also clunky to use. It's overly long, and the name often leads\n>   to saying things like \"argv.argv\" (i.e., the field names overlap with\n>   variable names, since they're describing the use, not the type). Let's\n>   give it a more neutral name.\n>\n> This has bugged me for a while, so I decided to finally fix it. It\n> wasn't _too_ painful, though I'm sure there will be a little fallout\n> with topics in flight.\n\nJust as this landed in master now, https://lobste.rs/ decided to link to\nhttp://www.open-std.org/jtc1/sc22/wg14/www/docs/n2493.pdf, which is a\npaper about reserved identifiers in C.  It contains a nice overview.\n\nAnyway, 7.31 of C11 says: \"All external names described below are\nreserved no matter what headers are included by the program.\"  And\n7.31.13 goes on: \"Function names that begin with str, mem, or wcs and a\nlowercase letter may be added to the declarations in the <string.h>\nheader.\"  So the names of the strvec functions are reserved.\n\nAlso how about using Coccinelle and patience to reduce the impact of\nsuch a change next time?  I.e. adding the new thing, providing a\nsemantic patch for converting old code, waiting a reasonable amount of\ntime after the last conversion was necessary and then removing the\nold thing.\n\nRené\n"},{"id":"403371","messageId":"20200811182832.GA33865@syl.lan","threadId":"53940","inReplyTo":"82991f30-fe37-d6d2-ffd5-8b0878f46c83@web.de","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2020-08-11T18:28:32Z","receivedAt":"2020-08-11T18:28:37Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Tue, Aug 11, 2020 at 06:08:22PM +0200, René Scharfe wrote:\n> Am 28.07.20 um 22:21 schrieb Jeff King:\n> > The argv_array data type has turned out to be useful in our code base,\n> > but the name isn't very good. From patch 2 of this series:\n> >\n> >   The name \"argv-array\" isn't very good, because it describes what the\n> >   data type can be used for (program argument arrays), not what it\n> >   actually is (a dynamically-growing string array that maintains a\n> >   NULL-terminator invariant). This leads to people being hesitant to use\n> >   it for other cases where it would actually be a good fit. The existing\n> >   name is also clunky to use. It's overly long, and the name often leads\n> >   to saying things like \"argv.argv\" (i.e., the field names overlap with\n> >   variable names, since they're describing the use, not the type). Let's\n> >   give it a more neutral name.\n> >\n> > This has bugged me for a while, so I decided to finally fix it. It\n> > wasn't _too_ painful, though I'm sure there will be a little fallout\n> > with topics in flight.\n>\n> Just as this landed in master now, https://lobste.rs/ decided to link to\n> http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2493.pdf, which is a\n> paper about reserved identifiers in C.  It contains a nice overview.\n>\n> Anyway, 7.31 of C11 says: \"All external names described below are\n> reserved no matter what headers are included by the program.\"  And\n> 7.31.13 goes on: \"Function names that begin with str, mem, or wcs and a\n> lowercase letter may be added to the declarations in the <string.h>\n> header.\"  So the names of the strvec functions are reserved.\n>\n> Also how about using Coccinelle and patience to reduce the impact of\n> such a change next time?  I.e. adding the new thing, providing a\n> semantic patch for converting old code, waiting a reasonable amount of\n> time after the last conversion was necessary and then removing the\n> old thing.\n\nI don't think that this is a bad idea at all, but I'm also totally fine\nwith the approach that Peff took here. (Bear in mind that I'm saying\nthis as someone who didn't have any topics that used argv_array, and so\ndidn't have to do any conversion effort ;-)).\n\nI worry a little bit about providing too long a grace period where we\nhave to worry about not introducing new uses of argv_array, and still\nhaving to deal with some (perhaps less) fall-out later down the line.\n\nFor this change, I think it was perfectly fine to just rip the bandaid\noff.\n\n> René\n\nThanks,\nTaylor\n"},{"id":"403378","messageId":"xmqqk0y59fdg.fsf@gitster.c.googlers.com","threadId":"53940","inReplyTo":"82991f30-fe37-d6d2-ffd5-8b0878f46c83@web.de","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-08-11T19:00:59Z","receivedAt":"2020-08-11T19:01:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"René Scharfe <l.s.r@web.de> writes:\n\n> 7.31.13 goes on: \"Function names that begin with str, mem, or wcs and a\n> lowercase letter may be added to the declarations in the <string.h>\n> header.\"  So the names of the strvec functions are reserved.\n\nUgh, strbuf functions are reserved, too?\n"},{"id":"403388","messageId":"CA+P7+xq_eGaGNXd+0Ggxzofa5M_uESVXDaA-0ktH34fuONya0g@mail.gmail.com","threadId":"53940","inReplyTo":"xmqqk0y59fdg.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2020-08-11T20:39:03Z","receivedAt":"2020-08-11T20:39:17Z","isPatch":true,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Tue, Aug 11, 2020 at 12:02 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> René Scharfe <l.s.r@web.de> writes:\n>\n> > 7.31.13 goes on: \"Function names that begin with str, mem, or wcs and a\n> > lowercase letter may be added to the declarations in the <string.h>\n> > header.\"  So the names of the strvec functions are reserved.\n>\n> Ugh, strbuf functions are reserved, too?\n\nAt least that paper is proposing a better solution in the long term...\n"},{"id":"403406","messageId":"xmqqpn7w99or.fsf@gitster.c.googlers.com","threadId":"53940","inReplyTo":"CA+P7+xq_eGaGNXd+0Ggxzofa5M_uESVXDaA-0ktH34fuONya0g@mail.gmail.com","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-08-11T21:03:48Z","receivedAt":"2020-08-11T21:03:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jacob Keller <jacob.keller@gmail.com> writes:\n\n> On Tue, Aug 11, 2020 at 12:02 PM Junio C Hamano <gitster@pobox.com> wrote:\n>>\n>> René Scharfe <l.s.r@web.de> writes:\n>>\n>> > 7.31.13 goes on: \"Function names that begin with str, mem, or wcs and a\n>> > lowercase letter may be added to the declarations in the <string.h>\n>> > header.\"  So the names of the strvec functions are reserved.\n>>\n>> Ugh, strbuf functions are reserved, too?\n>\n> At least that paper is proposing a better solution in the long term...\n\nI am not sure what the \"potentially\" really buys to our fellow\ndevelopers.  At least we are not folks \"targeting a specific version\nof the standard\"; we care about the future standards, too X-<.\n"},{"id":"403443","messageId":"nycvar.QRO.7.76.6.2008121441570.50@tvgsbejvaqbjf.bet","threadId":"53940","inReplyTo":"xmqqk0y59fdg.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-08-12T12:42:41Z","receivedAt":"2020-08-12T12:43:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 11 Aug 2020, Junio C Hamano wrote:\n\n> René Scharfe <l.s.r@web.de> writes:\n>\n> > 7.31.13 goes on: \"Function names that begin with str, mem, or wcs and a\n> > lowercase letter may be added to the declarations in the <string.h>\n> > header.\"  So the names of the strvec functions are reserved.\n>\n> Ugh, strbuf functions are reserved, too?\n\nWe could try to implement the very patient approach proposed by René and\nrename `strbuf` to `git_buf` :-)\n\nCiao,\nDscho\n"},{"id":"403459","messageId":"20200812150611.GA33189@coredump.intra.peff.net","threadId":"53940","inReplyTo":"82991f30-fe37-d6d2-ffd5-8b0878f46c83@web.de","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-08-12T15:06:11Z","receivedAt":"2020-08-12T15:06:15Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Aug 11, 2020 at 06:08:22PM +0200, René Scharfe wrote:\n\n> > This has bugged me for a while, so I decided to finally fix it. It\n> > wasn't _too_ painful, though I'm sure there will be a little fallout\n> > with topics in flight.\n> \n> Just as this landed in master now, https://lobste.rs/ decided to link to\n> http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2493.pdf, which is a\n> paper about reserved identifiers in C.  It contains a nice overview.\n> \n> Anyway, 7.31 of C11 says: \"All external names described below are\n> reserved no matter what headers are included by the program.\"  And\n> 7.31.13 goes on: \"Function names that begin with str, mem, or wcs and a\n> lowercase letter may be added to the declarations in the <string.h>\n> header.\"  So the names of the strvec functions are reserved.\n\nIt was the same in C99. I think this is one of those cases where we need\nto worry less about what the standard says and more about what the real\nworld does. As long as we're ready for C25 or whatever to add \"strvec\"\nand we accept that we'll need to change the name then, I'm not\nparticularly concerned. A compiler that starts warning about \"str\"\nfunctions in the meantime would be impractical I think (forget strbuf,\nstuff like strip_extension() would be illegal).\n\n> Also how about using Coccinelle and patience to reduce the impact of\n> such a change next time?  I.e. adding the new thing, providing a\n> semantic patch for converting old code, waiting a reasonable amount of\n> time after the last conversion was necessary and then removing the\n> old thing.\n\nSo I almost sent a rant about Coccinelle along with this series. :)\n\nDebian unstable now ships coccinelle 1.0.8, and it's unbelievably slow\ncompared to 1.0.4. Running \"make coccicheck\" is currently at 80 minutes\nof CPU time running each script in parallel, with none of them down.\nThey're also all consuming 6GB of RAM each, so I'm killing them all.\n\nI got somewhere similar when I was working on this series, got fed up,\nand then just did the whole thing with grep, which was easier. I'm open\nto the idea that a slower transition might have helped topics in flight\ncatch up, but it also would have prolonged the pain. So I dunno.\n\n-Peff\n"},{"id":"403461","messageId":"20200812151038.GB33189@coredump.intra.peff.net","threadId":"53940","inReplyTo":"20200812150611.GA33189@coredump.intra.peff.net","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-08-12T15:10:38Z","receivedAt":"2020-08-12T15:10:41Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Aug 12, 2020 at 11:06:11AM -0400, Jeff King wrote:\n\n> Debian unstable now ships coccinelle 1.0.8, and it's unbelievably slow\n> compared to 1.0.4. Running \"make coccicheck\" is currently at 80 minutes\n> of CPU time running each script in parallel, with none of them down.\n> They're also all consuming 6GB of RAM each, so I'm killing them all.\n\nThis seems to be related to setting SPATCH_BATCH_SIZE to \"0\". It used to make\nthings go much faster (if you had enough memory), but now seems to just\nconsume tons of CPU. Setting it to \"1\" finishes the whole thing in ~13\nminutes of CPU (~2m wall-clock).\n\nSo that's at least a path forward, but in general I have been frustrated\nwith operational aspects of coccinelle like this.\n\n-Peff\n"},{"id":"403468","messageId":"045ea49b-7165-0f45-e670-a24bf648f880@web.de","threadId":"53940","inReplyTo":"20200812151038.GB33189@coredump.intra.peff.net","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2020-08-12T16:23:01Z","receivedAt":"2020-08-12T16:23:09Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 12.08.20 um 17:10 schrieb Jeff King:\n> On Wed, Aug 12, 2020 at 11:06:11AM -0400, Jeff King wrote:\n>\n>> Debian unstable now ships coccinelle 1.0.8, and it's unbelievably slow\n>> compared to 1.0.4. Running \"make coccicheck\" is currently at 80 minutes\n>> of CPU time running each script in parallel, with none of them down.\n>> They're also all consuming 6GB of RAM each, so I'm killing them all.\n>\n> This seems to be related to setting SPATCH_BATCH_SIZE to \"0\". It used to make\n> things go much faster (if you had enough memory), but now seems to just\n> consume tons of CPU. Setting it to \"1\" finishes the whole thing in ~13\n> minutes of CPU (~2m wall-clock).\n\nThis bit me as well, and I settled with SPATCH_BATCH_SIZE = 10.  With\nMAKEFLAGS += -j3 I get these number, which are quite similar to yours\n(except I don't dare use more cores due to cooling issues..):\n\n  real\t4m12,393s\n  user\t12m15,447s\n  sys\t0m10,418s\n\n> So that's at least a path forward, but in general I have been frustrated\n> with operational aspects of coccinelle like this.\n\nAnd I was a bit shocked when Coccinelle's testing package became\nunmaintained for a while and I had to compile it from source.\n\nAnd yes, coccicheck is quite heavy.  When I merge all .cocci files into\none I get:\n\n  real\t2m7,164s\n  user\t2m5,389s\n  sys\t0m1,572s\n\nNice.  With spatch -j3 I get basically the same numbers, though.  Hmm.\n\nRené\n"},{"id":"403475","messageId":"20200812170849.GA43566@coredump.intra.peff.net","threadId":"53940","inReplyTo":"045ea49b-7165-0f45-e670-a24bf648f880@web.de","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-08-12T17:08:49Z","receivedAt":"2020-08-12T17:08:53Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Aug 12, 2020 at 06:23:01PM +0200, René Scharfe wrote:\n\n> > This seems to be related to setting SPATCH_BATCH_SIZE to \"0\". It used to make\n> > things go much faster (if you had enough memory), but now seems to just\n> > consume tons of CPU. Setting it to \"1\" finishes the whole thing in ~13\n> > minutes of CPU (~2m wall-clock).\n> \n> This bit me as well, and I settled with SPATCH_BATCH_SIZE = 10.  With\n> MAKEFLAGS += -j3 I get these number, which are quite similar to yours\n> (except I don't dare use more cores due to cooling issues..):\n> \n>   real\t4m12,393s\n>   user\t12m15,447s\n>   sys\t0m10,418s\n\nInterestingly, that was slower for me (2m47s wall-clock, with 27m of\nCPU). Using \"2\" is slightly faster than \"1\". But \"3\" is a little less\nfast, and \"4\" is slower than \"1\". So...no clue what is going on.\n\n> > So that's at least a path forward, but in general I have been frustrated\n> > with operational aspects of coccinelle like this.\n> \n> And I was a bit shocked when Coccinelle's testing package became\n> unmaintained for a while and I had to compile it from source.\n\nYeah, I've had various issues with the packaging. For a long time they\nhad 1.0.7 in experimental, but with no python support. I wonder if it's\nworth starting to use python scriptlets in our coccinelle rules, as\ndescribed in 4d168e742a (coccinelle: use <...> for function exclusion,\n2018-08-28). They're faster and IMHO easier to understand.\n\nOf course I tried it out and got some inscrutable errors:\n\n  SPATCH contrib/coccinelle/object_id.cocci\n  init_defs_builtins: /usr/bin/../lib/coccinelle/standard.h\n  Python path configuration:\n    PYTHONHOME = '/lib/x86_64-linux-gnu/..'\n    PYTHONPATH = '/usr/bin/../lib/coccinelle/python'\n    program name = 'python3'\n    isolated = 0\n    environment = 1\n    user site = 1\n    import site = 1\n    sys._base_executable = '/usr/bin/python3'\n    sys.base_prefix = '/lib/x86_64-linux-gnu/..'\n    sys.base_exec_prefix = '/lib/x86_64-linux-gnu/..'\n    sys.executable = '/usr/bin/python3'\n    sys.prefix = '/lib/x86_64-linux-gnu/..'\n    sys.exec_prefix = '/lib/x86_64-linux-gnu/..'\n    sys.path = [\n      '/usr/bin/../lib/coccinelle/python',\n      '/lib/x86_64-linux-gnu/../lib/python38.zip',\n      '/lib/x86_64-linux-gnu/../lib/python3.8',\n      '/lib/x86_64-linux-gnu/../lib/python3.8/lib-dynload',\n    ]\n  Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding\n  Python runtime state: core initialized\n  ModuleNotFoundError: No module named 'encodings'\n\nFun.\n\n-Peff\n"},{"id":"403481","messageId":"13d0b147-3c62-5d73-630e-2305c08c3ab1@web.de","threadId":"53940","inReplyTo":"20200812170849.GA43566@coredump.intra.peff.net","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2020-08-12T18:18:33Z","receivedAt":"2020-08-12T18:18:41Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 12.08.20 um 19:08 schrieb Jeff King:\n> Yeah, I've had various issues with the packaging. For a long time they\n> had 1.0.7 in experimental, but with no python support. I wonder if it's\n> worth starting to use python scriptlets in our coccinelle rules, as\n> described in 4d168e742a (coccinelle: use <...> for function exclusion,\n> 2018-08-28). They're faster and IMHO easier to understand.\n\nThe idea to use Python as a faster alternative to anything makes me\na bit uneasy.  That can't be right. ;-)\n\n> Of course I tried it out and got some inscrutable errors:\n>\n>   SPATCH contrib/coccinelle/object_id.cocci\n>   init_defs_builtins: /usr/bin/../lib/coccinelle/standard.h\n>   Python path configuration:\n>     PYTHONHOME = '/lib/x86_64-linux-gnu/..'\n\nThis looks bogus.  Can you try to unset this environment variable?\nOr set it to \"/usr\"?\n\n>     PYTHONPATH = '/usr/bin/../lib/coccinelle/python'\n>     program name = 'python3'\n>     isolated = 0\n>     environment = 1\n>     user site = 1\n>     import site = 1\n>     sys._base_executable = '/usr/bin/python3'\n>     sys.base_prefix = '/lib/x86_64-linux-gnu/..'\n>     sys.base_exec_prefix = '/lib/x86_64-linux-gnu/..'\n>     sys.executable = '/usr/bin/python3'\n>     sys.prefix = '/lib/x86_64-linux-gnu/..'\n>     sys.exec_prefix = '/lib/x86_64-linux-gnu/..'\n>     sys.path = [\n>       '/usr/bin/../lib/coccinelle/python',\n>       '/lib/x86_64-linux-gnu/../lib/python38.zip',\n>       '/lib/x86_64-linux-gnu/../lib/python3.8',\n>       '/lib/x86_64-linux-gnu/../lib/python3.8/lib-dynload',\n>     ]\n>   Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding\n>   Python runtime state: core initialized\n>   ModuleNotFoundError: No module named 'encodings'\n\nI got this instead:\n\n-- snip --\ninit_defs_builtins: /usr/bin/../lib/coccinelle/standard.h\nPy.find_library: unable to find the Python library [libpython3.8m.so returned Library not found] [/usr/bin/../lib/libpython3.8m.so returned Library not found] [libpython3.8.so returned Library not found] [/usr/bin/../lib/libpython3.8.so returned Library not found]\n-- snap --\n\nThen I did \"sudo ln -s libpython3.8.so.1.0 libpython3.8.so\" in\n/usr/lib/x86_64-linux-gnu, and now it seems to be happy.\n\nRené\n"},{"id":"403500","messageId":"20200812195703.GA1340519@coredump.intra.peff.net","threadId":"53940","inReplyTo":"13d0b147-3c62-5d73-630e-2305c08c3ab1@web.de","subject":"Re: [PATCH 0/11] renaming argv_array","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-08-12T19:57:03Z","receivedAt":"2020-08-12T19:57:05Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Aug 12, 2020 at 08:18:33PM +0200, René Scharfe wrote:\n\n> Am 12.08.20 um 19:08 schrieb Jeff King:\n> > Yeah, I've had various issues with the packaging. For a long time they\n> > had 1.0.7 in experimental, but with no python support. I wonder if it's\n> > worth starting to use python scriptlets in our coccinelle rules, as\n> > described in 4d168e742a (coccinelle: use <...> for function exclusion,\n> > 2018-08-28). They're faster and IMHO easier to understand.\n> \n> The idea to use Python as a faster alternative to anything makes me\n> a bit uneasy.  That can't be right. ;-)\n\nWell, when you're comparing it to some exponential algorithm with the\nother technique, even a scripted language can do well. :)\n\nI definitely remember getting big speedups back at the time of that\ncommit. But applying the patch below, building object_id.cocci.patch\nactually gets a few seconds slower. So maybe something changed between\nthe various coccinelle versions. At any rate, it doesn't seem worth\npursuing further.\n\n> > Of course I tried it out and got some inscrutable errors:\n> >\n> >   SPATCH contrib/coccinelle/object_id.cocci\n> >   init_defs_builtins: /usr/bin/../lib/coccinelle/standard.h\n> >   Python path configuration:\n> >     PYTHONHOME = '/lib/x86_64-linux-gnu/..'\n> \n> This looks bogus.  Can you try to unset this environment variable?\n> Or set it to \"/usr\"?\n\nIt's not set in my environment. However, I was able to solve it by\nfiddling with my system python packages (I'm not sure of the exact\ncause; it was a case of corrected-while-testing).\n\n-Peff\n"}]}