]> git.ipfire.org Git - thirdparty/git.git/commit - daemon.c
run-command API: rename "env_array" to "env"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 2 Jun 2022 09:09:50 +0000 (11:09 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Jun 2022 21:31:16 +0000 (14:31 -0700)
commit29fda24dd11e90583f3ea9ff2f90ee9acacd7792
tree392cb2d6d8bc054c3f6101714dd61ce36a6239ff
parent07330a41d66a2c9589b585a3a24ecdcf19994f19
run-command API: rename "env_array" to "env"

Start following-up on the rename mentioned in c7c4bdeccf3 (run-command
API: remove "env" member, always use "env_array", 2021-11-25) of
"env_array" to "env".

The "env_array" name was picked in 19a583dc39e (run-command: add
env_array, an optional argv_array for env, 2014-10-19) because "env"
was taken. Let's not forever keep the oddity of "*_array" for this
"struct strvec", but not for its "args" sibling.

This commit is almost entirely made with a coccinelle rule[1]. The
only manual change here is in run-command.h to rename the struct
member itself and to change "env_array" to "env" in the
CHILD_PROCESS_INIT initializer.

The rest of this is all a result of applying [1]:

 * make contrib/coccinelle/run_command.cocci.patch
 * patch -p1 <contrib/coccinelle/run_command.cocci.patch
 * git add -u

1. cat contrib/coccinelle/run_command.pending.cocci
   @@
   struct child_process E;
   @@
   - E.env_array
   + E.env

   @@
   struct child_process *E;
   @@
   - E->env_array
   + E->env

I've avoided changing any comments and derived variable names here,
that will all be done in the next commit.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
24 files changed:
add-patch.c
branch.c
builtin/difftool.c
builtin/receive-pack.c
builtin/stash.c
builtin/submodule--helper.c
builtin/worktree.c
connect.c
connected.c
daemon.c
editor.c
hook.c
http-backend.c
object-file.c
pager.c
promisor-remote.c
run-command.c
run-command.h
sequencer.c
submodule.c
t/helper/test-run-command.c
trailer.c
transport-helper.c
wt-status.c