git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* What's cooking in git.git (Dec 2021, #04; Wed, 15)
@ 2021-12-16  2:32 Junio C Hamano
  2021-12-16 11:51 ` ab/run-command (was: What's cooking in git.git (Dec 2021, #04; Wed, 15)) Ævar Arnfjörð Bjarmason
                   ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Junio C Hamano @ 2021-12-16  2:32 UTC (permalink / raw)
  To: git

Unfortunately, the number of topics in the "undecided" category is
creeping upwards since the previous issues of the report.

Here are the topics that have been cooking in my tree.  Commits
prefixed with '+' are in 'next' (being in 'next' is a sign that a
topic is stable enough to be used and are candidate to be in a
future release).  Commits prefixed with '-' are only in 'seen',
which means nothing more than that I have found them of interest for
some reason (like "it may have hard-to-resolve conflicts with
another topic already in flight" or "this may turn out to be
useful").  Do not read too much into a topic being in (or not in)
'seen'.  The ones marked with '.' do not appear in any of the
integration branches, but I am still holding onto them.

Copies of the source code to Git live in many repositories, and the
following is a list of the ones I push into or their mirrors.  Some
repositories have only a subset of branches.

With maint, master, next, seen, todo:

	git://git.kernel.org/pub/scm/git/git.git/
	git://repo.or.cz/alt-git.git/
	https://kernel.googlesource.com/pub/scm/git/git/
	https://github.com/git/git/
	https://gitlab.com/git-vcs/git/

With all the integration branches and topics broken out:

	https://github.com/gitster/git/

Even though the preformatted documentation in HTML and man format
are not sources, they are published in these repositories for
convenience (replace "htmldocs" with "manpages" for the manual
pages):

	git://git.kernel.org/pub/scm/git/git-htmldocs.git/
	https://github.com/gitster/git-htmldocs.git/

Release tarballs are available at:

	https://www.kernel.org/pub/software/scm/git/

--------------------------------------------------
[Graduated to 'master']

* ab/ci-updates (2021-11-23) 5 commits
  (merged to 'next' on 2021-12-07 at 1d855a6b33)
 + CI: don't run "make test" twice in one job
 + CI: use "$runs_on_pool", not "$jobname" to select packages & config
 + CI: rename the "Linux32" job to lower-case "linux32"
 + CI: use shorter names that fit in UX tooltips
 + CI: remove Travis CI support

 Drop support for TravisCI and update test workflows at GitHub.
 source: <cover-v4-0.5-00000000000-20211123T134300Z-avarab@gmail.com>


* ab/die-with-bug (2021-12-07) 4 commits
  (merged to 'next' on 2021-12-08 at 9b7440fafd)
 + object.c: use BUG(...) no die("BUG: ...") in lookup_object_by_type()
 + pathspec: use BUG(...) not die("BUG:%s:%d....", <file>, <line>)
 + strbuf.h: use BUG(...) not die("BUG: ...")
 + pack-objects: use BUG(...) not die("BUG: ...")

 Code clean-up.
 source: <cover-v2-0.4-00000000000-20211207T110440Z-avarab@gmail.com>


* ab/mark-leak-free-tests-even-more (2021-11-01) 15 commits
  (merged to 'next' on 2021-12-03 at 1d8c342dab)
 + leak tests: mark some fast-import tests as passing with SANITIZE=leak
 + leak tests: mark some config tests as passing with SANITIZE=leak
 + leak tests: mark some status tests as passing with SANITIZE=leak
 + leak tests: mark some clone tests as passing with SANITIZE=leak
 + leak tests: mark some add tests as passing with SANITIZE=leak
 + leak tests: mark some diff tests as passing with SANITIZE=leak
 + leak tests: mark some apply tests as passing with SANITIZE=leak
 + leak tests: mark some notes tests as passing with SANITIZE=leak
 + leak tests: mark some update-index tests as passing with SANITIZE=leak
 + leak tests: mark some rev-parse tests as passing with SANITIZE=leak
 + leak tests: mark some rev-list tests as passing with SANITIZE=leak
 + leak tests: mark some misc tests as passing with SANITIZE=leak
 + leak tests: mark most gettext tests as passing with SANITIZE=leak
 + leak tests: mark "sort" test as passing SANITIZE=leak
 + leak tests: mark a read-tree test as passing SANITIZE=leak

 More tests are marked as leak-free.
 source: <cover-00.15-00000000000-20211030T221945Z-avarab@gmail.com>


* ab/parse-options-cleanup (2021-11-10) 1 commit
  (merged to 'next' on 2021-12-08 at f9a2ceb9f6)
 + parse-options.c: use "enum parse_opt_result" for parse_nodash_opt()

 Change the type of an internal function to return an enum (instead
 of int) and replace -2 that was used to signal an error with -1.
 source: <patch-v2-1.1-376f76bb44e-20211110T012523Z-avarab@gmail.com>


* ab/run-command (2021-11-25) 9 commits
  (merged to 'next' on 2021-12-07 at 5c0bedf853)
 + run-command API: remove "env" member, always use "env_array"
 + difftool: use "env_array" to simplify memory management
 + run-command API: remove "argv" member, always use "args"
 + run-command API users: use strvec_push(), not argv construction
 + run-command API users: use strvec_pushl(), not argv construction
 + run-command tests: use strvec_pushv(), not argv assignment
 + run-command API users: use strvec_pushv(), not argv assignment
 + upload-archive: use regular "struct child_process" pattern
 + worktree: stop being overly intimate with run_command() internals

 API clean-up.
 cf. <211130.86k0gpcpy2.gmgdl@evledraar.gmail.com>
 cf. <CAPig+cSvFgJTiq8pXrWy_7ukQwE1y9ZGwMgKmyjWuQHdNGxiDQ@mail.gmail.com>
 source: <cover-v3-0.9-00000000000-20211125T224833Z-avarab@gmail.com>


* ds/sparse-deep-pattern-checkout-fix (2021-12-06) 2 commits
  (merged to 'next' on 2021-12-07 at 7b7f74216a)
 + unpack-trees: use traverse_path instead of name
 + t1092: add deeper changes during a checkout

 The sparse-index/sparse-checkout feature had a bug in its use of
 the matching code to determine which path is in or outside the
 sparse checkout patterns.
 source: <pull.1092.v2.git.1638799837.gitgitgadget@gmail.com>


* ds/trace2-regions-in-tests (2021-11-29) 2 commits
  (merged to 'next' on 2021-12-07 at ebf31cbaad)
 + t/t*: remove custom GIT_TRACE2_EVENT_NESTING
 + test-lib.sh: set GIT_TRACE2_EVENT_NESTING

 The default setting for trace2 event nesting was too low to cause
 test failures, which is worked around by bumping it up in the test
 framework.
 source: <pull.1085.git.1638193666.gitgitgadget@gmail.com>


* en/zdiff3 (2021-12-01) 2 commits
  (merged to 'next' on 2021-12-07 at baa3b24593)
 + update documentation for new zdiff3 conflictStyle
 + xdiff: implement a zealous diff3, or "zdiff3"

 "Zealous diff3" style of merge conflict presentation has been added.
 source: <pull.1036.v5.git.git.1638317108.gitgitgadget@gmail.com>


* es/doc-stdout-vs-stderr (2021-12-04) 1 commit
  (merged to 'next' on 2021-12-07 at d6487c1256)
 + CodingGuidelines: document which output goes to stdout vs. stderr

 Coding guideline document has been updated to clarify what goes to
 standard error in our system.
 source: <20211202223110.22062-1-sunshine@sunshineco.com>


* es/pretty-describe-more (2021-11-01) 3 commits
  (merged to 'next' on 2021-12-07 at e7862a34c8)
 + pretty: add abbrev option to %(describe)
 + pretty: add tag option to %(describe)
 + pretty.c: rework describe options parsing for better extensibility

 Extend "git log --format=%(describe)" placeholder to allow passing
 selected command-line options to the underlying "git describe"
 command.
 source: <20211031171510.1646396-1-eschwartz@archlinux.org>


* es/worktree-chatty-to-stderr (2021-12-04) 2 commits
  (merged to 'next' on 2021-12-07 at 84ba7de37c)
 + git-worktree.txt: add missing `-v` to synopsis for `worktree list`
 + worktree: send "chatty" messages to stderr

 "git worktree add" showed "Preparing worktree" message to the
 standard output stream, but when it failed, the message from die()
 went to the standard error stream.  Depending on the order the
 stdio streams are flushed at the program end, this resulted in
 confusing output.  It has been corrected by sending all the chatty
 messages to the standard error stream.
 source: <20211203034420.47447-1-sunshine@sunshineco.com>


* ew/cbtree-remove-unused-and-broken-cb-unlink (2021-12-07) 1 commit
  (merged to 'next' on 2021-12-07 at e37b4e16d0)
 + cbtree: remove broken and unused cb_unlink

 Code clean-up.
 source: <20211207183810.688481-1-e@80x24.org>


* ew/test-wo-fsync (2021-10-29) 1 commit
  (merged to 'next' on 2021-12-08 at 4b90e4870a)
 + tests: disable fsync everywhere

 Allow running our tests while disabling fsync.
 Received a lukewarm reactions overall.  Perhaps we should drop instead?
 source: <20211029001552.GA29647@dcvr>


* fs/test-prereq (2021-12-01) 3 commits
  (merged to 'next' on 2021-12-07 at fc8a8e0006)
 + test-lib: make BAIL_OUT() work in tests and prereq
 + test-lib: introduce required prereq for test runs
 + test-lib: show missing prereq summary

 The test framework learns to list unsatisfied test prerequisites,
 and optionally error out when prerequisites that are expected to be
 satisfied are not.
 source: <20211201085315.576865-1-fs@gigacodes.de>


* hn/allow-bogus-oid-in-ref-tests (2021-12-07) 8 commits
  (merged to 'next' on 2021-12-08 at 8fb70ef68b)
 + t1430: create valid symrefs using test-helper
 + t1430: remove refs using test-tool
 + refs: introduce REF_SKIP_REFNAME_VERIFICATION flag
 + refs: introduce REF_SKIP_OID_VERIFICATION flag
 + refs: update comment.
 + test-ref-store: plug memory leak in cmd_delete_refs
 + test-ref-store: parse symbolic flag constants
 + test-ref-store: remove force-create argument for create-reflog

 The test helper for refs subsystem learned to write bogus and/or
 nonexistent object name to refs to simulate error situations we
 want to test Git in.
 source: <pull.1147.v4.git.git.1638884300.gitgitgadget@gmail.com>


* hn/reflog-tests (2021-12-02) 5 commits
  (merged to 'next' on 2021-12-07 at 84d4e4b211)
 + refs/debug: trim trailing LF from reflog message
 + test-ref-store: tweaks to for-each-reflog-ent format
 + t1405: check for_each_reflog_ent_reverse() more thoroughly
 + test-ref-store: don't add newline to reflog message
 + show-branch: show reflog message

 Prepare tests on ref API to help testing reftable backends.
 source: <pull.1145.v3.git.git.1638466593.gitgitgadget@gmail.com>


* hn/reftable (2021-10-08) 19 commits
  (merged to 'next' on 2021-12-03 at 767ec5d9b3)
 + Add "test-tool dump-reftable" command.
 + reftable: add dump utility
 + reftable: implement stack, a mutable database of reftable files.
 + reftable: implement refname validation
 + reftable: add merged table view
 + reftable: add a heap-based priority queue for reftable records
 + reftable: reftable file level tests
 + reftable: read reftable files
 + reftable: generic interface to tables
 + reftable: write reftable files
 + reftable: a generic binary tree implementation
 + reftable: reading/writing blocks
 + Provide zlib's uncompress2 from compat/zlib-compat.c
 + reftable: (de)serialization for the polymorphic record type.
 + reftable: add blocksource, an abstraction for random access reads
 + reftable: utility functions
 + reftable: add error related functionality
 + reftable: add LICENSE
 + hash.h: provide constants for the hash IDs
 (this branch is used by hn/reftable-coverity-fixes.)

 The "reftable" backend for the refs API, without integrating into
 the refs subsystem, has been added.
 source: <pull.1081.v4.git.git.1633638315.gitgitgadget@gmail.com>


* hn/t1404-df-limitation-is-ref-files-only (2021-11-29) 1 commit
  (merged to 'next' on 2021-12-07 at 074438a4ba)
 + t1404: mark directory/file conflict tests with REFFILES

 Test update.
 source: <pull.1148.v2.git.git.1638210022966.gitgitgadget@gmail.com>


* jc/reflog-iterator-callback-doc (2021-11-28) 1 commit
  (merged to 'next' on 2021-12-08 at ba5693952d)
 + refs: document callback for reflog-ent iterators

 Document the parameters given to the reflog entry iterator callback
 functions.
 source: <xmqqk0gs5bgw.fsf@gitster.g>


* js/test-initial-branch-override-cleanup (2021-12-05) 1 commit
  (merged to 'next' on 2021-12-07 at 0ab3e72b4f)
 + tests: set GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME only when needed

 Many tests that used to need GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 mechanism to force "git" to use 'master' as the default name for
 the initial branch no longer need it; the use of the mechanism from
 them have been removed.
 source: <pull.1089.git.1638524353230.gitgitgadget@gmail.com>


* re/color-default-reset (2021-10-28) 3 commits
  (merged to 'next' on 2021-12-08 at ab3ff50ce2)
 + color: allow colors to be prefixed with "reset"
 + color: support "default" to restore fg/bg color
 + color: add missing GIT_COLOR_* white/black constants

 "default" and "reset" colors have been added to our palette.
 Seems to have stalled, but I am OK to merge it as-is.
 cf. <881B4747-B0B5-459B-B673-06972275A8B8@gmail.com>
 source: <pull.1117.git.git.1635210227532.gitgitgadget@gmail.com>
 source: <pull.1116.git.git.1635201156.gitgitgadget@gmail.com>


* rj/receive-pack-avoid-sigpipe-during-status-reporting (2021-11-10) 1 commit
  (merged to 'next' on 2021-12-07 at 91039a781e)
 + receive-pack: ignore SIGPIPE while reporting status to client

 When the "git push" command is killed while the receiving end is
 trying to report what happened to the ref update proposals, the
 latter used to die, due to SIGPIPE.  The code now ignores SIGPIPE
 to increase our chances to run the post-receive hook after it
 happens.
 source: <20211110092942.1648429-1-robin@jarry.cc>


* tb/pack-revindex-on-disk-cleanup (2021-12-04) 1 commit
  (merged to 'next' on 2021-12-07 at 912c270b70)
 + packfile: make `close_pack_revindex()` static

 Code clean-up.
 source: <dad2b73c84f1c1575a6bce04a449ee1236680b10.1638658219.git.me@ttaylorr.com>

--------------------------------------------------
[New Topics]

* es/chainlint (2021-12-13) 15 commits
  (merged to 'next' on 2021-12-15 at 49b7a37334)
 + chainlint.sed: stop splitting "(..." into separate lines "(" and "..."
 + chainlint.sed: swallow comments consistently
 + chainlint.sed: stop throwing away here-doc tags
 + chainlint.sed: don't mistake `<< word` in string as here-doc operator
 + chainlint.sed: make here-doc "<<-" operator recognition more POSIX-like
 + chainlint.sed: drop subshell-closing ">" annotation
 + chainlint.sed: drop unnecessary distinction between ?!AMP?! and ?!SEMI?!
 + chainlint.sed: tolerate harmless ";" at end of last line in block
 + chainlint.sed: improve ?!SEMI?! placement accuracy
 + chainlint.sed: improve ?!AMP?! placement accuracy
 + t/Makefile: optimize chainlint self-test
 + t/chainlint/one-liner: avoid overly intimate chainlint.sed knowledge
 + t/chainlint/*.test: generalize self-test commentary
 + t/chainlint/*.test: fix invalid test cases due to mixing quote types
 + t/chainlint/*.test: don't use invalid shell syntax

 The chainlint test script linter in the test suite has been updated.

 Will merge to 'master'.
 source: <20211213063059.19424-1-sunshine@sunshineco.com>


* jh/p4-rcs-expansion-in-bytestring (2021-12-13) 4 commits
 - git-p4: resolve RCS keywords in binary
 - git-p4: add raw option to read_pipelines
 - git-p4: pre-compile RCS keyword regexes
 - git-p4: use with statements to close files after use in patchRCSKeywords

 The RCS keyword substitution in "git p4" used to be done assuming
 that the contents are UTF-8 text, which can trigger decoding
 errors.  We now treat the contents as a bytestring for robustness
 and correctness.

 Will merge to 'next'?
 source: <20211213225441.1865782-1-jholdsworth@nvidia.com>


* jz/apply-quiet-and-allow-empty (2021-12-13) 2 commits
  (merged to 'next' on 2021-12-15 at e3f643eaa3)
 + git-apply: add --allow-empty flag
 + git-apply: add --quiet flag

 "git apply" has been taught to ignore a message without a patch
 with the "--allow-empty" option.  It also learned to honor the
 "--quiet" option given from the command line.

 Will merge to 'master'.
 source: <20211213220327.16042-2-jerry@skydio.com>


* ds/sparse-checkout-malformed-pattern-fix (2021-12-15) 3 commits
 - sparse-checkout: refuse to add to bad patterns
 - sparse-checkout: fix OOM error with mixed patterns
 - sparse-checkout: fix segfault on malformed patterns

 source: <pull.1069.v3.git.1639575968.gitgitgadget@gmail.com>


* gc/branch-recurse-submodules (2021-12-15) 6 commits
 - branch.c: replace questionable exit() codes
 - branch: add --recurse-submodules option for branch creation
 - builtin/branch: clean up action-picking logic in cmd_branch()
 - branch: remove forward declaration of validate_branch_start()
 - branch: move --set-upstream-to behavior to setup_tracking()
 - Merge branch 'js/branch-track-inherit' into gc/branch-recurse-submodules
 (this branch uses js/branch-track-inherit.)

 source: <20211209184928.71413-1-chooglen@google.com>


* jk/ssh-signing-doc-markup-fix (2021-12-15) 1 commit
 - doc/config: mark ssh allowedSigners example as literal

 source: <YboWlOG3vZD/7Osx@coredump.intra.peff.net>


* jv/use-larger-buffer-in-upload-pack (2021-12-15) 1 commit
 - upload-pack.c: increase output buffer size

 source: <20211214194626.33814-1-jacob@gitlab.com>

--------------------------------------------------
[Stalled]

* cb/save-term-across-editor-invocation (2021-12-01) 3 commits
 - fixup! editor: allow for saving/restoring terminal state
 - editor: allow for saving/restoring terminal state
 - terminal: teach save_term to fail when not foreground

 Some editors are reported to leave the terminal in funny state
 after they exit on Windows.  Work it around by saving and restoring
 the terminal state when needed.

 Expecting a reroll.
 cf. <CAPUEsphktbdxeV7hvF52Or3CVHS8oOk5-WV=xfEZa8kfCVVnVg@mail.gmail.com>
 source: <20211202035446.1154-1-carenas@gmail.com>


* ar/submodule-update (2021-10-13) 9 commits
 . submodule--helper: rename helper functions
 . submodule--helper: remove unused helpers
 . submodule: move core cmd_update() logic to C
 . submodule--helper: run update using child process struct
 . submodule--helper: allow setting superprefix for init_submodule()
 . submodule--helper: refactor get_submodule_displaypath()
 . submodule--helper: rename helpers for update-clone
 . submodule--helper: get remote names from any repository
 . submodule--helper: split up ensure_core_worktree()

 Rewrite of "git submodule update" in C.

 Expecting a reroll?
 cf. <YWiXL+plA7GHfuVv@google.com>
 source: <20211013051805.45662-10-raykar.ath@gmail.com>

--------------------------------------------------
[Cooking]

* en/sparse-checkout-set (2021-12-15) 10 commits
 - clone: avoid using deprecated `sparse-checkout init`
 - Documentation: clarify/correct a few sparsity related statements
 - git-sparse-checkout.txt: update to document init/set/reapply changes
 - sparse-checkout: enable reapply to take --[no-]{cone,sparse-index}
 - sparse-checkout: enable `set` to initialize sparse-checkout mode
 - sparse-checkout: split out code for tweaking settings config
 - sparse-checkout: disallow --no-stdin as an argument to set
 - sparse-checkout: add sanity-checks on initial sparsity state
 - sparse-checkout: break apart functions for sparse_checkout_(set|add)
 - sparse-checkout: pass use_stdin as a parameter instead of as a global

 The "init" and "set" subcommands in "git sparse-checkout" have been
 unified for a better user experience and performance.

 Will merge to 'next'.
 source: <pull.1151.v4.git.git.1639454952.gitgitgadget@gmail.com>


* hn/reftable-coverity-fixes (2021-12-15) 13 commits
 - reftable: make reftable_record a tagged union
 - reftable: handle null refnames in reftable_ref_record_equal
 - reftable: drop stray printf in readwrite_test
 - reftable: order unittests by complexity
 - reftable: all xxx_free() functions accept NULL arguments
 - reftable: fix resource warning
 - reftable: ignore remove() return value in stack_test.c
 - reftable: check reftable_stack_auto_compact() return value
 - reftable: fix resource leak blocksource.c
 - reftable: fix resource leak in block.c error path
 - reftable: fix OOB stack write in print functions
 - Merge branch 'hn/create-reflog-simplify' into hn/reftable-coverity-fixes
 - Merge branch 'hn/reftable' into hn/reftable-coverity-fixes

 Problems identified by Coverity in the reftable code have been
 corrected.

 Will merge to 'next'?
 source: <pull.1152.v4.git.git.1639482476.gitgitgadget@gmail.com>


* jk/limit-developers-to-gnu99 (2021-12-08) 2 commits
  (merged to 'next' on 2021-12-15 at 6b40e01445)
 + config.mak.dev: specify -std=gnu99 for gcc/clang
 + Merge branch 'bc/require-c99' into jk/limit-developers-to-gnu99

 Enable -std=gnu99 option in DEVELOPER builds.

 Will merge to 'master'.
 source: <YbEMnksMEuAz3Nt0@coredump.intra.peff.net>


* tb/midx-bitmap-corruption-fix (2021-12-15) 9 commits
 - fixup! midx: read `RIDX` chunk when present
 - midx: read `RIDX` chunk when present
 - t/lib-bitmap.sh: parameterize tests over reverse index source
 - t5326: move tests to t/lib-bitmap.sh
 - t5326: extract `test_rev_exists`
 - t5326: drop unnecessary setup
 - pack-revindex.c: instrument loading on-disk reverse index
 - midx.c: make changing the preferred pack safe
 - t5326: demonstrate bitmap corruption after permutation

 A bug that made multi-pack bitmap and the object order out-of-sync
 (hence the .midx data gets corrupted) has been fixed.
 source: <cover.1639446906.git.me@ttaylorr.com>


* es/test-chain-lint (2021-12-13) 19 commits
 - t6000-t9999: detect and signal failure within loop
 - t5000-t5999: detect and signal failure within loop
 - t4000-t4999: detect and signal failure within loop
 - t0000-t3999: detect and signal failure within loop
 - tests: simplify by dropping unnecessary `for` loops
 - tests: apply modern idiom for exiting loop upon failure
 - tests: apply modern idiom for signaling test failure
 - tests: fix broken &&-chains in `{...}` groups
 - tests: fix broken &&-chains in `$(...)` command substitutions
 - tests: fix broken &&-chains in compound statements
 - tests: use test_write_lines() to generate line-oriented output
 - tests: simplify construction of large blocks of text
 - t9107: use shell parameter expansion to avoid breaking &&-chain
 - t6300: make `%(raw:size) --shell` test more robust
 - t5516: drop unnecessary subshell and command invocation
 - t4202: clarify intent by creating expected content less cleverly
 - t1020: avoid aborting entire test script when one test fails
 - t1010: fix unnoticed failure on Windows
 - t/lib-pager: use sane_unset() to avoid breaking &&-chain

 Broken &&-chains in the test scripts have been corrected.

 Will merge to 'next'.
 source: <20211209051115.52629-1-sunshine@sunshineco.com>


* jc/flex-array-definition (2021-12-08) 1 commit
 - flex-array: simplify compiler-specific workaround

 The conditions to choose different definitions of the FLEX_ARRAY
 macro for vendor compilers has been simplified to make it easier to
 maintain.

 Will merge to 'next'?
 source: <pull.1094.git.1638823724410.gitgitgadget@gmail.com>


* pw/fix-some-issues-in-reset-head (2021-12-08) 14 commits
 - rebase -m: don't fork git checkout
 - rebase --apply: set ORIG_HEAD correctly
 - rebase --apply: fix reflog
 - reset_head(): take struct rebase_head_opts
 - rebase: cleanup reset_head() calls
 - reset_head(): make default_reflog_action optional
 - reset_head(): factor out ref updates
 - create_autostash(): remove unneeded parameter
 - reset_head(): remove action parameter
 - rebase --apply: don't run post-checkout hook if there is an error
 - rebase: do not remove untracked files on checkout
 - rebase: pass correct arguments to post-checkout hook
 - t5403: refactor rebase post-checkout hook tests
 - rebase: factor out checkout for up to date branch

 Fix "some issues" in a helper function reset_head().
 source: <pull.1049.v2.git.1638975481.gitgitgadget@gmail.com>


* je/http-better-error-output (2021-12-03) 1 commit
 . http-backend: give a hint that web browser access is not supported

 When the http-backend program, which is the server-side component
 for the smart HTTP transport, sends a "404 Not found" error, we
 deliberately did not say anything to the requesting client.  We now
 send a message back to the browser to tell the user that they do
 not want to visit the URL via their browser, instead of a totally
 blank page.

 Expecting a reroll.
 Breaks its self tests.
 cf. <7r23s082-o3q0-479o-srqn-r45q778s5nq7@vanv.qr>
 source: <20211202102855.23907-1-jengelh@inai.de>


* en/name-rev-shorter-output (2021-12-04) 1 commit
  (merged to 'next' on 2021-12-10 at ae8ec3912f)
 + name-rev: prefer shorter names over following merges

 "git name-rev" has been tweaked to give output that is shorter and
 easier to understand.

 Will merge to 'master'.
 source: <pull.1119.git.git.1636762454792.gitgitgadget@gmail.com>


* en/rebase-x-wo-git-dir-env (2021-12-04) 1 commit
  (merged to 'next' on 2021-12-07 at 44f2663314)
 + sequencer: do not export GIT_DIR and GIT_WORK_TREE for 'exec'

 "git rebase -x" by mistake started exporting the GIT_DIR and
 GIT_WORK_TREE environment variables when the command was rewritten
 in C, which has been corrected.

 Will merge to 'master'.
 source: <pull.1134.v3.git.git.1638596219656.gitgitgadget@gmail.com>


* ja/i18n-similar-messages (2021-12-05) 10 commits
 - i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom"
 - i18n: factorize "--foo outside a repository"
 - i18n: refactor "unrecognized %(foo) argument" strings
 - i18n: factorize "no directory given for --foo"
 - i18n: factorize "--foo requires --bar" and the like
 - i18n: tag.c factorize i18n strings
 - i18n: standardize "cannot open" and "cannot read"
 - i18n: turn "options are incompatible" into "are mutually exclusive"
 - i18n: refactor "%s, %s and %s are mutually exclusive"
 - i18n: refactor "foo and bar are mutually exclusive"

 Similar message templates have been consolidated so that
 translators need to work on fewer number of messages.

 Needs review.
 source: <pull.1088.git.1638514909.gitgitgadget@gmail.com>


* ab/usage-die-message (2021-12-07) 6 commits
 - config API: use get_error_routine(), not vreportf()
 - usage.c + gc: add and use a die_message_errno()
 - gc: return from cmd_gc(), don't call exit()
 - usage.c API users: use die_message() for error() + exit 128
 - usage.c API users: use die_message() for "fatal :" + exit 128
 - usage.c: add a die_message() routine

 Code clean-up to hide vreportf() from public API.

 Needs review.
 source: <cover-v2-0.6-00000000000-20211207T182419Z-avarab@gmail.com>


* ab/common-main-cleanup (2021-12-07) 1 commit
  (merged to 'next' on 2021-12-15 at ff08c86f65)
 + common-main.c: call exit(), don't return

 Code clean-up.

 Will merge to 'master'.
 source: <patch-v2-1.1-4f52ecc94ba-20211207T101207Z-avarab@gmail.com>


* ab/fetch-set-upstream-while-detached (2021-12-07) 1 commit
  (merged to 'next' on 2021-12-15 at d0406f880a)
 + pull, fetch: fix segfault in --set-upstream option

 "git fetch --set-upstream" did not check if there is a current
 branch, leading to a segfault when it is run on a detached HEAD,
 which has been corrected.

 Will merge to 'master'.
 source: <patch-v5-1.1-69ab40d623b-20211207T215115Z-avarab@gmail.com>


* ab/cat-file (2021-12-08) 10 commits
 - cat-file: use GET_OID_ONLY_TO_DIE in --(textconv|filters)
 - object-name.c: don't have GET_OID_ONLY_TO_DIE imply *_QUIETLY
 - cat-file: correct and improve usage information
 - cat-file: fix remaining usage bugs
 - cat-file: make --batch-all-objects a CMDMODE
 - cat-file: move "usage" variable to cmd_cat_file()
 - cat-file docs: fix SYNOPSIS and "-h" output
 - parse-options API: add a usage_msg_optf()
 - cat-file tests: test messaging on bad objects/paths
 - cat-file tests: test bad usage

 Assorted updates to "git cat-file", especially "-h".
 source: <cover-v4-00.10-00000000000-20211208T123151Z-avarab@gmail.com>


* ab/grep-patterntype (2021-12-04) 7 commits
 - grep: simplify config parsing and option parsing
 - grep API: call grep_config() after grep_init()
 - grep.c: don't pass along NULL callback value
 - built-ins: trust the "prefix" from run_builtin()
 - grep tests: add missing "grep.patternType" config test
 - log tests: check if grep_config() is called by "log"-like cmds
 - grep.h: remove unused "regex_t regexp" from grep_opt

 Some code clean-up in the "git grep" machinery.

 Needs review.
 source: <cover-v4-0.7-00000000000-20211203T101348Z-avarab@gmail.com>


* js/use-builtin-add-i (2021-12-01) 2 commits
 - add -i: default to the built-in implementation
 - t2016: require the PERL prereq only when necessary

 "git add -i" was rewritten in C some time ago and has been in
 testing; the reimplementation is now exposed to general public by
 default.

 On hold.
 There are known breakages on macOS.
 cf. <nycvar.QRO.7.76.6.2112021832060.63@tvgsbejvaqbjf.bet>
 source: <pull.1087.git.1638281655.gitgitgadget@gmail.com>


* jt/conditional-config-on-remote-url (2021-12-15) 2 commits
 - config: include file if remote URL matches a glob
 - config: make git_config_include() static

 The conditional inclusion mechanism of configuration files using
 "[includeIf <condition>]" learns to base its decision on the
 URL of the remote repository the repository interacts with.
 source: <cover.1639509048.git.jonathantanmy@google.com>


* tb/cruft-packs (2021-11-29) 17 commits
 - sha1-file.c: don't freshen cruft packs
 - builtin/gc.c: conditionally avoid pruning objects via loose
 - builtin/repack.c: add cruft packs to MIDX during geometric repack
 - builtin/repack.c: use named flags for existing_packs
 - builtin/repack.c: allow configuring cruft pack generation
 - builtin/repack.c: support generating a cruft pack
 - builtin/pack-objects.c: --cruft with expiration
 - reachable: report precise timestamps from objects in cruft packs
 - reachable: add options to add_unseen_recent_objects_to_traversal
 - builtin/pack-objects.c: --cruft without expiration
 - builtin/pack-objects.c: return from create_object_entry()
 - t/helper: add 'pack-mtimes' test-tool
 - pack-mtimes: support writing pack .mtimes files
 - chunk-format.h: extract oid_version()
 - pack-write: pass 'struct packing_data' to 'stage_tmp_packfiles'
 - pack-mtimes: support reading .mtimes files
 - Documentation/technical: add cruft-packs.txt

 Instead of leaving unreachable objects in loose form when packing,
 or ejecting them into loose form when repacking, gather them in a
 packfile with an auxiliary file that records the last-use time of
 these objects.

 Expecting a reroll.
 source: <cover.1638224692.git.me@ttaylorr.com>


* jk/log-decorate-opts-with-implicit-decorate (2021-12-01) 2 commits
  (merged to 'next' on 2021-12-10 at 80585b2755)
 + log: load decorations with --simplify-by-decoration
 + log: handle --decorate-refs with userformat "%d"

 When "git log" implicitly enabled the "decoration" processing
 without being explicitly asked with "--decorate" option, it failed
 to read and honor the settings given by the "--decorate-refs"
 option.

 Will merge to 'master'.
 source: <YahbseXEC66dK0k8@coredump.intra.peff.net>


* jl/subtree-check-parents-argument-passing-fix (2021-12-05) 1 commit
 - subtree: fix argument handling in check_parents

 Fix performance-releated bug in "git subtree" (in contrib/).

 Expecting a reroll.
 cf. <nycvar.QRO.7.76.6.2112072243310.90@tvgsbejvaqbjf.bet>
 source: <pull.1086.v3.git.1638758742741.gitgitgadget@gmail.com>


* ab/ambiguous-object-name (2021-11-26) 6 commits
 - object-name: re-use "struct strbuf" in show_ambiguous_object()
 - object-name: iterate ambiguous objects before showing header
 - object-name: show date for ambiguous tag objects
 - object-name: make ambiguous object output translatable
 - object-name: explicitly handle OBJ_BAD in show_ambiguous_object()
 - object-name tests: add tests for ambiguous object blind spots

 Error output given in response to an ambiguous object name has been
 improved.

 Needs review.
 An earlier iteration that was much smaller had seen some reviews,
 but the latest round enlarged its scope and needs to be reviewed
 afresh.
 source: <patch-v5-6.6-78bb0995f08-20211125T215529Z-avarab@gmail.com>


* jc/grep-patterntype-default-doc (2021-12-05) 1 commit
  (merged to 'next' on 2021-12-10 at e46385ad9d)
 + grep: clarify what `grep.patternType=default` means

 Doc update.

 Will merge to 'master'.
 source: <xmqqy24ykdel.fsf_-_@gitster.g>


* en/keep-cwd (2021-12-09) 11 commits
 - t2501: simplify the tests since we can now assume desired behavior
 - dir: new flag to remove_dir_recurse() to spare the original_cwd
 - dir: avoid incidentally removing the original_cwd in remove_path()
 - stash: do not attempt to remove startup_info->original_cwd
 - rebase: do not attempt to remove startup_info->original_cwd
 - clean: do not attempt to remove startup_info->original_cwd
 - symlinks: do not include startup_info->original_cwd in dir removal
 - unpack-trees: add special cwd handling
 - unpack-trees: refuse to remove startup_info->original_cwd
 - setup: introduce startup_info->original_cwd
 - t2501: add various tests for removing the current working directory

 Many git commands that deal with working tree files try to remove a
 directory that becomes empty (i.e. "git switch" from a branch that
 has the directory to another branch that does not would attempt
 remove all files in the directory and the directory itself).  This
 drops users into an unfamiliar situation if the command was run in
 a subdirectory that becomes subject to removal due to the command.
 The commands have been taught to keep an empty directory if it is
 the directory they were started in to avoid surprising users.

 Will merge to 'next'?
 source: <pull.1140.v6.git.git.1639026515.gitgitgadget@gmail.com>


* tl/ls-tree-oid-only (2021-12-15) 1 commit
 - ls-tree.c: support `--object-only` option for "git-ls-tree"

 "git ls-tree" learns "--oid-only" option, similar to "--name-only".

 Expecting a reroll.
 source: <cover.1638891420.git.dyroneteng@gmail.com>


* ab/make-dependency (2021-11-18) 24 commits
 - Makefile: move ".SUFFIXES" rule to shared.mak
 - Makefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES)
 - Makefile: disable GNU make built-in wildcard rules
 - Makefile: use $(file) I/O instead of "FORCE" when possible
 - Makefile: correct the dependency graph of hook-list.h
 - Makefiles: add and use wildcard "mkdir -p" template
 - Makefile: use $(wspfx) for $(QUIET...) in shared.mak
 - Makefile: add "$(QUIET)" boilerplate to shared.mak
 - Makefile: add a "TRACK_template" for GIT-*{FLAGS,DEFINES,...}
 - Makefile: re-add and use the "shellquote" macros
 - Makefile: move $(comma), $(empty) and $(space) to shared.mak
 - Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to it
 - Makefile: stop needing @@GIT_VERSION@@ in *.perl scripts
 - Makefile: create a GIT-PYTHON-DEFINES, like "PERL"
 - Makefile: correct "GIT-PERL-{DEFINES,HEADER}" dependency graph
 - Makefile: adjust Perl-related comments & whitespace
 - Makefile: change "ifndef NO_PERL" to "ifdef NO_PERL"
 - Makefile: guard Perl-only variable assignments
 - Makefile: remove "mv $@ $@+" dance redundant to .DELETE_ON_ERROR
 - Makefile: clean perl/build/ even with NO_PERL=Y
 - Makefile: use "=" not ":=" for po/* and perl/*
 - Makefile: don't set up "perl/build" rules under NO_PERL=Y
 - Makefile: don't invoke msgfmt with --statistics
 - Merge branch 'ab/sh-retire-helper-functions' into ab/make-dependency

 Dependency clean-up.

 Needs review.
 There are some comments on earlier rounds; the latest one needs a
 serious review or at least Acks from past commentors.
 source: <patch-v4-23.23-48a3927d972-20211117T101807Z-avarab@gmail.com>


* ds/fetch-pull-with-sparse-index (2021-12-08) 6 commits
 . test-read-cache: remove --table, --expand options
 . t1091/t3705: remove 'test-tool read-cache --table'
 . t1092: replace 'read-cache --table' with 'ls-files --sparse'
 . ls-files: add --sparse option
 . fetch/pull: use the sparse index
 . Merge branch 'ld/sparse-diff-blame' into ds/fetch-pull-with-sparse-index
 (this branch uses ld/sparse-diff-blame.)

 "git fetch" and "git pull" are now declared sparse-index clean.
 Also "git ls-files" learns the "--sparse" option to help debugging.

 Ejected from 'seen', as it seems to fail its self-test.
 source: <pull.1080.v2.git.1638992395.gitgitgadget@gmail.com>


* fs/ssh-signing-other-keytypes (2021-11-19) 2 commits
  (merged to 'next' on 2021-12-10 at 2d0c8cb8e6)
 + ssh signing: make sign/amend test more resilient
 + ssh signing: support non ssh-* keytypes

 The cryptographic signing using ssh keys can specify literal keys
 for keytypes whose name do not begin with the "ssh-" prefix by
 using the "key::" prefix mechanism (e.g. "key::ecdsa-sha2-nistp256").

 Will merge to 'master'.
 source: <20211119150707.3924636-1-fs@gigacodes.de>


* pw/xdiff-classify-record-in-histogram (2021-12-04) 6 commits
  (merged to 'next' on 2021-12-07 at 8cdad7bc9a)
 + xdiff: drop unused flags parameter from recs_match
 + xdiff: drop xpparam_t parameter from histogram cmp_recs()
 + xdiff: drop CMP_ENV macro from xhistogram
  (merged to 'next' on 2021-12-02 at 5ccd12d09b)
 + xdiff: simplify comparison
 + xdiff: avoid unnecessary memory allocations
 + diff histogram: intern strings

 "diff --histogram" optimization.

 Will merge to 'master'.
 source: <Yammtm+pIkMu43zZ@coredump.intra.peff.net>
 source: <pull.1079.git.1637148025.gitgitgadget@gmail.com>


* xw/am-empty (2021-12-07) 3 commits
 - am: support --allow-empty to record specific empty patches
 - am: support --empty=<option> to handle empty patches
 - doc: git-format-patch: describe the option --always

 "git am" learns "--empty=(die|drop|keep)" option to tweak what is
 done to a piece of e-mail without a patch in it.

 Almost there.
 source: <pull.1076.v18.git.1638939946.gitgitgadget@gmail.com>


* jc/c99-var-decl-in-for-loop (2021-12-03) 1 commit
  (merged to 'next' on 2021-12-03 at 57100223b2)
 + revision: use C99 declaration of variable in for() loop

 Weather balloon to find compilers that do not grok variable
 declaration in the for() loop.

 Will merge to 'master'.
 source: <xmqqpmr2j5lq.fsf_-_@gitster.g>


* ak/protect-any-current-branch (2021-12-01) 8 commits
  (merged to 'next' on 2021-12-10 at dd2c6a557c)
 + branch: protect branches checked out in all worktrees
 + receive-pack: protect current branch for bare repository worktree
 + receive-pack: clean dead code from update_worktree()
 + fetch: protect branches checked out in all worktrees
 + worktree: simplify find_shared_symref() memory ownership model
 + branch: lowercase error messages
 + receive-pack: lowercase error messages
 + fetch: lowercase error messages

 "git fetch" without the "--update-head-ok" option ought to protect
 a checked out branch from getting updated, to prevent the working
 tree that checks it out to go out of sync.  The code was written
 before the use of "git worktree" got widespread, and only checked
 the branch that was checked out in the current worktree, which has
 been updated.
 (originally called ak/fetch-not-overwrite-any-current-branch)

 Will merge to 'master'.
 source: <20211201221547.1796213-1-andersk@mit.edu>


* pw/diff-color-moved-fix (2021-12-09) 15 commits
 - diff --color-moved: intern strings
 - diff: use designated initializers for emitted_diff_symbol
 - diff --color-moved-ws=allow-indentation-change: improve hash lookups
 - diff --color-moved: stop clearing potential moved blocks
 - diff --color-moved: shrink potential moved blocks as we go
 - diff --color-moved: unify moved block growth functions
 - diff --color-moved: call comparison function directly
 - diff --color-moved-ws=allow-indentation-change: simplify and optimize
 - diff: simplify allow-indentation-change delta calculation
 - diff --color-moved: avoid false short line matches and bad zebra coloring
 - diff --color-moved=zebra: fix alternate coloring
 - diff --color-moved: rewind when discarding pmb
 - diff --color-moved: factor out function
 - diff --color-moved: clear all flags on blocks that are too short
 - diff --color-moved: add perf tests

 Correctness and performance update to "diff --color-moved" feature.

 Will merge to 'next'.
 source: <pull.981.v5.git.1639045809.gitgitgadget@gmail.com>


* fs/ssh-signing-key-lifetime (2021-12-09) 9 commits
  (merged to 'next' on 2021-12-10 at d5e7bd8b79)
 + ssh signing: verify ssh-keygen in test prereq
 + ssh signing: make fmt-merge-msg consider key lifetime
 + ssh signing: make verify-tag consider key lifetime
 + ssh signing: make git log verify key lifetime
 + ssh signing: make verify-commit consider key lifetime
 + ssh signing: add key lifetime test prereqs
 + ssh signing: use sigc struct to pass payload
 + t/fmt-merge-msg: make gpgssh tests more specific
 + t/fmt-merge-msg: do not redirect stderr

 Extend the signing of objects with SSH keys and learn to pay
 attention to the key validity time range when verifying.

 Will merge to 'master'.
 source: <20211209085249.13587-1-fs@gigacodes.de>


* jc/doc-submitting-patches-choice-of-base (2021-10-25) 2 commits
 - (wip) reword the final review part
 - SubmittingPatchs: clarify choice of base and testing

 Extend the guidance to choose the base commit to build your work
 on, and hint/nudge contributors to read others' changes.

 Expecting a reroll.
 Stalled after one incremental update suggestion.
 cf. <xmqqa6ix2g6a.fsf@gitster.g>
 source: <xmqqa6izcwio.fsf_-_@gitster.g>


* ab/config-based-hooks-2 (2021-11-24) 18 commits
 - run-command: remove old run_hook_{le,ve}() hook API
 - receive-pack: convert push-to-checkout hook to hook.h
 - read-cache: convert post-index-change to use hook.h
 - commit: convert {pre-commit,prepare-commit-msg} hook to hook.h
 - git-p4: use 'git hook' to run hooks
 - send-email: use 'git hook run' for 'sendemail-validate'
 - git hook run: add an --ignore-missing flag
 - hooks: convert worktree 'post-checkout' hook to hook library
 - hooks: convert non-worktree 'post-checkout' hook to hook library
 - merge: convert post-merge to use hook.h
 - am: convert applypatch-msg to use hook.h
 - rebase: convert pre-rebase to use hook.h
 - hook API: add a run_hooks_l() wrapper
 - am: convert {pre,post}-applypatch to use hook.h
 - gc: use hook library for pre-auto-gc hook
 - hook API: add a run_hooks() wrapper
 - hook: add 'run' subcommand
 - Merge branch 'ab/config-based-hooks-1' into ab/config-based-hooks-2

 More "config-based hooks".

 Needs review.
 At this point, as Ævar and Emily both read the major part of this
 series, a final and quick read-over plus an Ack by Emily on her
 part plus a serious review on the patches attributed to Ævar by
 somebody other than Ævar would be sufficient to move it in some
 direction (hopefully forward).
 source: <cover-v5-00.17-00000000000-20211123T114206Z-avarab@gmail.com>


* js/branch-track-inherit (2021-12-15) 3 commits
 - config: require lowercase for branch.autosetupmerge
 - branch: add flags and config to inherit tracking
 - branch: accept multiple upstream branches for tracking
 (this branch is used by gc/branch-recurse-submodules.)

 "git -c branch.autosetupmerge=inherit branch new old" makes "new"
 to have the same upstream as the "old" branch, instead of marking
 "old" itself as its upstream.
 source: <cover.1639524556.git.steadmon@google.com>


* jh/builtin-fsmonitor-part2 (2021-10-21) 29 commits
 - t7527: test status with untracked-cache and fsmonitor--daemon
 - fsmonitor: force update index after large responses
 - fsmonitor--daemon: use a cookie file to sync with file system
 - fsmonitor--daemon: periodically truncate list of modified files
 - t/perf/p7519: add fsmonitor--daemon test cases
 - t/perf/p7519: speed up test on Windows
 - t/helper/test-chmtime: skip directories on Windows
 - t/perf: avoid copying builtin fsmonitor files into test repo
 - t7527: create test for fsmonitor--daemon
 - t/helper/fsmonitor-client: create IPC client to talk to FSMonitor Daemon
 - help: include fsmonitor--daemon feature flag in version info
 - fsmonitor--daemon: implement handle_client callback
 - compat/fsmonitor/fsm-listen-darwin: implement FSEvent listener on MacOS
 - compat/fsmonitor/fsm-listen-darwin: add macos header files for FSEvent
 - compat/fsmonitor/fsm-listen-win32: implement FSMonitor backend on Windows
 - fsmonitor--daemon: create token-based changed path cache
 - fsmonitor--daemon: define token-ids
 - fsmonitor--daemon: add pathname classification
 - fsmonitor--daemon: implement 'start' command
 - fsmonitor--daemon: implement 'run' command
 - compat/fsmonitor/fsm-listen-darwin: stub in backend for Darwin
 - compat/fsmonitor/fsm-listen-win32: stub in backend for Windows
 - fsmonitor--daemon: implement 'stop' and 'status' commands
 - fsmonitor--daemon: add a built-in fsmonitor daemon
 - fsmonitor: document builtin fsmonitor
 - fsmonitor: use IPC to query the builtin FSMonitor daemon
 - fsmonitor: config settings are repository-specific
 - fsmonitor-ipc: create client routines for git-fsmonitor--daemon
 - fsmonitor: enhance existing comments

 Built-in fsmonitor (part 2).

 Expecting a reroll.
 Seems that the discussion stalled.
 cf. <d9c3ef61-768c-3560-2858-3438c355a742@jeffhostetler.com>
 source: <pull.1041.v4.git.1634826309.gitgitgadget@gmail.com>


* ld/sparse-diff-blame (2021-12-06) 8 commits
  (merged to 'next' on 2021-12-10 at 57b89936d6)
 + blame: enable and test the sparse index
 + diff: enable and test the sparse index
 + diff: replace --staged with --cached in t1092 tests
 + repo-settings: prepare_repo_settings only in git repos
 + test-read-cache: set up repo after git directory
 + commit-graph: return if there is no git directory
 + git: ensure correct git directory setup with -h
 + Merge branch 'vd/sparse-reset' into ld/sparse-diff-blame
 (this branch is used by ds/fetch-pull-with-sparse-index.)

 Teach diff and blame to work well with sparse index.

 Will merge to 'master'.
 source: <pull.1050.v6.git.1638806161.gitgitgadget@gmail.com>


* ns/tmp-objdir (2021-12-08) 2 commits
 - tmp-objdir: disable ref updates when replacing the primary odb
 - tmp-objdir: new API for creating temporary writable databases
 (this branch is used by ns/batched-fsync and ns/remerge-diff.)

 New interface into the tmp-objdir API to help in-core use of the
 quarantine feature.

 Will merge to 'next'.
 source: <pull.1091.v3.git.1638828305.gitgitgadget@gmail.com>


* es/superproject-aware-submodules (2021-11-18) 5 commits
 - submodule: use config to find superproject worktree
 - submodule: record superproject gitdir during 'update'
 - submodule: record superproject gitdir during absorbgitdirs
 - introduce submodule.superprojectGitDir record
 - t7400-submodule-basic: modernize inspect() helper

 A configuration variable in a submodule points at the location of
 the superproject it is bound to (RFC).

 Expecting a reroll.
 cf. <20211117234300.2598132-1-jonathantanmy@google.com>
 source: <20211117005701.371808-1-emilyshaffer@google.com>


* js/scalar (2021-12-04) 15 commits
  (merged to 'next' on 2021-12-10 at 6248603a80)
 + scalar: implement the `version` command
 + scalar: implement the `delete` command
 + scalar: teach 'reconfigure' to optionally handle all registered enlistments
 + scalar: allow reconfiguring an existing enlistment
 + scalar: implement the `run` command
 + scalar: teach 'clone' to support the --single-branch option
 + scalar: implement the `clone` subcommand
 + scalar: implement 'scalar list'
 + scalar: let 'unregister' handle a deleted enlistment directory gracefully
 + scalar: 'unregister' stops background maintenance
 + scalar: 'register' sets recommended config and starts maintenance
 + scalar: create test infrastructure
 + scalar: start documenting the command
 + scalar: create a rudimentary executable
 + scalar: add a README with a roadmap

 Add pieces from "scalar" to contrib/.

 Will merge to 'master'.
 source: <pull.1005.v10.git.1638538470.gitgitgadget@gmail.com>


* ab/only-single-progress-at-once (2021-11-03) 8 commits
 - progress.c: add & assert a "global_progress" variable
 - various *.c: use isatty(0|2), not isatty(STDIN_FILENO|STDERR_FILENO)
 - pack-bitmap-write.c: don't return without stop_progress()
 - progress.c: add temporary variable from progress struct
 - progress.c tests: test some invalid usage
 - progress.c tests: make start/stop commands on stdin
 - progress.c test helper: add missing braces
 - leak tests: fix a memory leaks in "test-progress" helper

 Further tweaks on progress API.

 Needs review.
 The last three rounds has seen little reaction, even though earlier
 round saw a lot of responses. The latest round needs a serious
 review or at least Acks from past commentors.
 source: <cover-v6-0.8-00000000000-20211102T122507Z-avarab@gmail.com>

--------------------------------------------------
[Discarded]

* cf/fetch-set-upstream-while-detached (2021-07-06) 1 commit
 . fetch: fix segfault on --set-upstream while on a detached HEAD

 "git fetch --set-upstream" while on detached HEAD segfaulted
 instead of noticing that such an operation did not make sense.

 Superseded by the ab/fetch-set-upstream-while-detached topic
 source: <20210706162238.575988-1-clemens@endorphin.org>


* js/compat-util-msvc-flex-array (2021-12-06) 1 commit
 . git-compat-util(msvc): C11 does not imply support for zero-sized arrays

 MSVC build started to break on flex arrays?

 It seems that there is no breakage in the toolchain; the code was buggy.
 source: <pull.1094.git.1638823724410.gitgitgadget@gmail.com>


* ns/batched-fsync (2021-12-08) 8 commits
 . core.fsyncobjectfiles: performance tests for add and stash
 . core.fsyncobjectfiles: tests for batch mode
 . unpack-objects: use the bulk-checkin infrastructure
 . update-index: use the bulk-checkin infrastructure
 . core.fsyncobjectfiles: add windows support for batch mode
 . core.fsyncobjectfiles: batched disk flushes
 . bulk-checkin: rename 'state' variable and separate 'plugged' boolean
 . Merge branch 'ns/tmp-objdir' into ns/batched-fsync
 (this branch uses ns/tmp-objdir.)

 The "core.fsyncobjectfiles" configuration variable can now be set
 to "batch" for improved performance.

 cf. 20211211034452.GA15683@neerajsi-x1.localdomain
 source: <pull.1076.v9.git.git.1637020263.gitgitgadget@gmail.com>


* ns/remerge-diff (2021-12-08) 8 commits
 . doc/diff-options: explain the new --remerge-diff option
 . show, log: adapt Elijah Newren's changes to common tmp-objdir API
 . show, log: provide a --remerge-diff capability
 . merge-ort: capture and print ll-merge warnings in our preferred fashion
 . ll-merge: add API for capturing warnings in a strbuf instead of stderr
 . merge-ort: add ability to record conflict messages in a file
 . merge-ort: mark a few more conflict messages as omittable
 . Merge branch 'ns/tmp-objdir' into ns/remerge-diff
 (this branch uses ns/tmp-objdir.)

 A new presentation for two-parent merge "--remerge-diff" can be
 used to show the difference between mechanical (and possibly
 conflicted) merge results and the recorded resolution.

 cf. <CABPp-BE4ZD4dsr=ofbZeWqxEV=8do93o_Gus_wsGw6Fq7V2ETA@mail.gmail.com>
 This is Elijah's remerge-diff rebased on ns/tmp-objdir to share the
 "create objects temporarily, only to discard without committing
 them to longer-term storage" infrastructure with another topic.


* ms/customizable-ident-expansion (2021-09-01) 1 commit
 - keyword expansion: make "$Id$" string configurable

 Instead of "$Id$", user-specified string (like $FreeBSD$) can be
 used as an in-blob placeholder for keyword expansion.

 Will discard.
 Stalled for too long.
 cf. <xmqqfsuosvrh.fsf@gitster.g>
 cf. <211101.86fssf3bn3.gmgdl@evledraar.gmail.com>
 source: <pull.1074.v3.git.git.1630462385587.gitgitgadget@gmail.com>


* jc/make-test-all (2021-12-13) 2 commits
 . WIP to add "test-extra-clean"
 . Makefile: add test-all target

 "make test" target in subdirectories of contrib/ are now exercised
 in CI tests.
 source: <xmqqh7bi27o9.fsf@gitster.g>


* jh/make-p4-python3-only (2021-12-09) 6 commits
 . git-p4: Resolve RCS keywords in binary
 . git-p4: Eliminate decode_stream and encode_stream
 . git-p4: Decode byte strings before printing
 . git-p4: Removed support for Python 2
 . git-p4: Don't print shell commands as python lists
 . git-p4: Always pass cmd arguments to subprocess as a python lists

 Support for Python2 in "git p4" has been removed (not just
 deprecated).

 Superseded by jh/p4-rcs-expansion-in-bytestring topic, leaving
 the "drop Python-2 support" for a separate topic in the future.
 source: <20211209201029.136886-1-jholdsworth@nvidia.com>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* ab/run-command (was: What's cooking in git.git (Dec 2021, #04; Wed, 15))
  2021-12-16  2:32 What's cooking in git.git (Dec 2021, #04; Wed, 15) Junio C Hamano
@ 2021-12-16 11:51 ` Ævar Arnfjörð Bjarmason
  2021-12-16 15:31   ` Jeff King
  2021-12-16 23:46 ` ab/make-dependency (was: What's cooking in git.git (Dec 2021, #04; Wed, 15)) Ævar Arnfjörð Bjarmason
  2021-12-21  1:34 ` What's cooking in git.git (Dec 2021, #04; Wed, 15) Aleen 徐沛文
  2 siblings, 1 reply; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-12-16 11:51 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git


On Wed, Dec 15 2021, Junio C Hamano wrote:

> [Graduated to 'master']
> [...]
> * ab/run-command (2021-11-25) 9 commits
>   (merged to 'next' on 2021-12-07 at 5c0bedf853)
>  + run-command API: remove "env" member, always use "env_array"
>  + difftool: use "env_array" to simplify memory management
>  + run-command API: remove "argv" member, always use "args"
>  + run-command API users: use strvec_push(), not argv construction
>  + run-command API users: use strvec_pushl(), not argv construction
>  + run-command tests: use strvec_pushv(), not argv assignment
>  + run-command API users: use strvec_pushv(), not argv assignment
>  + upload-archive: use regular "struct child_process" pattern
>  + worktree: stop being overly intimate with run_command() internals
>
>  API clean-up.
>  cf. <211130.86k0gpcpy2.gmgdl@evledraar.gmail.com>
>  cf. <CAPig+cSvFgJTiq8pXrWy_7ukQwE1y9ZGwMgKmyjWuQHdNGxiDQ@mail.gmail.com>
>  source: <cover-v3-0.9-00000000000-20211125T224833Z-avarab@gmail.com>

Thanks! FWIW the tip commit mentioned that renaming "env_array" to "env"
probably wasn't worth it, but having tried it just now I think it's
probably a worthwhile follow-up at some point. The diff is just:
	
	diff --git a/run-command.h b/run-command.h
	index 2be5f5d6422..c5d44cc9a5c 100644
	--- a/run-command.h
	+++ b/run-command.h
	@@ -73,7 +73,7 @@ struct child_process {
	 	 * The memory in .env_array will be cleaned up automatically during
	 	 * `finish_command` (or during `start_command` when it is unsuccessful).
	 	 */
	-	struct strvec env_array;
	+	struct strvec env;
	 	pid_t pid;
	 
	 	int trace2_child_id;
	@@ -147,7 +147,7 @@ struct child_process {
	 
	 #define CHILD_PROCESS_INIT { \
	 	.args = STRVEC_INIT, \
	-	.env_array = STRVEC_INIT, \
	+	.env = STRVEC_INIT, \
	 }
	 
	 /**

Followed by a rather large mechanical change, but that change can almost
entirely be done with this cocci rule:
    
    @@
    struct child_process E;
    @@
    - E.env_array
    + E.env
    
    @@
    struct child_process *E;
    @@
    - E->env_array
    + E->env

The "almost" being that we'll also need this on top:
    
     builtin/submodule--helper.c |  2 +-
     run-command.c               |  6 +++---
     run-command.h               | 10 +++++-----
     sequencer.c                 |  6 +++---
     submodule.h                 |  4 ++--
     5 files changed, 14 insertions(+), 14 deletions(-)

Which changes comments and function/variable names that refer to
"env_array" to refer to "env".

I won't submit it now because we've got some "env_array" in
master..seen, but there'll probably be a time when there'll be none
which might make it trivial.

Or maybe you're not interested in either case, which is also fine. It's
really not needed for anything other than to resolve the minor oddity
that we have two "struct strvec"'s, "args" and "env_array". It's just a
bit odd to have one with "_array" in the name, which is only because the
now-removed "env" was taken at the time.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ab/run-command (was: What's cooking in git.git (Dec 2021, #04; Wed, 15))
  2021-12-16 11:51 ` ab/run-command (was: What's cooking in git.git (Dec 2021, #04; Wed, 15)) Ævar Arnfjörð Bjarmason
@ 2021-12-16 15:31   ` Jeff King
  2021-12-16 15:38     ` Ævar Arnfjörð Bjarmason
  2022-04-06 10:42     ` [PATCH 0/3] run-command.h: rename "env_array" to "env" Ævar Arnfjörð Bjarmason
  0 siblings, 2 replies; 26+ messages in thread
From: Jeff King @ 2021-12-16 15:31 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Junio C Hamano, git

On Thu, Dec 16, 2021 at 12:51:55PM +0100, Ævar Arnfjörð Bjarmason wrote:

> Or maybe you're not interested in either case, which is also fine. It's
> really not needed for anything other than to resolve the minor oddity
> that we have two "struct strvec"'s, "args" and "env_array". It's just a
> bit odd to have one with "_array" in the name, which is only because the
> now-removed "env" was taken at the time.

Yeah, FWIW I absolutely hated "env_array" when I added it, but didn't
want to do the transition all at once, so needed another name. So I
would be happy to see it become "env" now. ;)

Turning "args" into "argv" is less important, just because the name is
less long and ugly. And since "argv" is both the concept of the arg list
and also the well-known main() parameter with a different type, arguably
using it for a type besides "const char **" could be confusing (though I
don't find it so personally).

-Peff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ab/run-command (was: What's cooking in git.git (Dec 2021, #04; Wed, 15))
  2021-12-16 15:31   ` Jeff King
@ 2021-12-16 15:38     ` Ævar Arnfjörð Bjarmason
  2021-12-16 19:11       ` ab/run-command Junio C Hamano
  2022-04-06 10:42     ` [PATCH 0/3] run-command.h: rename "env_array" to "env" Ævar Arnfjörð Bjarmason
  1 sibling, 1 reply; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-12-16 15:38 UTC (permalink / raw)
  To: Jeff King; +Cc: Junio C Hamano, git


On Thu, Dec 16 2021, Jeff King wrote:

> On Thu, Dec 16, 2021 at 12:51:55PM +0100, Ævar Arnfjörð Bjarmason wrote:
>
>> Or maybe you're not interested in either case, which is also fine. It's
>> really not needed for anything other than to resolve the minor oddity
>> that we have two "struct strvec"'s, "args" and "env_array". It's just a
>> bit odd to have one with "_array" in the name, which is only because the
>> now-removed "env" was taken at the time.
>
> Yeah, FWIW I absolutely hated "env_array" when I added it, but didn't
> want to do the transition all at once, so needed another name. So I
> would be happy to see it become "env" now. ;)

Thanks.

> Turning "args" into "argv" is less important, just because the name is
> less long and ugly. And since "argv" is both the concept of the arg list
> and also the well-known main() parameter with a different type, arguably
> using it for a type besides "const char **" could be confusing (though I
> don't find it so personally).

I like that it's just "args", so I don't think I'd change it even if I
could waive the proverbial magic wand to d oit.

We also have non-run-command.h code that uses "struct strvec args =
STRVEC_INIT" (although most of that ends up being passed into the
run_command.c function).

Saying "argv.v" also seems a bit more strange than "args.v", IMO.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ab/run-command
  2021-12-16 15:38     ` Ævar Arnfjörð Bjarmason
@ 2021-12-16 19:11       ` Junio C Hamano
  0 siblings, 0 replies; 26+ messages in thread
From: Junio C Hamano @ 2021-12-16 19:11 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Jeff King, git

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> I like that it's just "args", so I don't think I'd change it even if I
> could waive the proverbial magic wand to d oit.
>
> We also have non-run-command.h code that uses "struct strvec args =
> STRVEC_INIT" (although most of that ends up being passed into the
> run_command.c function).
>
> Saying "argv.v" also seems a bit more strange than "args.v", IMO.

So perhaps the renamed member will be called envs?

;-)

^ permalink raw reply	[flat|nested] 26+ messages in thread

* ab/make-dependency (was: What's cooking in git.git (Dec 2021, #04; Wed, 15))
  2021-12-16  2:32 What's cooking in git.git (Dec 2021, #04; Wed, 15) Junio C Hamano
  2021-12-16 11:51 ` ab/run-command (was: What's cooking in git.git (Dec 2021, #04; Wed, 15)) Ævar Arnfjörð Bjarmason
@ 2021-12-16 23:46 ` Ævar Arnfjörð Bjarmason
  2021-12-21  1:34 ` What's cooking in git.git (Dec 2021, #04; Wed, 15) Aleen 徐沛文
  2 siblings, 0 replies; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-12-16 23:46 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git


On Wed, Dec 15 2021, Junio C Hamano wrote:

> * ab/make-dependency (2021-11-18) 24 commits
>  - Makefile: move ".SUFFIXES" rule to shared.mak
>  - Makefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES)
>  - Makefile: disable GNU make built-in wildcard rules
>  - Makefile: use $(file) I/O instead of "FORCE" when possible
>  - Makefile: correct the dependency graph of hook-list.h
>  - Makefiles: add and use wildcard "mkdir -p" template
>  - Makefile: use $(wspfx) for $(QUIET...) in shared.mak
>  - Makefile: add "$(QUIET)" boilerplate to shared.mak
>  - Makefile: add a "TRACK_template" for GIT-*{FLAGS,DEFINES,...}
>  - Makefile: re-add and use the "shellquote" macros
>  - Makefile: move $(comma), $(empty) and $(space) to shared.mak
>  - Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to it
>  - Makefile: stop needing @@GIT_VERSION@@ in *.perl scripts
>  - Makefile: create a GIT-PYTHON-DEFINES, like "PERL"
>  - Makefile: correct "GIT-PERL-{DEFINES,HEADER}" dependency graph
>  - Makefile: adjust Perl-related comments & whitespace
>  - Makefile: change "ifndef NO_PERL" to "ifdef NO_PERL"
>  - Makefile: guard Perl-only variable assignments
>  - Makefile: remove "mv $@ $@+" dance redundant to .DELETE_ON_ERROR
>  - Makefile: clean perl/build/ even with NO_PERL=Y
>  - Makefile: use "=" not ":=" for po/* and perl/*
>  - Makefile: don't set up "perl/build" rules under NO_PERL=Y
>  - Makefile: don't invoke msgfmt with --statistics
>  - Merge branch 'ab/sh-retire-helper-functions' into ab/make-dependency
>
>  Dependency clean-up.
>
>  Needs review.
>  There are some comments on earlier rounds; the latest one needs a
>  serious review or at least Acks from past commentors.
>  source: <patch-v4-23.23-48a3927d972-20211117T101807Z-avarab@gmail.com>

I think it's best to drop this rather large topic for now.

I started re-rolling it with improvements to address your shell escaping
comments, and ended up with a much better end-state, but it's now at
north of 30 commits locally.

So I've split it up and have some incoming patches. Not for all of it,
just starting with some of the more urgent than not fixes & more trivial
& easy to review changes, or around 1/2 of what's quoted above.

I'll then submit the rest sometime after that lands.


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: What's cooking in git.git (Dec 2021, #04; Wed, 15)
  2021-12-16  2:32 What's cooking in git.git (Dec 2021, #04; Wed, 15) Junio C Hamano
  2021-12-16 11:51 ` ab/run-command (was: What's cooking in git.git (Dec 2021, #04; Wed, 15)) Ævar Arnfjörð Bjarmason
  2021-12-16 23:46 ` ab/make-dependency (was: What's cooking in git.git (Dec 2021, #04; Wed, 15)) Ævar Arnfjörð Bjarmason
@ 2021-12-21  1:34 ` Aleen 徐沛文
  2021-12-21  7:30   ` Christian Couder
  2 siblings, 1 reply; 26+ messages in thread
From: Aleen 徐沛文 @ 2021-12-21  1:34 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

> * xw/am-empty (2021-12-07) 3 commits

The alias of my name should be "pwxu" but not "xw".

>  - am: support --allow-empty to record specific empty patches
>  - am: support --empty=<option> to handle empty patches
>  - doc: git-format-patch: describe the option --always
> 
>  "git am" learns "--empty=(die|drop|keep)" option to tweak what is

This should be 'learns "--empty=(stop|drop|keep)"'

>  done to a piece of e-mail without a patch in it.
> 
>  Almost there.
>  source: <pull.1076.v18.git.1638939946.gitgitgadget@gmail.com>



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: What's cooking in git.git (Dec 2021, #04; Wed, 15)
  2021-12-21  1:34 ` What's cooking in git.git (Dec 2021, #04; Wed, 15) Aleen 徐沛文
@ 2021-12-21  7:30   ` Christian Couder
  0 siblings, 0 replies; 26+ messages in thread
From: Christian Couder @ 2021-12-21  7:30 UTC (permalink / raw)
  To: Aleen 徐沛文; +Cc: Junio C Hamano, git

On Tue, Dec 21, 2021 at 8:14 AM Aleen 徐沛文 <pwxu@coremail.cn> wrote:
>
> > * xw/am-empty (2021-12-07) 3 commits
>
> The alias of my name should be "pwxu" but not "xw".

This isn't an alias. These are the initials of the first and last
name, so only 2 ascii characters.

Maybe "px" or something else are better initials though. Your
suggestions are welcome!

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 0/3] run-command.h: rename "env_array" to "env"
  2021-12-16 15:31   ` Jeff King
  2021-12-16 15:38     ` Ævar Arnfjörð Bjarmason
@ 2022-04-06 10:42     ` Ævar Arnfjörð Bjarmason
  2022-04-06 10:42       ` [PATCH 1/3] cocci: add a rename of "struct child_process"'s " Ævar Arnfjörð Bjarmason
                         ` (4 more replies)
  1 sibling, 5 replies; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-04-06 10:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Enzo Matsumiya, Eric Sunshine,
	Ævar Arnfjörð Bjarmason

On Thu, Dec 16 2021, Jeff King wrote:

> On Thu, Dec 16, 2021 at 12:51:55PM +0100, Ævar Arnfjörð Bjarmason wrote:
>
>> Or maybe you're not interested in either case, which is also fine. It's
>> really not needed for anything other than to resolve the minor oddity
>> that we have two "struct strvec"'s, "args" and "env_array". It's just a
>> bit odd to have one with "_array" in the name, which is only because the
>> now-removed "env" was taken at the time.
>
> Yeah, FWIW I absolutely hated "env_array" when I added it, but didn't
> want to do the transition all at once, so needed another name. So I
> would be happy to see it become "env" now. ;)

Perhaps this follow-up to 832ec72c3e1 (Merge branch 'ab/run-command',
2021-12-15) will warm Jeff's heart if/when he returns from his git
sabbatical :)

Junio: We're in the RC period, but perhaps this change if we're ever
going to make it would be good to make around that time of patch
slowdown. I.e. for the first batch after release.

I've been holding onto this since around December, but when I checked
there was always 1-2 series that was adding new use of "env_array",
resolving that conflict didn't seem worth the hassle.

Right now this doesn't conflict with anything in "seen". The
scary-at-first diffstat is almost entirely in 2/3, and everything
except a two-line change in that commit is made by the coccinelle rule
added in 1/3.

So this series for reviewing is really:

 * A trivial coccinelle rule in 1/3
 * The trivial 2 line change in run-command.h in 2/3 that isn't made
   by that rule
 * Subsequent trivial cleanup in 3/3 changing s/env_array/env/g in
   comments & variable names

Ævar Arnfjörð Bjarmason (3):
  cocci: add a rename of "struct child_process"'s "env_array" to "env"
  run-command API: rename "env_array" to "env"
  run-command API users: use "env" not "env_array" in comments & names

 add-patch.c                          |  2 +-
 branch.c                             |  2 +-
 builtin/difftool.c                   |  6 ++--
 builtin/receive-pack.c               | 32 ++++++++++----------
 builtin/stash.c                      | 16 +++++-----
 builtin/submodule--helper.c          | 44 ++++++++++++++--------------
 builtin/worktree.c                   |  8 ++---
 connect.c                            |  9 +++---
 connected.c                          |  2 +-
 contrib/coccinelle/run_command.cocci | 11 +++++++
 daemon.c                             | 14 ++++-----
 editor.c                             |  2 +-
 hook.c                               |  2 +-
 http-backend.c                       |  4 +--
 object-file.c                        |  2 +-
 pager.c                              |  4 +--
 promisor-remote.c                    |  2 +-
 run-command.c                        | 19 ++++++------
 run-command.h                        | 14 ++++-----
 sequencer.c                          | 18 ++++++------
 submodule.c                          | 38 ++++++++++++------------
 submodule.h                          |  4 +--
 t/helper/test-run-command.c          |  2 +-
 trailer.c                            |  2 +-
 transport-helper.c                   |  2 +-
 wt-status.c                          |  2 +-
 26 files changed, 138 insertions(+), 125 deletions(-)
 create mode 100644 contrib/coccinelle/run_command.cocci

-- 
2.36.0.rc0.849.g2d5b5d9ab01


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 1/3] cocci: add a rename of "struct child_process"'s "env_array" to "env"
  2022-04-06 10:42     ` [PATCH 0/3] run-command.h: rename "env_array" to "env" Ævar Arnfjörð Bjarmason
@ 2022-04-06 10:42       ` Ævar Arnfjörð Bjarmason
  2022-04-06 10:42       ` [PATCH 2/3] run-command API: rename " Ævar Arnfjörð Bjarmason
                         ` (3 subsequent siblings)
  4 siblings, 0 replies; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-04-06 10:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Enzo Matsumiya, Eric Sunshine,
	Ævar Arnfjörð Bjarmason

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 is added as a "pending" migration because it'll need a couple of
manual changes to go along with it, those will be performed in the
subsequent commit.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 contrib/coccinelle/run_command.pending.cocci | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 contrib/coccinelle/run_command.pending.cocci

diff --git a/contrib/coccinelle/run_command.pending.cocci b/contrib/coccinelle/run_command.pending.cocci
new file mode 100644
index 00000000000..709fdfcf720
--- /dev/null
+++ b/contrib/coccinelle/run_command.pending.cocci
@@ -0,0 +1,11 @@
+@@
+struct child_process E;
+@@
+- E.env_array
++ E.env
+
+@@
+struct child_process *E;
+@@
+- E->env_array
++ E->env
-- 
2.36.0.rc0.849.g2d5b5d9ab01


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 2/3] run-command API: rename "env_array" to "env"
  2022-04-06 10:42     ` [PATCH 0/3] run-command.h: rename "env_array" to "env" Ævar Arnfjörð Bjarmason
  2022-04-06 10:42       ` [PATCH 1/3] cocci: add a rename of "struct child_process"'s " Ævar Arnfjörð Bjarmason
@ 2022-04-06 10:42       ` Ævar Arnfjörð Bjarmason
  2022-04-06 10:42       ` [PATCH 3/3] run-command API users: use "env" not "env_array" in comments & names Ævar Arnfjörð Bjarmason
                         ` (2 subsequent siblings)
  4 siblings, 0 replies; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-04-06 10:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Enzo Matsumiya, Eric Sunshine,
	Ævar Arnfjörð Bjarmason

As noted in the preceding commit it would be nice to not deal with the
oddity of having an "_array" suffix for the "env" strvec, but not for
its "args" sibling.

We can do that with coccinelle in a way that's easy to review. The
only manual changes in this commit are:

 * git mv contrib/coccinelle/run_command{.pending,}.cocci
 * The change in run-command.h to rename the struct member itself, and
   to change its initializer.

The rest of this is all the result of a subsequent:

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

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>
---
 add-patch.c                                   |  2 +-
 branch.c                                      |  2 +-
 builtin/difftool.c                            |  6 +--
 builtin/receive-pack.c                        | 32 +++++++-------
 builtin/stash.c                               | 16 +++----
 builtin/submodule--helper.c                   | 42 +++++++++----------
 builtin/worktree.c                            |  8 ++--
 connect.c                                     |  9 ++--
 connected.c                                   |  2 +-
 ...ommand.pending.cocci => run_command.cocci} |  0
 daemon.c                                      | 14 +++----
 editor.c                                      |  2 +-
 hook.c                                        |  2 +-
 http-backend.c                                |  4 +-
 object-file.c                                 |  2 +-
 pager.c                                       |  4 +-
 promisor-remote.c                             |  2 +-
 run-command.c                                 | 13 +++---
 run-command.h                                 |  4 +-
 sequencer.c                                   | 16 +++----
 submodule.c                                   | 38 ++++++++---------
 t/helper/test-run-command.c                   |  2 +-
 trailer.c                                     |  2 +-
 transport-helper.c                            |  2 +-
 wt-status.c                                   |  2 +-
 25 files changed, 115 insertions(+), 113 deletions(-)
 rename contrib/coccinelle/{run_command.pending.cocci => run_command.cocci} (100%)

diff --git a/add-patch.c b/add-patch.c
index 55d719f7845..509ca04456b 100644
--- a/add-patch.c
+++ b/add-patch.c
@@ -305,7 +305,7 @@ static void setup_child_process(struct add_p_state *s,
 	va_end(ap);
 
 	cp->git_cmd = 1;
-	strvec_pushf(&cp->env_array,
+	strvec_pushf(&cp->env,
 		     INDEX_ENVIRONMENT "=%s", s->s.r->index_file);
 }
 
diff --git a/branch.c b/branch.c
index 01ecb816d5c..3a89a547839 100644
--- a/branch.c
+++ b/branch.c
@@ -564,7 +564,7 @@ static int submodule_create_branch(struct repository *r,
 	child.err = -1;
 	child.stdout_to_stderr = 1;
 
-	prepare_other_repo_env(&child.env_array, r->gitdir);
+	prepare_other_repo_env(&child.env, r->gitdir);
 	/*
 	 * submodule_create_branch() is indirectly invoked by "git
 	 * branch", but we cannot invoke "git branch" in the child
diff --git a/builtin/difftool.c b/builtin/difftool.c
index faa3507369a..b3c509b8de3 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -217,7 +217,7 @@ static void changed_files(struct hashmap *result, const char *index_path,
 	update_index.use_shell = 0;
 	update_index.clean_on_exit = 1;
 	update_index.dir = workdir;
-	strvec_pushf(&update_index.env_array, "GIT_INDEX_FILE=%s", index_path);
+	strvec_pushf(&update_index.env, "GIT_INDEX_FILE=%s", index_path);
 	/* Ignore any errors of update-index */
 	run_command(&update_index);
 
@@ -230,7 +230,7 @@ static void changed_files(struct hashmap *result, const char *index_path,
 	diff_files.clean_on_exit = 1;
 	diff_files.out = -1;
 	diff_files.dir = workdir;
-	strvec_pushf(&diff_files.env_array, "GIT_INDEX_FILE=%s", index_path);
+	strvec_pushf(&diff_files.env, "GIT_INDEX_FILE=%s", index_path);
 	if (start_command(&diff_files))
 		die("could not obtain raw diff");
 	fp = xfdopen(diff_files.out, "r");
@@ -675,7 +675,7 @@ static int run_file_diff(int prompt, const char *prefix,
 
 	child->git_cmd = 1;
 	child->dir = prefix;
-	strvec_pushv(&child->env_array, env);
+	strvec_pushv(&child->env, env);
 
 	return run_command(child);
 }
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 9aabffa1afb..acc512f3a36 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -764,23 +764,23 @@ static void prepare_push_cert_sha1(struct child_process *proc)
 		nonce_status = check_nonce(push_cert.buf, bogs);
 	}
 	if (!is_null_oid(&push_cert_oid)) {
-		strvec_pushf(&proc->env_array, "GIT_PUSH_CERT=%s",
+		strvec_pushf(&proc->env, "GIT_PUSH_CERT=%s",
 			     oid_to_hex(&push_cert_oid));
-		strvec_pushf(&proc->env_array, "GIT_PUSH_CERT_SIGNER=%s",
+		strvec_pushf(&proc->env, "GIT_PUSH_CERT_SIGNER=%s",
 			     sigcheck.signer ? sigcheck.signer : "");
-		strvec_pushf(&proc->env_array, "GIT_PUSH_CERT_KEY=%s",
+		strvec_pushf(&proc->env, "GIT_PUSH_CERT_KEY=%s",
 			     sigcheck.key ? sigcheck.key : "");
-		strvec_pushf(&proc->env_array, "GIT_PUSH_CERT_STATUS=%c",
+		strvec_pushf(&proc->env, "GIT_PUSH_CERT_STATUS=%c",
 			     sigcheck.result);
 		if (push_cert_nonce) {
-			strvec_pushf(&proc->env_array,
+			strvec_pushf(&proc->env,
 				     "GIT_PUSH_CERT_NONCE=%s",
 				     push_cert_nonce);
-			strvec_pushf(&proc->env_array,
+			strvec_pushf(&proc->env,
 				     "GIT_PUSH_CERT_NONCE_STATUS=%s",
 				     nonce_status);
 			if (nonce_status == NONCE_SLOP)
-				strvec_pushf(&proc->env_array,
+				strvec_pushf(&proc->env,
 					     "GIT_PUSH_CERT_NONCE_SLOP=%ld",
 					     nonce_stamp_slop);
 		}
@@ -815,17 +815,17 @@ static int run_and_feed_hook(const char *hook_name, feed_fn feed,
 	if (feed_state->push_options) {
 		size_t i;
 		for (i = 0; i < feed_state->push_options->nr; i++)
-			strvec_pushf(&proc.env_array,
+			strvec_pushf(&proc.env,
 				     "GIT_PUSH_OPTION_%"PRIuMAX"=%s",
 				     (uintmax_t)i,
 				     feed_state->push_options->items[i].string);
-		strvec_pushf(&proc.env_array, "GIT_PUSH_OPTION_COUNT=%"PRIuMAX"",
+		strvec_pushf(&proc.env, "GIT_PUSH_OPTION_COUNT=%"PRIuMAX"",
 			     (uintmax_t)feed_state->push_options->nr);
 	} else
-		strvec_pushf(&proc.env_array, "GIT_PUSH_OPTION_COUNT");
+		strvec_pushf(&proc.env, "GIT_PUSH_OPTION_COUNT");
 
 	if (tmp_objdir)
-		strvec_pushv(&proc.env_array, tmp_objdir_env(tmp_objdir));
+		strvec_pushv(&proc.env, tmp_objdir_env(tmp_objdir));
 
 	if (use_sideband) {
 		memset(&muxer, 0, sizeof(muxer));
@@ -1357,7 +1357,7 @@ static const char *push_to_deploy(unsigned char *sha1,
 
 	strvec_pushl(&child.args, "update-index", "-q", "--ignore-submodules",
 		     "--refresh", NULL);
-	strvec_pushv(&child.env_array, env->v);
+	strvec_pushv(&child.env, env->v);
 	child.dir = work_tree;
 	child.no_stdin = 1;
 	child.stdout_to_stderr = 1;
@@ -1369,7 +1369,7 @@ static const char *push_to_deploy(unsigned char *sha1,
 	child_process_init(&child);
 	strvec_pushl(&child.args, "diff-files", "--quiet",
 		     "--ignore-submodules", "--", NULL);
-	strvec_pushv(&child.env_array, env->v);
+	strvec_pushv(&child.env, env->v);
 	child.dir = work_tree;
 	child.no_stdin = 1;
 	child.stdout_to_stderr = 1;
@@ -1383,7 +1383,7 @@ static const char *push_to_deploy(unsigned char *sha1,
 		     /* diff-index with either HEAD or an empty tree */
 		     head_has_history() ? "HEAD" : empty_tree_oid_hex(),
 		     "--", NULL);
-	strvec_pushv(&child.env_array, env->v);
+	strvec_pushv(&child.env, env->v);
 	child.no_stdin = 1;
 	child.no_stdout = 1;
 	child.stdout_to_stderr = 0;
@@ -1394,7 +1394,7 @@ static const char *push_to_deploy(unsigned char *sha1,
 	child_process_init(&child);
 	strvec_pushl(&child.args, "read-tree", "-u", "-m", hash_to_hex(sha1),
 		     NULL);
-	strvec_pushv(&child.env_array, env->v);
+	strvec_pushv(&child.env, env->v);
 	child.dir = work_tree;
 	child.no_stdin = 1;
 	child.no_stdout = 1;
@@ -2215,7 +2215,7 @@ static const char *unpack(int err_fd, struct shallow_info *si)
 		return "unable to create temporary object directory";
 	}
 	if (tmp_objdir)
-		strvec_pushv(&child.env_array, tmp_objdir_env(tmp_objdir));
+		strvec_pushv(&child.env, tmp_objdir_env(tmp_objdir));
 
 	/*
 	 * Normally we just pass the tmp_objdir environment to the child
diff --git a/builtin/stash.c b/builtin/stash.c
index 0c7b6a95882..054f04336f5 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -356,7 +356,7 @@ static int restore_untracked(struct object_id *u_tree)
 	cp.git_cmd = 1;
 	strvec_push(&cp.args, "read-tree");
 	strvec_push(&cp.args, oid_to_hex(u_tree));
-	strvec_pushf(&cp.env_array, "GIT_INDEX_FILE=%s",
+	strvec_pushf(&cp.env, "GIT_INDEX_FILE=%s",
 		     stash_index_path.buf);
 	if (run_command(&cp)) {
 		remove_path(stash_index_path.buf);
@@ -366,7 +366,7 @@ static int restore_untracked(struct object_id *u_tree)
 	child_process_init(&cp);
 	cp.git_cmd = 1;
 	strvec_pushl(&cp.args, "checkout-index", "--all", NULL);
-	strvec_pushf(&cp.env_array, "GIT_INDEX_FILE=%s",
+	strvec_pushf(&cp.env, "GIT_INDEX_FILE=%s",
 		     stash_index_path.buf);
 
 	res = run_command(&cp);
@@ -585,9 +585,9 @@ static int do_apply_stash(const char *prefix, struct stash_info *info,
 		 */
 		cp.git_cmd = 1;
 		cp.dir = prefix;
-		strvec_pushf(&cp.env_array, GIT_WORK_TREE_ENVIRONMENT"=%s",
+		strvec_pushf(&cp.env, GIT_WORK_TREE_ENVIRONMENT"=%s",
 			     absolute_path(get_git_work_tree()));
-		strvec_pushf(&cp.env_array, GIT_DIR_ENVIRONMENT"=%s",
+		strvec_pushf(&cp.env, GIT_DIR_ENVIRONMENT"=%s",
 			     absolute_path(get_git_dir()));
 		strvec_push(&cp.args, "status");
 		run_command(&cp);
@@ -1088,7 +1088,7 @@ static int save_untracked_files(struct stash_info *info, struct strbuf *msg,
 	cp_upd_index.git_cmd = 1;
 	strvec_pushl(&cp_upd_index.args, "update-index", "-z", "--add",
 		     "--remove", "--stdin", NULL);
-	strvec_pushf(&cp_upd_index.env_array, "GIT_INDEX_FILE=%s",
+	strvec_pushf(&cp_upd_index.env, "GIT_INDEX_FILE=%s",
 			 stash_index_path.buf);
 
 	strbuf_addf(&untracked_msg, "untracked files on %s\n", msg->buf);
@@ -1162,7 +1162,7 @@ static int stash_patch(struct stash_info *info, const struct pathspec *ps,
 
 	cp_read_tree.git_cmd = 1;
 	strvec_pushl(&cp_read_tree.args, "read-tree", "HEAD", NULL);
-	strvec_pushf(&cp_read_tree.env_array, "GIT_INDEX_FILE=%s",
+	strvec_pushf(&cp_read_tree.env, "GIT_INDEX_FILE=%s",
 		     stash_index_path.buf);
 	if (run_command(&cp_read_tree)) {
 		ret = -1;
@@ -1249,7 +1249,7 @@ static int stash_working_tree(struct stash_info *info, const struct pathspec *ps
 	strvec_pushl(&cp_upd_index.args, "update-index",
 		     "--ignore-skip-worktree-entries",
 		     "-z", "--add", "--remove", "--stdin", NULL);
-	strvec_pushf(&cp_upd_index.env_array, "GIT_INDEX_FILE=%s",
+	strvec_pushf(&cp_upd_index.env, "GIT_INDEX_FILE=%s",
 		     stash_index_path.buf);
 
 	if (pipe_command(&cp_upd_index, diff_output.buf, diff_output.len,
@@ -1525,7 +1525,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q
 			cp.git_cmd = 1;
 			if (startup_info->original_cwd) {
 				cp.dir = startup_info->original_cwd;
-				strvec_pushf(&cp.env_array, "%s=%s",
+				strvec_pushf(&cp.env, "%s=%s",
 					     GIT_WORK_TREE_ENVIRONMENT,
 					     the_repository->worktree);
 			}
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index c3e0d4570f0..d89184fbf47 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -292,7 +292,7 @@ static char *compute_rev_name(const char *sub_path, const char* object_id)
 
 	for (d = describe_argv; *d; d++) {
 		struct child_process cp = CHILD_PROCESS_INIT;
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.dir = sub_path;
 		cp.git_cmd = 1;
 		cp.no_stderr = 1;
@@ -479,7 +479,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
 	if (!is_submodule_populated_gently(path, NULL))
 		goto cleanup;
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	/*
 	 * For the purpose of executing <command> in the submodule,
@@ -499,12 +499,12 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
 		char *toplevel = xgetcwd();
 		struct strbuf sb = STRBUF_INIT;
 
-		strvec_pushf(&cp.env_array, "name=%s", sub->name);
-		strvec_pushf(&cp.env_array, "sm_path=%s", path);
-		strvec_pushf(&cp.env_array, "displaypath=%s", displaypath);
-		strvec_pushf(&cp.env_array, "sha1=%s",
+		strvec_pushf(&cp.env, "name=%s", sub->name);
+		strvec_pushf(&cp.env, "sm_path=%s", path);
+		strvec_pushf(&cp.env, "displaypath=%s", displaypath);
+		strvec_pushf(&cp.env, "sha1=%s",
 			     oid_to_hex(ce_oid));
-		strvec_pushf(&cp.env_array, "toplevel=%s", toplevel);
+		strvec_pushf(&cp.env, "toplevel=%s", toplevel);
 
 		/*
 		 * Since the path variable was accessible from the script
@@ -536,7 +536,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
 
 		cpr.git_cmd = 1;
 		cpr.dir = path;
-		prepare_submodule_repo_env(&cpr.env_array);
+		prepare_submodule_repo_env(&cpr.env);
 
 		strvec_pushl(&cpr.args, "--super-prefix", NULL);
 		strvec_pushf(&cpr.args, "%s/", displaypath);
@@ -833,7 +833,7 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,
 
 		cpr.git_cmd = 1;
 		cpr.dir = path;
-		prepare_submodule_repo_env(&cpr.env_array);
+		prepare_submodule_repo_env(&cpr.env);
 
 		strvec_push(&cpr.args, "--super-prefix");
 		strvec_pushf(&cpr.args, "%s/", displaypath);
@@ -955,7 +955,7 @@ static char *verify_submodule_committish(const char *sm_path,
 
 	cp_rev_parse.git_cmd = 1;
 	cp_rev_parse.dir = sm_path;
-	prepare_submodule_repo_env(&cp_rev_parse.env_array);
+	prepare_submodule_repo_env(&cp_rev_parse.env);
 	strvec_pushl(&cp_rev_parse.args, "rev-parse", "-q", "--short", NULL);
 	strvec_pushf(&cp_rev_parse.args, "%s^0", committish);
 	strvec_push(&cp_rev_parse.args, "--");
@@ -996,7 +996,7 @@ static void print_submodule_summary(struct summary_cb *info, char *errmsg,
 
 		cp_log.git_cmd = 1;
 		cp_log.dir = p->sm_path;
-		prepare_submodule_repo_env(&cp_log.env_array);
+		prepare_submodule_repo_env(&cp_log.env);
 		strvec_pushl(&cp_log.args, "log", NULL);
 
 		if (S_ISGITLINK(p->mod_src) && S_ISGITLINK(p->mod_dst)) {
@@ -1113,7 +1113,7 @@ static void generate_submodule_summary(struct summary_cb *info,
 
 		cp_rev_list.git_cmd = 1;
 		cp_rev_list.dir = p->sm_path;
-		prepare_submodule_repo_env(&cp_rev_list.env_array);
+		prepare_submodule_repo_env(&cp_rev_list.env);
 
 		if (!capture_command(&cp_rev_list, &sb_rev_list, 0))
 			total_commits = atoi(sb_rev_list.buf);
@@ -1414,7 +1414,7 @@ static void sync_submodule(const char *path, const char *prefix,
 
 		cpr.git_cmd = 1;
 		cpr.dir = path;
-		prepare_submodule_repo_env(&cpr.env_array);
+		prepare_submodule_repo_env(&cpr.env);
 
 		strvec_push(&cpr.args, "--super-prefix");
 		strvec_pushf(&cpr.args, "%s/", displaypath);
@@ -1819,7 +1819,7 @@ static int clone_submodule(struct module_clone_data *clone_data)
 		strvec_push(&cp.args, clone_data->path);
 
 		cp.git_cmd = 1;
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.no_stdin = 1;
 
 		if(run_command(&cp))
@@ -2295,7 +2295,7 @@ static int is_tip_reachable(const char *path, struct object_id *oid)
 	cp.no_stderr = 1;
 	strvec_pushl(&cp.args, "rev-list", "-n", "1", hex, "--not", "--all", NULL);
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	if (capture_command(&cp, &rev, GIT_MAX_HEXSZ + 1) || rev.len)
 		return 0;
@@ -2307,7 +2307,7 @@ static int fetch_in_submodule(const char *module_path, int depth, int quiet, str
 {
 	struct child_process cp = CHILD_PROCESS_INIT;
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	cp.git_cmd = 1;
 	cp.dir = xstrdup(module_path);
 
@@ -2364,7 +2364,7 @@ static int run_update_command(struct update_data *ud, int subforce)
 	strvec_push(&cp.args, oid);
 
 	cp.dir = xstrdup(ud->sm_path);
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	if (run_command(&cp)) {
 		switch (ud->update_strategy.type) {
 		case SM_UPDATE_CHECKOUT:
@@ -2630,7 +2630,7 @@ static int update_submodule(struct update_data *update_data)
 
 		cp.dir = update_data->sm_path;
 		cp.git_cmd = 1;
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		update_data_to_args(&next, &cp.args);
 
 		/* die() if child process die()'d */
@@ -3123,9 +3123,9 @@ static void append_fetch_remotes(struct strbuf *msg, const char *git_dir_path)
 	struct strbuf sb_remote_out = STRBUF_INIT;
 
 	cp_remote.git_cmd = 1;
-	strvec_pushf(&cp_remote.env_array,
+	strvec_pushf(&cp_remote.env,
 		     "GIT_DIR=%s", git_dir_path);
-	strvec_push(&cp_remote.env_array, "GIT_WORK_TREE=.");
+	strvec_push(&cp_remote.env, "GIT_WORK_TREE=.");
 	strvec_pushl(&cp_remote.args, "remote", "-v", NULL);
 	if (!capture_command(&cp_remote, &sb_remote_out, 0)) {
 		char *next_line;
@@ -3209,7 +3209,7 @@ static int add_submodule(const struct add_data *add_data)
 		if (clone_submodule(&clone_data))
 			return -1;
 
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.git_cmd = 1;
 		cp.dir = add_data->sm_path;
 		/*
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 8b32cd16515..cd62eef240e 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -301,7 +301,7 @@ static int checkout_worktree(const struct add_opts *opts,
 	strvec_pushl(&cp.args, "reset", "--hard", "--no-recurse-submodules", NULL);
 	if (opts->quiet)
 		strvec_push(&cp.args, "--quiet");
-	strvec_pushv(&cp.env_array, child_env->v);
+	strvec_pushv(&cp.env, child_env->v);
 	return run_command(&cp);
 }
 
@@ -433,7 +433,7 @@ static int add_worktree(const char *path, const char *refname,
 			strvec_push(&cp.args, "--quiet");
 	}
 
-	strvec_pushv(&cp.env_array, child_env.v);
+	strvec_pushv(&cp.env, child_env.v);
 	ret = run_command(&cp);
 	if (ret)
 		goto done;
@@ -989,9 +989,9 @@ static void check_clean_worktree(struct worktree *wt,
 	validate_no_submodules(wt);
 
 	child_process_init(&cp);
-	strvec_pushf(&cp.env_array, "%s=%s/.git",
+	strvec_pushf(&cp.env, "%s=%s/.git",
 		     GIT_DIR_ENVIRONMENT, wt->path);
-	strvec_pushf(&cp.env_array, "%s=%s",
+	strvec_pushf(&cp.env, "%s=%s",
 		     GIT_WORK_TREE_ENVIRONMENT, wt->path);
 	strvec_pushl(&cp.args, "status",
 		     "--porcelain", "--ignore-submodules=none",
diff --git a/connect.c b/connect.c
index afc79a6236e..37b56067358 100644
--- a/connect.c
+++ b/connect.c
@@ -1327,7 +1327,7 @@ static void fill_ssh_args(struct child_process *conn, const char *ssh_host,
 
 		strvec_push(&detect.args, ssh);
 		strvec_push(&detect.args, "-G");
-		push_ssh_options(&detect.args, &detect.env_array,
+		push_ssh_options(&detect.args, &detect.env,
 				 VARIANT_SSH, port, version, flags);
 		strvec_push(&detect.args, ssh_host);
 
@@ -1335,7 +1335,8 @@ static void fill_ssh_args(struct child_process *conn, const char *ssh_host,
 	}
 
 	strvec_push(&conn->args, ssh);
-	push_ssh_options(&conn->args, &conn->env_array, variant, port, version, flags);
+	push_ssh_options(&conn->args, &conn->env, variant, port, version,
+			 flags);
 	strvec_push(&conn->args, ssh_host);
 }
 
@@ -1397,7 +1398,7 @@ struct child_process *git_connect(int fd[2], const char *url,
 
 		/* remove repo-local variables from the environment */
 		for (var = local_repo_env; *var; var++)
-			strvec_push(&conn->env_array, *var);
+			strvec_push(&conn->env, *var);
 
 		conn->use_shell = 1;
 		conn->in = conn->out = -1;
@@ -1429,7 +1430,7 @@ struct child_process *git_connect(int fd[2], const char *url,
 			transport_check_allowed("file");
 			conn->trace2_child_class = "transport/file";
 			if (version > 0) {
-				strvec_pushf(&conn->env_array,
+				strvec_pushf(&conn->env,
 					     GIT_PROTOCOL_ENVIRONMENT "=version=%d",
 					     version);
 			}
diff --git a/connected.c b/connected.c
index ed3025e7a2a..74a20cb32e7 100644
--- a/connected.c
+++ b/connected.c
@@ -110,7 +110,7 @@ int check_connected(oid_iterate_fn fn, void *cb_data,
 
 	rev_list.git_cmd = 1;
 	if (opt->env)
-		strvec_pushv(&rev_list.env_array, opt->env);
+		strvec_pushv(&rev_list.env, opt->env);
 	rev_list.in = -1;
 	rev_list.no_stdout = 1;
 	if (opt->err_fd)
diff --git a/contrib/coccinelle/run_command.pending.cocci b/contrib/coccinelle/run_command.cocci
similarity index 100%
rename from contrib/coccinelle/run_command.pending.cocci
rename to contrib/coccinelle/run_command.cocci
diff --git a/daemon.c b/daemon.c
index 94a5b8a3645..a1d211debe1 100644
--- a/daemon.c
+++ b/daemon.c
@@ -484,7 +484,7 @@ static int upload_pack(const struct strvec *env)
 	strvec_pushl(&cld.args, "upload-pack", "--strict", NULL);
 	strvec_pushf(&cld.args, "--timeout=%u", timeout);
 
-	strvec_pushv(&cld.env_array, env->v);
+	strvec_pushv(&cld.env, env->v);
 
 	return run_service_command(&cld);
 }
@@ -494,7 +494,7 @@ static int upload_archive(const struct strvec *env)
 	struct child_process cld = CHILD_PROCESS_INIT;
 	strvec_push(&cld.args, "upload-archive");
 
-	strvec_pushv(&cld.env_array, env->v);
+	strvec_pushv(&cld.env, env->v);
 
 	return run_service_command(&cld);
 }
@@ -504,7 +504,7 @@ static int receive_pack(const struct strvec *env)
 	struct child_process cld = CHILD_PROCESS_INIT;
 	strvec_push(&cld.args, "receive-pack");
 
-	strvec_pushv(&cld.env_array, env->v);
+	strvec_pushv(&cld.env, env->v);
 
 	return run_service_command(&cld);
 }
@@ -904,16 +904,16 @@ static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)
 		char buf[128] = "";
 		struct sockaddr_in *sin_addr = (void *) addr;
 		inet_ntop(addr->sa_family, &sin_addr->sin_addr, buf, sizeof(buf));
-		strvec_pushf(&cld.env_array, "REMOTE_ADDR=%s", buf);
-		strvec_pushf(&cld.env_array, "REMOTE_PORT=%d",
+		strvec_pushf(&cld.env, "REMOTE_ADDR=%s", buf);
+		strvec_pushf(&cld.env, "REMOTE_PORT=%d",
 			     ntohs(sin_addr->sin_port));
 #ifndef NO_IPV6
 	} else if (addr->sa_family == AF_INET6) {
 		char buf[128] = "";
 		struct sockaddr_in6 *sin6_addr = (void *) addr;
 		inet_ntop(AF_INET6, &sin6_addr->sin6_addr, buf, sizeof(buf));
-		strvec_pushf(&cld.env_array, "REMOTE_ADDR=[%s]", buf);
-		strvec_pushf(&cld.env_array, "REMOTE_PORT=%d",
+		strvec_pushf(&cld.env, "REMOTE_ADDR=[%s]", buf);
+		strvec_pushf(&cld.env, "REMOTE_PORT=%d",
 			     ntohs(sin6_addr->sin6_port));
 #endif
 	}
diff --git a/editor.c b/editor.c
index 8b9648281d7..008c04fe2f6 100644
--- a/editor.c
+++ b/editor.c
@@ -80,7 +80,7 @@ static int launch_specified_editor(const char *editor, const char *path,
 
 		strvec_pushl(&p.args, editor, realpath.buf, NULL);
 		if (env)
-			strvec_pushv(&p.env_array, (const char **)env);
+			strvec_pushv(&p.env, (const char **)env);
 		p.use_shell = 1;
 		p.trace2_child_class = "editor";
 		if (start_command(&p) < 0) {
diff --git a/hook.c b/hook.c
index 1d51be3b77a..2b47bdf5ef0 100644
--- a/hook.c
+++ b/hook.c
@@ -54,7 +54,7 @@ static int pick_next_hook(struct child_process *cp,
 		return 0;
 
 	cp->no_stdin = 1;
-	strvec_pushv(&cp->env_array, hook_cb->options->env.v);
+	strvec_pushv(&cp->env, hook_cb->options->env.v);
 	cp->stdout_to_stderr = 1;
 	cp->trace2_hook_name = hook_cb->hook_name;
 	cp->dir = hook_cb->options->dir;
diff --git a/http-backend.c b/http-backend.c
index 81a7229ece0..58b83a9f66b 100644
--- a/http-backend.c
+++ b/http-backend.c
@@ -476,9 +476,9 @@ static void run_service(const char **argv, int buffer_input)
 		host = "(none)";
 
 	if (!getenv("GIT_COMMITTER_NAME"))
-		strvec_pushf(&cld.env_array, "GIT_COMMITTER_NAME=%s", user);
+		strvec_pushf(&cld.env, "GIT_COMMITTER_NAME=%s", user);
 	if (!getenv("GIT_COMMITTER_EMAIL"))
-		strvec_pushf(&cld.env_array,
+		strvec_pushf(&cld.env,
 			     "GIT_COMMITTER_EMAIL=%s@http.%s", user, host);
 
 	strvec_pushv(&cld.args, argv);
diff --git a/object-file.c b/object-file.c
index 5ffbf3d4fd4..2946c4d3ede 100644
--- a/object-file.c
+++ b/object-file.c
@@ -838,7 +838,7 @@ static void fill_alternate_refs_command(struct child_process *cmd,
 		}
 	}
 
-	strvec_pushv(&cmd->env_array, (const char **)local_repo_env);
+	strvec_pushv(&cmd->env, (const char **)local_repo_env);
 	cmd->out = -1;
 }
 
diff --git a/pager.c b/pager.c
index 27877f8ebbc..5cfe23b025c 100644
--- a/pager.c
+++ b/pager.c
@@ -99,7 +99,7 @@ void prepare_pager_args(struct child_process *pager_process, const char *pager)
 {
 	strvec_push(&pager_process->args, pager);
 	pager_process->use_shell = 1;
-	setup_pager_env(&pager_process->env_array);
+	setup_pager_env(&pager_process->env);
 	pager_process->trace2_child_class = "pager";
 }
 
@@ -129,7 +129,7 @@ void setup_pager(void)
 	/* spawn the pager */
 	prepare_pager_args(&pager_process, pager);
 	pager_process.in = -1;
-	strvec_push(&pager_process.env_array, "GIT_PAGER_IN_USE");
+	strvec_push(&pager_process.env, "GIT_PAGER_IN_USE");
 	if (start_command(&pager_process))
 		return;
 
diff --git a/promisor-remote.c b/promisor-remote.c
index db2ebdc66ef..17d827e053b 100644
--- a/promisor-remote.c
+++ b/promisor-remote.c
@@ -22,7 +22,7 @@ static int fetch_objects(struct repository *repo,
 	child.git_cmd = 1;
 	child.in = -1;
 	if (repo != the_repository)
-		prepare_other_repo_env(&child.env_array, repo->gitdir);
+		prepare_other_repo_env(&child.env, repo->gitdir);
 	strvec_pushl(&child.args, "-c", "fetch.negotiationAlgorithm=noop",
 		     "fetch", remote_name, "--no-tags",
 		     "--no-write-fetch-head", "--recurse-submodules=no",
diff --git a/run-command.c b/run-command.c
index a8501e38ceb..5f7ea713f06 100644
--- a/run-command.c
+++ b/run-command.c
@@ -20,7 +20,7 @@ void child_process_init(struct child_process *child)
 void child_process_clear(struct child_process *child)
 {
 	strvec_clear(&child->args);
-	strvec_clear(&child->env_array);
+	strvec_clear(&child->env);
 }
 
 struct child_to_clean {
@@ -646,7 +646,7 @@ static void trace_run_command(const struct child_process *cp)
 		sq_quote_buf_pretty(&buf, cp->dir);
 		strbuf_addch(&buf, ';');
 	}
-	trace_add_env(&buf, cp->env_array.v);
+	trace_add_env(&buf, cp->env.v);
 	if (cp->git_cmd)
 		strbuf_addstr(&buf, " git");
 	sq_quote_argv_pretty(&buf, cp->args.v);
@@ -751,7 +751,7 @@ int start_command(struct child_process *cmd)
 		set_cloexec(null_fd);
 	}
 
-	childenv = prep_childenv(cmd->env_array.v);
+	childenv = prep_childenv(cmd->env.v);
 	atfork_prepare(&as);
 
 	/*
@@ -914,8 +914,9 @@ int start_command(struct child_process *cmd)
 	else if (cmd->use_shell)
 		cmd->args.v = prepare_shell_cmd(&nargv, sargv);
 
-	cmd->pid = mingw_spawnvpe(cmd->args.v[0], cmd->args.v, (char**) cmd->env_array.v,
-			cmd->dir, fhin, fhout, fherr);
+	cmd->pid = mingw_spawnvpe(cmd->args.v[0], cmd->args.v,
+				  (char**) cmd->env.v,
+				  cmd->dir, fhin, fhout, fherr);
 	failed_errno = errno;
 	if (cmd->pid < 0 && (!cmd->silent_exec_failure || errno != ENOENT))
 		error_errno("cannot spawn %s", cmd->args.v[0]);
@@ -1031,7 +1032,7 @@ int run_command_v_opt_cd_env_tr2(const char **argv, int opt, const char *dir,
 	cmd.close_object_store = opt & RUN_CLOSE_OBJECT_STORE ? 1 : 0;
 	cmd.dir = dir;
 	if (env)
-		strvec_pushv(&cmd.env_array, (const char **)env);
+		strvec_pushv(&cmd.env, (const char **)env);
 	cmd.trace2_child_class = tr2_class;
 	return run_command(&cmd);
 }
diff --git a/run-command.h b/run-command.h
index 07bed6c31b4..89e1bda0c96 100644
--- a/run-command.h
+++ b/run-command.h
@@ -73,7 +73,7 @@ struct child_process {
 	 * The memory in .env_array will be cleaned up automatically during
 	 * `finish_command` (or during `start_command` when it is unsuccessful).
 	 */
-	struct strvec env_array;
+	struct strvec env;
 	pid_t pid;
 
 	int trace2_child_id;
@@ -147,7 +147,7 @@ struct child_process {
 
 #define CHILD_PROCESS_INIT { \
 	.args = STRVEC_INIT, \
-	.env_array = STRVEC_INIT, \
+	.env = STRVEC_INIT, \
 }
 
 /**
diff --git a/sequencer.c b/sequencer.c
index a1bb39383db..3d0331b7689 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1000,7 +1000,7 @@ static int run_git_commit(const char *defmsg,
 	if (is_rebase_i(opts) &&
 	    ((opts->committer_date_is_author_date && !opts->ignore_date) ||
 	     !(!defmsg && (flags & AMEND_MSG))) &&
-	    read_env_script(&cmd.env_array)) {
+	    read_env_script(&cmd.env)) {
 		const char *gpg_opt = gpg_sign_opt_quoted(opts);
 
 		return error(_(staged_changes_advice),
@@ -1008,12 +1008,12 @@ static int run_git_commit(const char *defmsg,
 	}
 
 	if (opts->committer_date_is_author_date)
-		strvec_pushf(&cmd.env_array, "GIT_COMMITTER_DATE=%s",
+		strvec_pushf(&cmd.env, "GIT_COMMITTER_DATE=%s",
 			     opts->ignore_date ?
 			     "" :
-			     author_date_from_env_array(&cmd.env_array));
+			     author_date_from_env_array(&cmd.env));
 	if (opts->ignore_date)
-		strvec_push(&cmd.env_array, "GIT_AUTHOR_DATE=");
+		strvec_push(&cmd.env, "GIT_AUTHOR_DATE=");
 
 	strvec_push(&cmd.args, "commit");
 
@@ -3912,7 +3912,7 @@ static int do_merge(struct repository *r,
 		/* Octopus merge */
 		struct child_process cmd = CHILD_PROCESS_INIT;
 
-		if (read_env_script(&cmd.env_array)) {
+		if (read_env_script(&cmd.env)) {
 			const char *gpg_opt = gpg_sign_opt_quoted(opts);
 
 			ret = error(_(staged_changes_advice), gpg_opt, gpg_opt);
@@ -3920,12 +3920,12 @@ static int do_merge(struct repository *r,
 		}
 
 		if (opts->committer_date_is_author_date)
-			strvec_pushf(&cmd.env_array, "GIT_COMMITTER_DATE=%s",
+			strvec_pushf(&cmd.env, "GIT_COMMITTER_DATE=%s",
 				     opts->ignore_date ?
 				     "" :
-				     author_date_from_env_array(&cmd.env_array));
+				     author_date_from_env_array(&cmd.env));
 		if (opts->ignore_date)
-			strvec_push(&cmd.env_array, "GIT_AUTHOR_DATE=");
+			strvec_push(&cmd.env, "GIT_AUTHOR_DATE=");
 
 		cmd.git_cmd = 1;
 		strvec_push(&cmd.args, "merge");
diff --git a/submodule.c b/submodule.c
index 86c8f0f89db..1229660f02c 100644
--- a/submodule.c
+++ b/submodule.c
@@ -711,15 +711,15 @@ void show_submodule_inline_diff(struct diff_options *o, const char *path,
 	if (!(dirty_submodule & DIRTY_SUBMODULE_MODIFIED))
 		strvec_push(&cp.args, oid_to_hex(new_oid));
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	if (!is_directory(path)) {
 		/* fall back to absorbed git dir, if any */
 		if (!sub)
 			goto done;
 		cp.dir = sub->gitdir;
-		strvec_push(&cp.env_array, GIT_DIR_ENVIRONMENT "=.");
-		strvec_push(&cp.env_array, GIT_WORK_TREE_ENVIRONMENT "=.");
+		strvec_push(&cp.env, GIT_DIR_ENVIRONMENT "=.");
+		strvec_push(&cp.env, GIT_WORK_TREE_ENVIRONMENT "=.");
 	}
 
 	if (start_command(&cp)) {
@@ -1019,7 +1019,7 @@ static int submodule_has_commits(struct repository *r,
 		oid_array_for_each_unique(commits, append_oid_to_argv, &cp.args);
 		strvec_pushl(&cp.args, "--not", "--all", NULL);
 
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.git_cmd = 1;
 		cp.no_stdin = 1;
 		cp.dir = path;
@@ -1060,7 +1060,7 @@ static int submodule_needs_pushing(struct repository *r,
 		oid_array_for_each_unique(commits, append_oid_to_argv, &cp.args);
 		strvec_pushl(&cp.args, "--not", "--remotes", "-n", "1" , NULL);
 
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.git_cmd = 1;
 		cp.no_stdin = 1;
 		cp.out = -1;
@@ -1146,7 +1146,7 @@ static int push_submodule(const char *path,
 				strvec_push(&cp.args, rs->raw[i]);
 		}
 
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.git_cmd = 1;
 		cp.no_stdin = 1;
 		cp.dir = path;
@@ -1177,7 +1177,7 @@ static void submodule_push_check(const char *path, const char *head,
 	for (i = 0; i < rs->raw_nr; i++)
 		strvec_push(&cp.args, rs->raw[i]);
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
 	cp.no_stdout = 1;
@@ -1678,7 +1678,7 @@ static int get_next_submodule(struct child_process *cp, struct strbuf *err,
 
 		child_process_init(cp);
 		cp->dir = task->repo->gitdir;
-		prepare_submodule_repo_env_in_gitdir(&cp->env_array);
+		prepare_submodule_repo_env_in_gitdir(&cp->env);
 		cp->git_cmd = 1;
 		strvec_init(&cp->args);
 		if (task->git_args.nr)
@@ -1708,7 +1708,7 @@ static int get_next_submodule(struct child_process *cp, struct strbuf *err,
 			    spf->prefix, task->sub->path);
 
 		child_process_init(cp);
-		prepare_submodule_repo_env_in_gitdir(&cp->env_array);
+		prepare_submodule_repo_env_in_gitdir(&cp->env);
 		cp->git_cmd = 1;
 		cp->dir = task->repo->gitdir;
 
@@ -1882,7 +1882,7 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked)
 	if (ignore_untracked)
 		strvec_push(&cp.args, "-uno");
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
 	cp.out = -1;
@@ -1954,7 +1954,7 @@ int submodule_uses_gitfile(const char *path)
 		     "submodule", "foreach", "--quiet",	"--recursive",
 		     "test -f .git", NULL);
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
 	cp.no_stderr = 1;
@@ -1997,7 +1997,7 @@ int bad_to_remove_submodule(const char *path, unsigned flags)
 	if (!(flags & SUBMODULE_REMOVAL_IGNORE_IGNORED_UNTRACKED))
 		strvec_push(&cp.args, "--ignored");
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
 	cp.out = -1;
@@ -2052,7 +2052,7 @@ static int submodule_has_dirty_index(const struct submodule *sub)
 {
 	struct child_process cp = CHILD_PROCESS_INIT;
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	cp.git_cmd = 1;
 	strvec_pushl(&cp.args, "diff-index", "--quiet",
@@ -2069,7 +2069,7 @@ static int submodule_has_dirty_index(const struct submodule *sub)
 static void submodule_reset_index(const char *path)
 {
 	struct child_process cp = CHILD_PROCESS_INIT;
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
@@ -2153,7 +2153,7 @@ int submodule_move_head(const char *path,
 		}
 	}
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
@@ -2191,7 +2191,7 @@ int submodule_move_head(const char *path,
 			cp.no_stdin = 1;
 			cp.dir = path;
 
-			prepare_submodule_repo_env(&cp.env_array);
+			prepare_submodule_repo_env(&cp.env);
 			strvec_pushl(&cp.args, "update-ref", "HEAD",
 				     "--no-deref", new_head, NULL);
 
@@ -2374,7 +2374,7 @@ void absorb_git_dir_into_superproject(const char *path,
 		strvec_pushl(&cp.args, "--super-prefix", sb.buf,
 			     "submodule--helper",
 			     "absorb-git-dirs", NULL);
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		if (run_command(&cp))
 			die(_("could not recurse into submodule '%s'"), path);
 
@@ -2407,8 +2407,8 @@ int get_superproject_working_tree(struct strbuf *buf)
 	subpath = relative_path(cwd, one_up.buf, &sb);
 	strbuf_release(&one_up);
 
-	prepare_submodule_repo_env(&cp.env_array);
-	strvec_pop(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
+	strvec_pop(&cp.env);
 
 	strvec_pushl(&cp.args, "--literal-pathspecs", "-C", "..",
 		     "ls-files", "-z", "--stage", "--full-name", "--",
diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c
index f3b90aa834a..9050e3113c5 100644
--- a/t/helper/test-run-command.c
+++ b/t/helper/test-run-command.c
@@ -390,7 +390,7 @@ int cmd__run_command(int argc, const char **argv)
 	while (!strcmp(argv[1], "env")) {
 		if (!argv[2])
 			die("env specifier without a value");
-		strvec_push(&proc.env_array, argv[2]);
+		strvec_push(&proc.env, argv[2]);
 		argv += 2;
 		argc -= 2;
 	}
diff --git a/trailer.c b/trailer.c
index 1b12f77d945..52fa47aac68 100644
--- a/trailer.c
+++ b/trailer.c
@@ -236,7 +236,7 @@ static char *apply_command(struct conf_info *conf, const char *arg)
 			strbuf_replace(&cmd, TRAILER_ARG_STRING, arg);
 		strvec_push(&cp.args, cmd.buf);
 	}
-	strvec_pushv(&cp.env_array, (const char **)local_repo_env);
+	strvec_pushv(&cp.env, (const char **)local_repo_env);
 	cp.no_stdin = 1;
 	cp.use_shell = 1;
 
diff --git a/transport-helper.c b/transport-helper.c
index b4dbbabb0c2..322c7224782 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -135,7 +135,7 @@ static struct child_process *get_helper(struct transport *transport)
 	helper->silent_exec_failure = 1;
 
 	if (have_git_dir())
-		strvec_pushf(&helper->env_array, "%s=%s",
+		strvec_pushf(&helper->env, "%s=%s",
 			     GIT_DIR_ENVIRONMENT, get_git_dir());
 
 	helper->trace2_child_class = helper->args.v[0]; /* "remote-<name>" */
diff --git a/wt-status.c b/wt-status.c
index d33f9272b72..62fadc0c93d 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -982,7 +982,7 @@ static void wt_longstatus_print_submodule_summary(struct wt_status *s, int uncom
 	struct strbuf summary = STRBUF_INIT;
 	char *summary_content;
 
-	strvec_pushf(&sm_summary.env_array, "GIT_INDEX_FILE=%s", s->index_file);
+	strvec_pushf(&sm_summary.env, "GIT_INDEX_FILE=%s", s->index_file);
 
 	strvec_push(&sm_summary.args, "submodule");
 	strvec_push(&sm_summary.args, "summary");
-- 
2.36.0.rc0.849.g2d5b5d9ab01


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 3/3] run-command API users: use "env" not "env_array" in comments & names
  2022-04-06 10:42     ` [PATCH 0/3] run-command.h: rename "env_array" to "env" Ævar Arnfjörð Bjarmason
  2022-04-06 10:42       ` [PATCH 1/3] cocci: add a rename of "struct child_process"'s " Ævar Arnfjörð Bjarmason
  2022-04-06 10:42       ` [PATCH 2/3] run-command API: rename " Ævar Arnfjörð Bjarmason
@ 2022-04-06 10:42       ` Ævar Arnfjörð Bjarmason
  2022-04-07 12:09       ` [PATCH 0/3] run-command.h: rename "env_array" to "env" Johannes Schindelin
  2022-05-20  7:24       ` [PATCH v2 0/4] " Ævar Arnfjörð Bjarmason
  4 siblings, 0 replies; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-04-06 10:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Enzo Matsumiya, Eric Sunshine,
	Ævar Arnfjörð Bjarmason

Follow-up on the preceding commit which changed all references to the
"env_array" when referring to the "struct child_process" member. These
changes are all unnecessary for the compiler, but help the code's
human readers.

All the comments that referred to "env_array" have now been updated,
as well as function names and variables that had "env_array" in their
name, they now refer to "env".

In addition the "out" name for the submodule.h prototype was
inconsistent with the function definition's use of "env_array" in
submodule.c. Both of them use "env" now.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/submodule--helper.c |  2 +-
 run-command.c               |  6 +++---
 run-command.h               | 10 +++++-----
 sequencer.c                 |  6 +++---
 submodule.h                 |  4 ++--
 5 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index d89184fbf47..0f1b82fd87f 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -513,7 +513,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
 		 * on windows. And since environment variables are
 		 * case-insensitive in windows, it interferes with the
 		 * existing PATH variable. Hence, to avoid that, we expose
-		 * path via the args strvec and not via env_array.
+		 * path via the args strvec and not via env.
 		 */
 		sq_quote_buf(&sb, path);
 		strvec_pushf(&cp.args, "path=%s; %s",
diff --git a/run-command.c b/run-command.c
index 5f7ea713f06..789eaa59750 100644
--- a/run-command.c
+++ b/run-command.c
@@ -1816,16 +1816,16 @@ int run_auto_maintenance(int quiet)
 	return run_command(&maint);
 }
 
-void prepare_other_repo_env(struct strvec *env_array, const char *new_git_dir)
+void prepare_other_repo_env(struct strvec *env, const char *new_git_dir)
 {
 	const char * const *var;
 
 	for (var = local_repo_env; *var; var++) {
 		if (strcmp(*var, CONFIG_DATA_ENVIRONMENT) &&
 		    strcmp(*var, CONFIG_COUNT_ENVIRONMENT))
-			strvec_push(env_array, *var);
+			strvec_push(env, *var);
 	}
-	strvec_pushf(env_array, "%s=%s", GIT_DIR_ENVIRONMENT, new_git_dir);
+	strvec_pushf(env, "%s=%s", GIT_DIR_ENVIRONMENT, new_git_dir);
 }
 
 enum start_bg_result start_bg_command(struct child_process *cmd,
diff --git a/run-command.h b/run-command.h
index 89e1bda0c96..bb43ccf646e 100644
--- a/run-command.h
+++ b/run-command.h
@@ -58,7 +58,7 @@ struct child_process {
 	struct strvec args;
 
 	/**
-	 * Like .args the .env_array is a `struct strvec'.
+	 * Like .args the .env is a `struct strvec'.
 	 *
 	 * To modify the environment of the sub-process, specify an array of
 	 * environment settings. Each string in the array manipulates the
@@ -70,7 +70,7 @@ struct child_process {
 	 * - If the string does not contain '=', it names an environment
 	 *   variable that will be removed from the child process's environment.
 	 *
-	 * The memory in .env_array will be cleaned up automatically during
+	 * The memory in .env will be cleaned up automatically during
 	 * `finish_command` (or during `start_command` when it is unsuccessful).
 	 */
 	struct strvec env;
@@ -480,14 +480,14 @@ int run_processes_parallel_tr2(int n, get_next_task_fn, start_failure_fn,
 			       const char *tr2_category, const char *tr2_label);
 
 /**
- * Convenience function which prepares env_array for a command to be run in a
- * new repo. This adds all GIT_* environment variables to env_array with the
+ * Convenience function which prepares env for a command to be run in a
+ * new repo. This adds all GIT_* environment variables to env with the
  * exception of GIT_CONFIG_PARAMETERS and GIT_CONFIG_COUNT (which cause the
  * corresponding environment variables to be unset in the subprocess) and adds
  * an environment variable pointing to new_git_dir. See local_repo_env in
  * cache.h for more information.
  */
-void prepare_other_repo_env(struct strvec *env_array, const char *new_git_dir);
+void prepare_other_repo_env(struct strvec *env, const char *new_git_dir);
 
 /**
  * Possible return values for start_bg_command().
diff --git a/sequencer.c b/sequencer.c
index 3d0331b7689..79e14b51a23 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -919,7 +919,7 @@ static char *get_author(const char *message)
 	return NULL;
 }
 
-static const char *author_date_from_env_array(const struct strvec *env)
+static const char *author_date_from_env(const struct strvec *env)
 {
 	int i;
 	const char *date;
@@ -1011,7 +1011,7 @@ static int run_git_commit(const char *defmsg,
 		strvec_pushf(&cmd.env, "GIT_COMMITTER_DATE=%s",
 			     opts->ignore_date ?
 			     "" :
-			     author_date_from_env_array(&cmd.env));
+			     author_date_from_env(&cmd.env));
 	if (opts->ignore_date)
 		strvec_push(&cmd.env, "GIT_AUTHOR_DATE=");
 
@@ -3923,7 +3923,7 @@ static int do_merge(struct repository *r,
 			strvec_pushf(&cmd.env, "GIT_COMMITTER_DATE=%s",
 				     opts->ignore_date ?
 				     "" :
-				     author_date_from_env_array(&cmd.env));
+				     author_date_from_env(&cmd.env));
 		if (opts->ignore_date)
 			strvec_push(&cmd.env, "GIT_AUTHOR_DATE=");
 
diff --git a/submodule.h b/submodule.h
index 40c14452377..2ac7a04e726 100644
--- a/submodule.h
+++ b/submodule.h
@@ -158,11 +158,11 @@ int submodule_move_head(const char *path,
 void submodule_unset_core_worktree(const struct submodule *sub);
 
 /*
- * Prepare the "env_array" parameter of a "struct child_process" for executing
+ * Prepare the "env" parameter of a "struct child_process" for executing
  * a submodule by clearing any repo-specific environment variables, but
  * retaining any config in the environment.
  */
-void prepare_submodule_repo_env(struct strvec *out);
+void prepare_submodule_repo_env(struct strvec *env);
 
 #define ABSORB_GITDIR_RECURSE_SUBMODULES (1<<0)
 void absorb_git_dir_into_superproject(const char *path,
-- 
2.36.0.rc0.849.g2d5b5d9ab01


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/3] run-command.h: rename "env_array" to "env"
  2022-04-06 10:42     ` [PATCH 0/3] run-command.h: rename "env_array" to "env" Ævar Arnfjörð Bjarmason
                         ` (2 preceding siblings ...)
  2022-04-06 10:42       ` [PATCH 3/3] run-command API users: use "env" not "env_array" in comments & names Ævar Arnfjörð Bjarmason
@ 2022-04-07 12:09       ` Johannes Schindelin
  2022-04-07 16:48         ` Junio C Hamano
  2022-05-20  7:24       ` [PATCH v2 0/4] " Ævar Arnfjörð Bjarmason
  4 siblings, 1 reply; 26+ messages in thread
From: Johannes Schindelin @ 2022-04-07 12:09 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Junio C Hamano, Jeff King, Enzo Matsumiya, Eric Sunshine

[-- Attachment #1: Type: text/plain, Size: 580 bytes --]

Hi Ævar,

On Wed, 6 Apr 2022, Ævar Arnfjörð Bjarmason wrote:

> Junio: We're in the RC period, but perhaps this change if we're ever
> going to make it would be good to make around that time of patch
> slowdown. I.e. for the first batch after release.

Good thinking about the first batch after release. However, please do send
such cleanups really only after the release. The reason for the patch
slowdown is that we want to be able to focus on making a rock-solid
v2.36.0. This here patch series is very much a distraction at this point.

Thank you,
Johannes

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/3] run-command.h: rename "env_array" to "env"
  2022-04-07 12:09       ` [PATCH 0/3] run-command.h: rename "env_array" to "env" Johannes Schindelin
@ 2022-04-07 16:48         ` Junio C Hamano
  2022-04-07 17:52           ` Junio C Hamano
  0 siblings, 1 reply; 26+ messages in thread
From: Junio C Hamano @ 2022-04-07 16:48 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Ævar Arnfjörð Bjarmason, git, Jeff King,
	Enzo Matsumiya, Eric Sunshine

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> On Wed, 6 Apr 2022, Ævar Arnfjörð Bjarmason wrote:
>
>> Junio: We're in the RC period, but perhaps this change if we're ever
>> going to make it would be good to make around that time of patch
>> slowdown. I.e. for the first batch after release.
>
> Good thinking about the first batch after release. However, please do send
> such cleanups really only after the release. The reason for the patch
> slowdown is that we want to be able to focus on making a rock-solid
> v2.36.0. This here patch series is very much a distraction at this point.

OK.

FWIW, I have it near the tip of 'seen', but if any fix that is more
urgent than these changes need to be added to 'next' and down to
'master' makes the version queued no longer apply, I will drop it
immediately, instead of spending cycles to figure out if it is worth
resolving the conflict and requeuing it in 'seen' during the -rc
period ;-)


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/3] run-command.h: rename "env_array" to "env"
  2022-04-07 16:48         ` Junio C Hamano
@ 2022-04-07 17:52           ` Junio C Hamano
  0 siblings, 0 replies; 26+ messages in thread
From: Junio C Hamano @ 2022-04-07 17:52 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Ævar Arnfjörð Bjarmason, git, Jeff King,
	Enzo Matsumiya, Eric Sunshine

Junio C Hamano <gitster@pobox.com> writes:

>> Good thinking about the first batch after release. However, please do send
>> such cleanups really only after the release. The reason for the patch
>> slowdown is that we want to be able to focus on making a rock-solid
>> v2.36.0. This here patch series is very much a distraction at this point.
>
> OK.
>
> FWIW, I have it near the tip of 'seen', but if any fix that is more
> urgent than these changes need to be added to 'next' and down to
> 'master' makes the version queued no longer apply, I will drop it
> immediately, instead of spending cycles to figure out if it is worth
> resolving the conflict and requeuing it in 'seen' during the -rc
> period ;-)

To be fair, I actually do appreciate an early heads-up to warn
against other contributors to think twice before adding more uses of
the env-array and consider if a different approach without using the
env-array would result in better code.  It would have been better to
stress on such an early warning aspect of the series by marking the
series explicitly "not for application during -rc".

The true -rc freeze where nothing goes into 'next' (unless it is a
regression fix for this cycle) starts tomorrow at -rc1; I think I've
picked up everything relevant that have been posted in the past few
days.

Thanks.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH v2 0/4] run-command.h: rename "env_array" to "env"
  2022-04-06 10:42     ` [PATCH 0/3] run-command.h: rename "env_array" to "env" Ævar Arnfjörð Bjarmason
                         ` (3 preceding siblings ...)
  2022-04-07 12:09       ` [PATCH 0/3] run-command.h: rename "env_array" to "env" Johannes Schindelin
@ 2022-05-20  7:24       ` Ævar Arnfjörð Bjarmason
  2022-05-20  7:24         ` [PATCH v2 1/4] cocci: add a rename of "struct child_process"'s " Ævar Arnfjörð Bjarmason
                           ` (5 more replies)
  4 siblings, 6 replies; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-05-20  7:24 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Enzo Matsumiya, Eric Sunshine,
	Ævar Arnfjörð Bjarmason

Follow-up 32ec72c3e1 (Merge branch 'ab/run-command', 2021-12-15) and
rename the "env_array" member to simply "env" in the "struct
child_process".

Changes since v1:

 * Added a commit to remove the coccinelle rule after its application,
   as suggested by Junio in
   https://lore.kernel.org/git/xmqqzgjdkxon.fsf@gitster.g/

 * Minor commit rewording for 4/4 to adjust for that new 3/4.

Ævar Arnfjörð Bjarmason (4):
  cocci: add a rename of "struct child_process"'s "env_array" to "env"
  run-command API: rename "env_array" to "env"
  cocci: remove env_array -> env migration
  run-command API users: use "env" not "env_array" in comments & names

 add-patch.c                 |  2 +-
 branch.c                    |  2 +-
 builtin/difftool.c          |  6 ++---
 builtin/receive-pack.c      | 32 +++++++++++++--------------
 builtin/stash.c             | 16 +++++++-------
 builtin/submodule--helper.c | 44 ++++++++++++++++++-------------------
 builtin/worktree.c          |  8 +++----
 connect.c                   |  9 ++++----
 connected.c                 |  2 +-
 daemon.c                    | 14 ++++++------
 editor.c                    |  2 +-
 hook.c                      |  2 +-
 http-backend.c              |  4 ++--
 object-file.c               |  2 +-
 pager.c                     |  4 ++--
 promisor-remote.c           |  2 +-
 run-command.c               | 19 ++++++++--------
 run-command.h               | 14 ++++++------
 sequencer.c                 | 18 +++++++--------
 submodule.c                 | 38 ++++++++++++++++----------------
 submodule.h                 |  4 ++--
 t/helper/test-run-command.c |  2 +-
 trailer.c                   |  2 +-
 transport-helper.c          |  2 +-
 wt-status.c                 |  2 +-
 25 files changed, 127 insertions(+), 125 deletions(-)

Range-diff against v1:
1:  b943ed5d5b7 = 1:  e3f33fce566 cocci: add a rename of "struct child_process"'s "env_array" to "env"
2:  51063a31b16 = 2:  5aeb6ec9117 run-command API: rename "env_array" to "env"
-:  ----------- > 3:  ca09da570ef cocci: remove env_array -> env migration
3:  8af76f39b9f ! 4:  5419f839c74 run-command API users: use "env" not "env_array" in comments & names
    @@ Metadata
      ## Commit message ##
         run-command API users: use "env" not "env_array" in comments & names
     
    -    Follow-up on the preceding commit which changed all references to the
    +    Follow-up on a preceding commit which changed all references to the
         "env_array" when referring to the "struct child_process" member. These
         changes are all unnecessary for the compiler, but help the code's
         human readers.
-- 
2.36.1.957.g2c13267e09b


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH v2 1/4] cocci: add a rename of "struct child_process"'s "env_array" to "env"
  2022-05-20  7:24       ` [PATCH v2 0/4] " Ævar Arnfjörð Bjarmason
@ 2022-05-20  7:24         ` Ævar Arnfjörð Bjarmason
  2022-05-20  7:24         ` [PATCH v2 2/4] run-command API: rename " Ævar Arnfjörð Bjarmason
                           ` (4 subsequent siblings)
  5 siblings, 0 replies; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-05-20  7:24 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Enzo Matsumiya, Eric Sunshine,
	Ævar Arnfjörð Bjarmason

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 is added as a "pending" migration because it'll need a couple of
manual changes to go along with it, those will be performed in the
subsequent commit.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 contrib/coccinelle/run_command.pending.cocci | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 contrib/coccinelle/run_command.pending.cocci

diff --git a/contrib/coccinelle/run_command.pending.cocci b/contrib/coccinelle/run_command.pending.cocci
new file mode 100644
index 00000000000..709fdfcf720
--- /dev/null
+++ b/contrib/coccinelle/run_command.pending.cocci
@@ -0,0 +1,11 @@
+@@
+struct child_process E;
+@@
+- E.env_array
++ E.env
+
+@@
+struct child_process *E;
+@@
+- E->env_array
++ E->env
-- 
2.36.1.957.g2c13267e09b


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 2/4] run-command API: rename "env_array" to "env"
  2022-05-20  7:24       ` [PATCH v2 0/4] " Ævar Arnfjörð Bjarmason
  2022-05-20  7:24         ` [PATCH v2 1/4] cocci: add a rename of "struct child_process"'s " Ævar Arnfjörð Bjarmason
@ 2022-05-20  7:24         ` Ævar Arnfjörð Bjarmason
  2022-05-20  7:24         ` [PATCH v2 3/4] cocci: remove env_array -> env migration Ævar Arnfjörð Bjarmason
                           ` (3 subsequent siblings)
  5 siblings, 0 replies; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-05-20  7:24 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Enzo Matsumiya, Eric Sunshine,
	Ævar Arnfjörð Bjarmason

As noted in the preceding commit it would be nice to not deal with the
oddity of having an "_array" suffix for the "env" strvec, but not for
its "args" sibling.

We can do that with coccinelle in a way that's easy to review. The
only manual changes in this commit are:

 * git mv contrib/coccinelle/run_command{.pending,}.cocci
 * The change in run-command.h to rename the struct member itself, and
   to change its initializer.

The rest of this is all the result of a subsequent:

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

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>
---
 add-patch.c                                   |  2 +-
 branch.c                                      |  2 +-
 builtin/difftool.c                            |  6 +--
 builtin/receive-pack.c                        | 32 +++++++-------
 builtin/stash.c                               | 16 +++----
 builtin/submodule--helper.c                   | 42 +++++++++----------
 builtin/worktree.c                            |  8 ++--
 connect.c                                     |  9 ++--
 connected.c                                   |  2 +-
 ...ommand.pending.cocci => run_command.cocci} |  0
 daemon.c                                      | 14 +++----
 editor.c                                      |  2 +-
 hook.c                                        |  2 +-
 http-backend.c                                |  4 +-
 object-file.c                                 |  2 +-
 pager.c                                       |  4 +-
 promisor-remote.c                             |  2 +-
 run-command.c                                 | 13 +++---
 run-command.h                                 |  4 +-
 sequencer.c                                   | 16 +++----
 submodule.c                                   | 38 ++++++++---------
 t/helper/test-run-command.c                   |  2 +-
 trailer.c                                     |  2 +-
 transport-helper.c                            |  2 +-
 wt-status.c                                   |  2 +-
 25 files changed, 115 insertions(+), 113 deletions(-)
 rename contrib/coccinelle/{run_command.pending.cocci => run_command.cocci} (100%)

diff --git a/add-patch.c b/add-patch.c
index 55d719f7845..509ca04456b 100644
--- a/add-patch.c
+++ b/add-patch.c
@@ -305,7 +305,7 @@ static void setup_child_process(struct add_p_state *s,
 	va_end(ap);
 
 	cp->git_cmd = 1;
-	strvec_pushf(&cp->env_array,
+	strvec_pushf(&cp->env,
 		     INDEX_ENVIRONMENT "=%s", s->s.r->index_file);
 }
 
diff --git a/branch.c b/branch.c
index 01ecb816d5c..3a89a547839 100644
--- a/branch.c
+++ b/branch.c
@@ -564,7 +564,7 @@ static int submodule_create_branch(struct repository *r,
 	child.err = -1;
 	child.stdout_to_stderr = 1;
 
-	prepare_other_repo_env(&child.env_array, r->gitdir);
+	prepare_other_repo_env(&child.env, r->gitdir);
 	/*
 	 * submodule_create_branch() is indirectly invoked by "git
 	 * branch", but we cannot invoke "git branch" in the child
diff --git a/builtin/difftool.c b/builtin/difftool.c
index faa3507369a..b3c509b8de3 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -217,7 +217,7 @@ static void changed_files(struct hashmap *result, const char *index_path,
 	update_index.use_shell = 0;
 	update_index.clean_on_exit = 1;
 	update_index.dir = workdir;
-	strvec_pushf(&update_index.env_array, "GIT_INDEX_FILE=%s", index_path);
+	strvec_pushf(&update_index.env, "GIT_INDEX_FILE=%s", index_path);
 	/* Ignore any errors of update-index */
 	run_command(&update_index);
 
@@ -230,7 +230,7 @@ static void changed_files(struct hashmap *result, const char *index_path,
 	diff_files.clean_on_exit = 1;
 	diff_files.out = -1;
 	diff_files.dir = workdir;
-	strvec_pushf(&diff_files.env_array, "GIT_INDEX_FILE=%s", index_path);
+	strvec_pushf(&diff_files.env, "GIT_INDEX_FILE=%s", index_path);
 	if (start_command(&diff_files))
 		die("could not obtain raw diff");
 	fp = xfdopen(diff_files.out, "r");
@@ -675,7 +675,7 @@ static int run_file_diff(int prompt, const char *prefix,
 
 	child->git_cmd = 1;
 	child->dir = prefix;
-	strvec_pushv(&child->env_array, env);
+	strvec_pushv(&child->env, env);
 
 	return run_command(child);
 }
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 9aabffa1afb..acc512f3a36 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -764,23 +764,23 @@ static void prepare_push_cert_sha1(struct child_process *proc)
 		nonce_status = check_nonce(push_cert.buf, bogs);
 	}
 	if (!is_null_oid(&push_cert_oid)) {
-		strvec_pushf(&proc->env_array, "GIT_PUSH_CERT=%s",
+		strvec_pushf(&proc->env, "GIT_PUSH_CERT=%s",
 			     oid_to_hex(&push_cert_oid));
-		strvec_pushf(&proc->env_array, "GIT_PUSH_CERT_SIGNER=%s",
+		strvec_pushf(&proc->env, "GIT_PUSH_CERT_SIGNER=%s",
 			     sigcheck.signer ? sigcheck.signer : "");
-		strvec_pushf(&proc->env_array, "GIT_PUSH_CERT_KEY=%s",
+		strvec_pushf(&proc->env, "GIT_PUSH_CERT_KEY=%s",
 			     sigcheck.key ? sigcheck.key : "");
-		strvec_pushf(&proc->env_array, "GIT_PUSH_CERT_STATUS=%c",
+		strvec_pushf(&proc->env, "GIT_PUSH_CERT_STATUS=%c",
 			     sigcheck.result);
 		if (push_cert_nonce) {
-			strvec_pushf(&proc->env_array,
+			strvec_pushf(&proc->env,
 				     "GIT_PUSH_CERT_NONCE=%s",
 				     push_cert_nonce);
-			strvec_pushf(&proc->env_array,
+			strvec_pushf(&proc->env,
 				     "GIT_PUSH_CERT_NONCE_STATUS=%s",
 				     nonce_status);
 			if (nonce_status == NONCE_SLOP)
-				strvec_pushf(&proc->env_array,
+				strvec_pushf(&proc->env,
 					     "GIT_PUSH_CERT_NONCE_SLOP=%ld",
 					     nonce_stamp_slop);
 		}
@@ -815,17 +815,17 @@ static int run_and_feed_hook(const char *hook_name, feed_fn feed,
 	if (feed_state->push_options) {
 		size_t i;
 		for (i = 0; i < feed_state->push_options->nr; i++)
-			strvec_pushf(&proc.env_array,
+			strvec_pushf(&proc.env,
 				     "GIT_PUSH_OPTION_%"PRIuMAX"=%s",
 				     (uintmax_t)i,
 				     feed_state->push_options->items[i].string);
-		strvec_pushf(&proc.env_array, "GIT_PUSH_OPTION_COUNT=%"PRIuMAX"",
+		strvec_pushf(&proc.env, "GIT_PUSH_OPTION_COUNT=%"PRIuMAX"",
 			     (uintmax_t)feed_state->push_options->nr);
 	} else
-		strvec_pushf(&proc.env_array, "GIT_PUSH_OPTION_COUNT");
+		strvec_pushf(&proc.env, "GIT_PUSH_OPTION_COUNT");
 
 	if (tmp_objdir)
-		strvec_pushv(&proc.env_array, tmp_objdir_env(tmp_objdir));
+		strvec_pushv(&proc.env, tmp_objdir_env(tmp_objdir));
 
 	if (use_sideband) {
 		memset(&muxer, 0, sizeof(muxer));
@@ -1357,7 +1357,7 @@ static const char *push_to_deploy(unsigned char *sha1,
 
 	strvec_pushl(&child.args, "update-index", "-q", "--ignore-submodules",
 		     "--refresh", NULL);
-	strvec_pushv(&child.env_array, env->v);
+	strvec_pushv(&child.env, env->v);
 	child.dir = work_tree;
 	child.no_stdin = 1;
 	child.stdout_to_stderr = 1;
@@ -1369,7 +1369,7 @@ static const char *push_to_deploy(unsigned char *sha1,
 	child_process_init(&child);
 	strvec_pushl(&child.args, "diff-files", "--quiet",
 		     "--ignore-submodules", "--", NULL);
-	strvec_pushv(&child.env_array, env->v);
+	strvec_pushv(&child.env, env->v);
 	child.dir = work_tree;
 	child.no_stdin = 1;
 	child.stdout_to_stderr = 1;
@@ -1383,7 +1383,7 @@ static const char *push_to_deploy(unsigned char *sha1,
 		     /* diff-index with either HEAD or an empty tree */
 		     head_has_history() ? "HEAD" : empty_tree_oid_hex(),
 		     "--", NULL);
-	strvec_pushv(&child.env_array, env->v);
+	strvec_pushv(&child.env, env->v);
 	child.no_stdin = 1;
 	child.no_stdout = 1;
 	child.stdout_to_stderr = 0;
@@ -1394,7 +1394,7 @@ static const char *push_to_deploy(unsigned char *sha1,
 	child_process_init(&child);
 	strvec_pushl(&child.args, "read-tree", "-u", "-m", hash_to_hex(sha1),
 		     NULL);
-	strvec_pushv(&child.env_array, env->v);
+	strvec_pushv(&child.env, env->v);
 	child.dir = work_tree;
 	child.no_stdin = 1;
 	child.no_stdout = 1;
@@ -2215,7 +2215,7 @@ static const char *unpack(int err_fd, struct shallow_info *si)
 		return "unable to create temporary object directory";
 	}
 	if (tmp_objdir)
-		strvec_pushv(&child.env_array, tmp_objdir_env(tmp_objdir));
+		strvec_pushv(&child.env, tmp_objdir_env(tmp_objdir));
 
 	/*
 	 * Normally we just pass the tmp_objdir environment to the child
diff --git a/builtin/stash.c b/builtin/stash.c
index 0c7b6a95882..054f04336f5 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -356,7 +356,7 @@ static int restore_untracked(struct object_id *u_tree)
 	cp.git_cmd = 1;
 	strvec_push(&cp.args, "read-tree");
 	strvec_push(&cp.args, oid_to_hex(u_tree));
-	strvec_pushf(&cp.env_array, "GIT_INDEX_FILE=%s",
+	strvec_pushf(&cp.env, "GIT_INDEX_FILE=%s",
 		     stash_index_path.buf);
 	if (run_command(&cp)) {
 		remove_path(stash_index_path.buf);
@@ -366,7 +366,7 @@ static int restore_untracked(struct object_id *u_tree)
 	child_process_init(&cp);
 	cp.git_cmd = 1;
 	strvec_pushl(&cp.args, "checkout-index", "--all", NULL);
-	strvec_pushf(&cp.env_array, "GIT_INDEX_FILE=%s",
+	strvec_pushf(&cp.env, "GIT_INDEX_FILE=%s",
 		     stash_index_path.buf);
 
 	res = run_command(&cp);
@@ -585,9 +585,9 @@ static int do_apply_stash(const char *prefix, struct stash_info *info,
 		 */
 		cp.git_cmd = 1;
 		cp.dir = prefix;
-		strvec_pushf(&cp.env_array, GIT_WORK_TREE_ENVIRONMENT"=%s",
+		strvec_pushf(&cp.env, GIT_WORK_TREE_ENVIRONMENT"=%s",
 			     absolute_path(get_git_work_tree()));
-		strvec_pushf(&cp.env_array, GIT_DIR_ENVIRONMENT"=%s",
+		strvec_pushf(&cp.env, GIT_DIR_ENVIRONMENT"=%s",
 			     absolute_path(get_git_dir()));
 		strvec_push(&cp.args, "status");
 		run_command(&cp);
@@ -1088,7 +1088,7 @@ static int save_untracked_files(struct stash_info *info, struct strbuf *msg,
 	cp_upd_index.git_cmd = 1;
 	strvec_pushl(&cp_upd_index.args, "update-index", "-z", "--add",
 		     "--remove", "--stdin", NULL);
-	strvec_pushf(&cp_upd_index.env_array, "GIT_INDEX_FILE=%s",
+	strvec_pushf(&cp_upd_index.env, "GIT_INDEX_FILE=%s",
 			 stash_index_path.buf);
 
 	strbuf_addf(&untracked_msg, "untracked files on %s\n", msg->buf);
@@ -1162,7 +1162,7 @@ static int stash_patch(struct stash_info *info, const struct pathspec *ps,
 
 	cp_read_tree.git_cmd = 1;
 	strvec_pushl(&cp_read_tree.args, "read-tree", "HEAD", NULL);
-	strvec_pushf(&cp_read_tree.env_array, "GIT_INDEX_FILE=%s",
+	strvec_pushf(&cp_read_tree.env, "GIT_INDEX_FILE=%s",
 		     stash_index_path.buf);
 	if (run_command(&cp_read_tree)) {
 		ret = -1;
@@ -1249,7 +1249,7 @@ static int stash_working_tree(struct stash_info *info, const struct pathspec *ps
 	strvec_pushl(&cp_upd_index.args, "update-index",
 		     "--ignore-skip-worktree-entries",
 		     "-z", "--add", "--remove", "--stdin", NULL);
-	strvec_pushf(&cp_upd_index.env_array, "GIT_INDEX_FILE=%s",
+	strvec_pushf(&cp_upd_index.env, "GIT_INDEX_FILE=%s",
 		     stash_index_path.buf);
 
 	if (pipe_command(&cp_upd_index, diff_output.buf, diff_output.len,
@@ -1525,7 +1525,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q
 			cp.git_cmd = 1;
 			if (startup_info->original_cwd) {
 				cp.dir = startup_info->original_cwd;
-				strvec_pushf(&cp.env_array, "%s=%s",
+				strvec_pushf(&cp.env, "%s=%s",
 					     GIT_WORK_TREE_ENVIRONMENT,
 					     the_repository->worktree);
 			}
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 1a8e5d06214..b855e544bd6 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -292,7 +292,7 @@ static char *compute_rev_name(const char *sub_path, const char* object_id)
 
 	for (d = describe_argv; *d; d++) {
 		struct child_process cp = CHILD_PROCESS_INIT;
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.dir = sub_path;
 		cp.git_cmd = 1;
 		cp.no_stderr = 1;
@@ -479,7 +479,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
 	if (!is_submodule_populated_gently(path, NULL))
 		goto cleanup;
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	/*
 	 * For the purpose of executing <command> in the submodule,
@@ -499,12 +499,12 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
 		char *toplevel = xgetcwd();
 		struct strbuf sb = STRBUF_INIT;
 
-		strvec_pushf(&cp.env_array, "name=%s", sub->name);
-		strvec_pushf(&cp.env_array, "sm_path=%s", path);
-		strvec_pushf(&cp.env_array, "displaypath=%s", displaypath);
-		strvec_pushf(&cp.env_array, "sha1=%s",
+		strvec_pushf(&cp.env, "name=%s", sub->name);
+		strvec_pushf(&cp.env, "sm_path=%s", path);
+		strvec_pushf(&cp.env, "displaypath=%s", displaypath);
+		strvec_pushf(&cp.env, "sha1=%s",
 			     oid_to_hex(ce_oid));
-		strvec_pushf(&cp.env_array, "toplevel=%s", toplevel);
+		strvec_pushf(&cp.env, "toplevel=%s", toplevel);
 
 		/*
 		 * Since the path variable was accessible from the script
@@ -536,7 +536,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
 
 		cpr.git_cmd = 1;
 		cpr.dir = path;
-		prepare_submodule_repo_env(&cpr.env_array);
+		prepare_submodule_repo_env(&cpr.env);
 
 		strvec_pushl(&cpr.args, "--super-prefix", NULL);
 		strvec_pushf(&cpr.args, "%s/", displaypath);
@@ -833,7 +833,7 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,
 
 		cpr.git_cmd = 1;
 		cpr.dir = path;
-		prepare_submodule_repo_env(&cpr.env_array);
+		prepare_submodule_repo_env(&cpr.env);
 
 		strvec_push(&cpr.args, "--super-prefix");
 		strvec_pushf(&cpr.args, "%s/", displaypath);
@@ -955,7 +955,7 @@ static char *verify_submodule_committish(const char *sm_path,
 
 	cp_rev_parse.git_cmd = 1;
 	cp_rev_parse.dir = sm_path;
-	prepare_submodule_repo_env(&cp_rev_parse.env_array);
+	prepare_submodule_repo_env(&cp_rev_parse.env);
 	strvec_pushl(&cp_rev_parse.args, "rev-parse", "-q", "--short", NULL);
 	strvec_pushf(&cp_rev_parse.args, "%s^0", committish);
 	strvec_push(&cp_rev_parse.args, "--");
@@ -996,7 +996,7 @@ static void print_submodule_summary(struct summary_cb *info, char *errmsg,
 
 		cp_log.git_cmd = 1;
 		cp_log.dir = p->sm_path;
-		prepare_submodule_repo_env(&cp_log.env_array);
+		prepare_submodule_repo_env(&cp_log.env);
 		strvec_pushl(&cp_log.args, "log", NULL);
 
 		if (S_ISGITLINK(p->mod_src) && S_ISGITLINK(p->mod_dst)) {
@@ -1113,7 +1113,7 @@ static void generate_submodule_summary(struct summary_cb *info,
 
 		cp_rev_list.git_cmd = 1;
 		cp_rev_list.dir = p->sm_path;
-		prepare_submodule_repo_env(&cp_rev_list.env_array);
+		prepare_submodule_repo_env(&cp_rev_list.env);
 
 		if (!capture_command(&cp_rev_list, &sb_rev_list, 0))
 			total_commits = atoi(sb_rev_list.buf);
@@ -1414,7 +1414,7 @@ static void sync_submodule(const char *path, const char *prefix,
 
 		cpr.git_cmd = 1;
 		cpr.dir = path;
-		prepare_submodule_repo_env(&cpr.env_array);
+		prepare_submodule_repo_env(&cpr.env);
 
 		strvec_push(&cpr.args, "--super-prefix");
 		strvec_pushf(&cpr.args, "%s/", displaypath);
@@ -1819,7 +1819,7 @@ static int clone_submodule(struct module_clone_data *clone_data)
 		strvec_push(&cp.args, clone_data->path);
 
 		cp.git_cmd = 1;
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.no_stdin = 1;
 
 		if(run_command(&cp))
@@ -2294,7 +2294,7 @@ static int is_tip_reachable(const char *path, struct object_id *oid)
 	cp.no_stderr = 1;
 	strvec_pushl(&cp.args, "rev-list", "-n", "1", hex, "--not", "--all", NULL);
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	if (capture_command(&cp, &rev, GIT_MAX_HEXSZ + 1) || rev.len)
 		return 0;
@@ -2306,7 +2306,7 @@ static int fetch_in_submodule(const char *module_path, int depth, int quiet, str
 {
 	struct child_process cp = CHILD_PROCESS_INIT;
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	cp.git_cmd = 1;
 	cp.dir = xstrdup(module_path);
 
@@ -2363,7 +2363,7 @@ static int run_update_command(struct update_data *ud, int subforce)
 	strvec_push(&cp.args, oid);
 
 	cp.dir = xstrdup(ud->sm_path);
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	if (run_command(&cp)) {
 		switch (ud->update_strategy.type) {
 		case SM_UPDATE_CHECKOUT:
@@ -2629,7 +2629,7 @@ static int update_submodule(struct update_data *update_data)
 
 		cp.dir = update_data->sm_path;
 		cp.git_cmd = 1;
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		update_data_to_args(&next, &cp.args);
 
 		/* die() if child process die()'d */
@@ -3122,9 +3122,9 @@ static void append_fetch_remotes(struct strbuf *msg, const char *git_dir_path)
 	struct strbuf sb_remote_out = STRBUF_INIT;
 
 	cp_remote.git_cmd = 1;
-	strvec_pushf(&cp_remote.env_array,
+	strvec_pushf(&cp_remote.env,
 		     "GIT_DIR=%s", git_dir_path);
-	strvec_push(&cp_remote.env_array, "GIT_WORK_TREE=.");
+	strvec_push(&cp_remote.env, "GIT_WORK_TREE=.");
 	strvec_pushl(&cp_remote.args, "remote", "-v", NULL);
 	if (!capture_command(&cp_remote, &sb_remote_out, 0)) {
 		char *next_line;
@@ -3208,7 +3208,7 @@ static int add_submodule(const struct add_data *add_data)
 		if (clone_submodule(&clone_data))
 			return -1;
 
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.git_cmd = 1;
 		cp.dir = add_data->sm_path;
 		/*
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 8b32cd16515..cd62eef240e 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -301,7 +301,7 @@ static int checkout_worktree(const struct add_opts *opts,
 	strvec_pushl(&cp.args, "reset", "--hard", "--no-recurse-submodules", NULL);
 	if (opts->quiet)
 		strvec_push(&cp.args, "--quiet");
-	strvec_pushv(&cp.env_array, child_env->v);
+	strvec_pushv(&cp.env, child_env->v);
 	return run_command(&cp);
 }
 
@@ -433,7 +433,7 @@ static int add_worktree(const char *path, const char *refname,
 			strvec_push(&cp.args, "--quiet");
 	}
 
-	strvec_pushv(&cp.env_array, child_env.v);
+	strvec_pushv(&cp.env, child_env.v);
 	ret = run_command(&cp);
 	if (ret)
 		goto done;
@@ -989,9 +989,9 @@ static void check_clean_worktree(struct worktree *wt,
 	validate_no_submodules(wt);
 
 	child_process_init(&cp);
-	strvec_pushf(&cp.env_array, "%s=%s/.git",
+	strvec_pushf(&cp.env, "%s=%s/.git",
 		     GIT_DIR_ENVIRONMENT, wt->path);
-	strvec_pushf(&cp.env_array, "%s=%s",
+	strvec_pushf(&cp.env, "%s=%s",
 		     GIT_WORK_TREE_ENVIRONMENT, wt->path);
 	strvec_pushl(&cp.args, "status",
 		     "--porcelain", "--ignore-submodules=none",
diff --git a/connect.c b/connect.c
index afc79a6236e..37b56067358 100644
--- a/connect.c
+++ b/connect.c
@@ -1327,7 +1327,7 @@ static void fill_ssh_args(struct child_process *conn, const char *ssh_host,
 
 		strvec_push(&detect.args, ssh);
 		strvec_push(&detect.args, "-G");
-		push_ssh_options(&detect.args, &detect.env_array,
+		push_ssh_options(&detect.args, &detect.env,
 				 VARIANT_SSH, port, version, flags);
 		strvec_push(&detect.args, ssh_host);
 
@@ -1335,7 +1335,8 @@ static void fill_ssh_args(struct child_process *conn, const char *ssh_host,
 	}
 
 	strvec_push(&conn->args, ssh);
-	push_ssh_options(&conn->args, &conn->env_array, variant, port, version, flags);
+	push_ssh_options(&conn->args, &conn->env, variant, port, version,
+			 flags);
 	strvec_push(&conn->args, ssh_host);
 }
 
@@ -1397,7 +1398,7 @@ struct child_process *git_connect(int fd[2], const char *url,
 
 		/* remove repo-local variables from the environment */
 		for (var = local_repo_env; *var; var++)
-			strvec_push(&conn->env_array, *var);
+			strvec_push(&conn->env, *var);
 
 		conn->use_shell = 1;
 		conn->in = conn->out = -1;
@@ -1429,7 +1430,7 @@ struct child_process *git_connect(int fd[2], const char *url,
 			transport_check_allowed("file");
 			conn->trace2_child_class = "transport/file";
 			if (version > 0) {
-				strvec_pushf(&conn->env_array,
+				strvec_pushf(&conn->env,
 					     GIT_PROTOCOL_ENVIRONMENT "=version=%d",
 					     version);
 			}
diff --git a/connected.c b/connected.c
index ed3025e7a2a..74a20cb32e7 100644
--- a/connected.c
+++ b/connected.c
@@ -110,7 +110,7 @@ int check_connected(oid_iterate_fn fn, void *cb_data,
 
 	rev_list.git_cmd = 1;
 	if (opt->env)
-		strvec_pushv(&rev_list.env_array, opt->env);
+		strvec_pushv(&rev_list.env, opt->env);
 	rev_list.in = -1;
 	rev_list.no_stdout = 1;
 	if (opt->err_fd)
diff --git a/contrib/coccinelle/run_command.pending.cocci b/contrib/coccinelle/run_command.cocci
similarity index 100%
rename from contrib/coccinelle/run_command.pending.cocci
rename to contrib/coccinelle/run_command.cocci
diff --git a/daemon.c b/daemon.c
index 94a5b8a3645..a1d211debe1 100644
--- a/daemon.c
+++ b/daemon.c
@@ -484,7 +484,7 @@ static int upload_pack(const struct strvec *env)
 	strvec_pushl(&cld.args, "upload-pack", "--strict", NULL);
 	strvec_pushf(&cld.args, "--timeout=%u", timeout);
 
-	strvec_pushv(&cld.env_array, env->v);
+	strvec_pushv(&cld.env, env->v);
 
 	return run_service_command(&cld);
 }
@@ -494,7 +494,7 @@ static int upload_archive(const struct strvec *env)
 	struct child_process cld = CHILD_PROCESS_INIT;
 	strvec_push(&cld.args, "upload-archive");
 
-	strvec_pushv(&cld.env_array, env->v);
+	strvec_pushv(&cld.env, env->v);
 
 	return run_service_command(&cld);
 }
@@ -504,7 +504,7 @@ static int receive_pack(const struct strvec *env)
 	struct child_process cld = CHILD_PROCESS_INIT;
 	strvec_push(&cld.args, "receive-pack");
 
-	strvec_pushv(&cld.env_array, env->v);
+	strvec_pushv(&cld.env, env->v);
 
 	return run_service_command(&cld);
 }
@@ -904,16 +904,16 @@ static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)
 		char buf[128] = "";
 		struct sockaddr_in *sin_addr = (void *) addr;
 		inet_ntop(addr->sa_family, &sin_addr->sin_addr, buf, sizeof(buf));
-		strvec_pushf(&cld.env_array, "REMOTE_ADDR=%s", buf);
-		strvec_pushf(&cld.env_array, "REMOTE_PORT=%d",
+		strvec_pushf(&cld.env, "REMOTE_ADDR=%s", buf);
+		strvec_pushf(&cld.env, "REMOTE_PORT=%d",
 			     ntohs(sin_addr->sin_port));
 #ifndef NO_IPV6
 	} else if (addr->sa_family == AF_INET6) {
 		char buf[128] = "";
 		struct sockaddr_in6 *sin6_addr = (void *) addr;
 		inet_ntop(AF_INET6, &sin6_addr->sin6_addr, buf, sizeof(buf));
-		strvec_pushf(&cld.env_array, "REMOTE_ADDR=[%s]", buf);
-		strvec_pushf(&cld.env_array, "REMOTE_PORT=%d",
+		strvec_pushf(&cld.env, "REMOTE_ADDR=[%s]", buf);
+		strvec_pushf(&cld.env, "REMOTE_PORT=%d",
 			     ntohs(sin6_addr->sin6_port));
 #endif
 	}
diff --git a/editor.c b/editor.c
index 8b9648281d7..008c04fe2f6 100644
--- a/editor.c
+++ b/editor.c
@@ -80,7 +80,7 @@ static int launch_specified_editor(const char *editor, const char *path,
 
 		strvec_pushl(&p.args, editor, realpath.buf, NULL);
 		if (env)
-			strvec_pushv(&p.env_array, (const char **)env);
+			strvec_pushv(&p.env, (const char **)env);
 		p.use_shell = 1;
 		p.trace2_child_class = "editor";
 		if (start_command(&p) < 0) {
diff --git a/hook.c b/hook.c
index 1d51be3b77a..2b47bdf5ef0 100644
--- a/hook.c
+++ b/hook.c
@@ -54,7 +54,7 @@ static int pick_next_hook(struct child_process *cp,
 		return 0;
 
 	cp->no_stdin = 1;
-	strvec_pushv(&cp->env_array, hook_cb->options->env.v);
+	strvec_pushv(&cp->env, hook_cb->options->env.v);
 	cp->stdout_to_stderr = 1;
 	cp->trace2_hook_name = hook_cb->hook_name;
 	cp->dir = hook_cb->options->dir;
diff --git a/http-backend.c b/http-backend.c
index 81a7229ece0..58b83a9f66b 100644
--- a/http-backend.c
+++ b/http-backend.c
@@ -476,9 +476,9 @@ static void run_service(const char **argv, int buffer_input)
 		host = "(none)";
 
 	if (!getenv("GIT_COMMITTER_NAME"))
-		strvec_pushf(&cld.env_array, "GIT_COMMITTER_NAME=%s", user);
+		strvec_pushf(&cld.env, "GIT_COMMITTER_NAME=%s", user);
 	if (!getenv("GIT_COMMITTER_EMAIL"))
-		strvec_pushf(&cld.env_array,
+		strvec_pushf(&cld.env,
 			     "GIT_COMMITTER_EMAIL=%s@http.%s", user, host);
 
 	strvec_pushv(&cld.args, argv);
diff --git a/object-file.c b/object-file.c
index 5ffbf3d4fd4..2946c4d3ede 100644
--- a/object-file.c
+++ b/object-file.c
@@ -838,7 +838,7 @@ static void fill_alternate_refs_command(struct child_process *cmd,
 		}
 	}
 
-	strvec_pushv(&cmd->env_array, (const char **)local_repo_env);
+	strvec_pushv(&cmd->env, (const char **)local_repo_env);
 	cmd->out = -1;
 }
 
diff --git a/pager.c b/pager.c
index 27877f8ebbc..5cfe23b025c 100644
--- a/pager.c
+++ b/pager.c
@@ -99,7 +99,7 @@ void prepare_pager_args(struct child_process *pager_process, const char *pager)
 {
 	strvec_push(&pager_process->args, pager);
 	pager_process->use_shell = 1;
-	setup_pager_env(&pager_process->env_array);
+	setup_pager_env(&pager_process->env);
 	pager_process->trace2_child_class = "pager";
 }
 
@@ -129,7 +129,7 @@ void setup_pager(void)
 	/* spawn the pager */
 	prepare_pager_args(&pager_process, pager);
 	pager_process.in = -1;
-	strvec_push(&pager_process.env_array, "GIT_PAGER_IN_USE");
+	strvec_push(&pager_process.env, "GIT_PAGER_IN_USE");
 	if (start_command(&pager_process))
 		return;
 
diff --git a/promisor-remote.c b/promisor-remote.c
index db2ebdc66ef..17d827e053b 100644
--- a/promisor-remote.c
+++ b/promisor-remote.c
@@ -22,7 +22,7 @@ static int fetch_objects(struct repository *repo,
 	child.git_cmd = 1;
 	child.in = -1;
 	if (repo != the_repository)
-		prepare_other_repo_env(&child.env_array, repo->gitdir);
+		prepare_other_repo_env(&child.env, repo->gitdir);
 	strvec_pushl(&child.args, "-c", "fetch.negotiationAlgorithm=noop",
 		     "fetch", remote_name, "--no-tags",
 		     "--no-write-fetch-head", "--recurse-submodules=no",
diff --git a/run-command.c b/run-command.c
index a8501e38ceb..5f7ea713f06 100644
--- a/run-command.c
+++ b/run-command.c
@@ -20,7 +20,7 @@ void child_process_init(struct child_process *child)
 void child_process_clear(struct child_process *child)
 {
 	strvec_clear(&child->args);
-	strvec_clear(&child->env_array);
+	strvec_clear(&child->env);
 }
 
 struct child_to_clean {
@@ -646,7 +646,7 @@ static void trace_run_command(const struct child_process *cp)
 		sq_quote_buf_pretty(&buf, cp->dir);
 		strbuf_addch(&buf, ';');
 	}
-	trace_add_env(&buf, cp->env_array.v);
+	trace_add_env(&buf, cp->env.v);
 	if (cp->git_cmd)
 		strbuf_addstr(&buf, " git");
 	sq_quote_argv_pretty(&buf, cp->args.v);
@@ -751,7 +751,7 @@ int start_command(struct child_process *cmd)
 		set_cloexec(null_fd);
 	}
 
-	childenv = prep_childenv(cmd->env_array.v);
+	childenv = prep_childenv(cmd->env.v);
 	atfork_prepare(&as);
 
 	/*
@@ -914,8 +914,9 @@ int start_command(struct child_process *cmd)
 	else if (cmd->use_shell)
 		cmd->args.v = prepare_shell_cmd(&nargv, sargv);
 
-	cmd->pid = mingw_spawnvpe(cmd->args.v[0], cmd->args.v, (char**) cmd->env_array.v,
-			cmd->dir, fhin, fhout, fherr);
+	cmd->pid = mingw_spawnvpe(cmd->args.v[0], cmd->args.v,
+				  (char**) cmd->env.v,
+				  cmd->dir, fhin, fhout, fherr);
 	failed_errno = errno;
 	if (cmd->pid < 0 && (!cmd->silent_exec_failure || errno != ENOENT))
 		error_errno("cannot spawn %s", cmd->args.v[0]);
@@ -1031,7 +1032,7 @@ int run_command_v_opt_cd_env_tr2(const char **argv, int opt, const char *dir,
 	cmd.close_object_store = opt & RUN_CLOSE_OBJECT_STORE ? 1 : 0;
 	cmd.dir = dir;
 	if (env)
-		strvec_pushv(&cmd.env_array, (const char **)env);
+		strvec_pushv(&cmd.env, (const char **)env);
 	cmd.trace2_child_class = tr2_class;
 	return run_command(&cmd);
 }
diff --git a/run-command.h b/run-command.h
index 5bd0c933e80..d52ebc42b97 100644
--- a/run-command.h
+++ b/run-command.h
@@ -73,7 +73,7 @@ struct child_process {
 	 * The memory in .env_array will be cleaned up automatically during
 	 * `finish_command` (or during `start_command` when it is unsuccessful).
 	 */
-	struct strvec env_array;
+	struct strvec env;
 	pid_t pid;
 
 	int trace2_child_id;
@@ -146,7 +146,7 @@ struct child_process {
 
 #define CHILD_PROCESS_INIT { \
 	.args = STRVEC_INIT, \
-	.env_array = STRVEC_INIT, \
+	.env = STRVEC_INIT, \
 }
 
 /**
diff --git a/sequencer.c b/sequencer.c
index 8c3ed3532ac..701e420cddd 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1000,7 +1000,7 @@ static int run_git_commit(const char *defmsg,
 	if (is_rebase_i(opts) &&
 	    ((opts->committer_date_is_author_date && !opts->ignore_date) ||
 	     !(!defmsg && (flags & AMEND_MSG))) &&
-	    read_env_script(&cmd.env_array)) {
+	    read_env_script(&cmd.env)) {
 		const char *gpg_opt = gpg_sign_opt_quoted(opts);
 
 		return error(_(staged_changes_advice),
@@ -1008,12 +1008,12 @@ static int run_git_commit(const char *defmsg,
 	}
 
 	if (opts->committer_date_is_author_date)
-		strvec_pushf(&cmd.env_array, "GIT_COMMITTER_DATE=%s",
+		strvec_pushf(&cmd.env, "GIT_COMMITTER_DATE=%s",
 			     opts->ignore_date ?
 			     "" :
-			     author_date_from_env_array(&cmd.env_array));
+			     author_date_from_env_array(&cmd.env));
 	if (opts->ignore_date)
-		strvec_push(&cmd.env_array, "GIT_AUTHOR_DATE=");
+		strvec_push(&cmd.env, "GIT_AUTHOR_DATE=");
 
 	strvec_push(&cmd.args, "commit");
 
@@ -3911,7 +3911,7 @@ static int do_merge(struct repository *r,
 		/* Octopus merge */
 		struct child_process cmd = CHILD_PROCESS_INIT;
 
-		if (read_env_script(&cmd.env_array)) {
+		if (read_env_script(&cmd.env)) {
 			const char *gpg_opt = gpg_sign_opt_quoted(opts);
 
 			ret = error(_(staged_changes_advice), gpg_opt, gpg_opt);
@@ -3919,12 +3919,12 @@ static int do_merge(struct repository *r,
 		}
 
 		if (opts->committer_date_is_author_date)
-			strvec_pushf(&cmd.env_array, "GIT_COMMITTER_DATE=%s",
+			strvec_pushf(&cmd.env, "GIT_COMMITTER_DATE=%s",
 				     opts->ignore_date ?
 				     "" :
-				     author_date_from_env_array(&cmd.env_array));
+				     author_date_from_env_array(&cmd.env));
 		if (opts->ignore_date)
-			strvec_push(&cmd.env_array, "GIT_AUTHOR_DATE=");
+			strvec_push(&cmd.env, "GIT_AUTHOR_DATE=");
 
 		cmd.git_cmd = 1;
 		strvec_push(&cmd.args, "merge");
diff --git a/submodule.c b/submodule.c
index 86c8f0f89db..1229660f02c 100644
--- a/submodule.c
+++ b/submodule.c
@@ -711,15 +711,15 @@ void show_submodule_inline_diff(struct diff_options *o, const char *path,
 	if (!(dirty_submodule & DIRTY_SUBMODULE_MODIFIED))
 		strvec_push(&cp.args, oid_to_hex(new_oid));
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	if (!is_directory(path)) {
 		/* fall back to absorbed git dir, if any */
 		if (!sub)
 			goto done;
 		cp.dir = sub->gitdir;
-		strvec_push(&cp.env_array, GIT_DIR_ENVIRONMENT "=.");
-		strvec_push(&cp.env_array, GIT_WORK_TREE_ENVIRONMENT "=.");
+		strvec_push(&cp.env, GIT_DIR_ENVIRONMENT "=.");
+		strvec_push(&cp.env, GIT_WORK_TREE_ENVIRONMENT "=.");
 	}
 
 	if (start_command(&cp)) {
@@ -1019,7 +1019,7 @@ static int submodule_has_commits(struct repository *r,
 		oid_array_for_each_unique(commits, append_oid_to_argv, &cp.args);
 		strvec_pushl(&cp.args, "--not", "--all", NULL);
 
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.git_cmd = 1;
 		cp.no_stdin = 1;
 		cp.dir = path;
@@ -1060,7 +1060,7 @@ static int submodule_needs_pushing(struct repository *r,
 		oid_array_for_each_unique(commits, append_oid_to_argv, &cp.args);
 		strvec_pushl(&cp.args, "--not", "--remotes", "-n", "1" , NULL);
 
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.git_cmd = 1;
 		cp.no_stdin = 1;
 		cp.out = -1;
@@ -1146,7 +1146,7 @@ static int push_submodule(const char *path,
 				strvec_push(&cp.args, rs->raw[i]);
 		}
 
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.git_cmd = 1;
 		cp.no_stdin = 1;
 		cp.dir = path;
@@ -1177,7 +1177,7 @@ static void submodule_push_check(const char *path, const char *head,
 	for (i = 0; i < rs->raw_nr; i++)
 		strvec_push(&cp.args, rs->raw[i]);
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
 	cp.no_stdout = 1;
@@ -1678,7 +1678,7 @@ static int get_next_submodule(struct child_process *cp, struct strbuf *err,
 
 		child_process_init(cp);
 		cp->dir = task->repo->gitdir;
-		prepare_submodule_repo_env_in_gitdir(&cp->env_array);
+		prepare_submodule_repo_env_in_gitdir(&cp->env);
 		cp->git_cmd = 1;
 		strvec_init(&cp->args);
 		if (task->git_args.nr)
@@ -1708,7 +1708,7 @@ static int get_next_submodule(struct child_process *cp, struct strbuf *err,
 			    spf->prefix, task->sub->path);
 
 		child_process_init(cp);
-		prepare_submodule_repo_env_in_gitdir(&cp->env_array);
+		prepare_submodule_repo_env_in_gitdir(&cp->env);
 		cp->git_cmd = 1;
 		cp->dir = task->repo->gitdir;
 
@@ -1882,7 +1882,7 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked)
 	if (ignore_untracked)
 		strvec_push(&cp.args, "-uno");
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
 	cp.out = -1;
@@ -1954,7 +1954,7 @@ int submodule_uses_gitfile(const char *path)
 		     "submodule", "foreach", "--quiet",	"--recursive",
 		     "test -f .git", NULL);
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
 	cp.no_stderr = 1;
@@ -1997,7 +1997,7 @@ int bad_to_remove_submodule(const char *path, unsigned flags)
 	if (!(flags & SUBMODULE_REMOVAL_IGNORE_IGNORED_UNTRACKED))
 		strvec_push(&cp.args, "--ignored");
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
 	cp.out = -1;
@@ -2052,7 +2052,7 @@ static int submodule_has_dirty_index(const struct submodule *sub)
 {
 	struct child_process cp = CHILD_PROCESS_INIT;
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	cp.git_cmd = 1;
 	strvec_pushl(&cp.args, "diff-index", "--quiet",
@@ -2069,7 +2069,7 @@ static int submodule_has_dirty_index(const struct submodule *sub)
 static void submodule_reset_index(const char *path)
 {
 	struct child_process cp = CHILD_PROCESS_INIT;
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
@@ -2153,7 +2153,7 @@ int submodule_move_head(const char *path,
 		}
 	}
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
@@ -2191,7 +2191,7 @@ int submodule_move_head(const char *path,
 			cp.no_stdin = 1;
 			cp.dir = path;
 
-			prepare_submodule_repo_env(&cp.env_array);
+			prepare_submodule_repo_env(&cp.env);
 			strvec_pushl(&cp.args, "update-ref", "HEAD",
 				     "--no-deref", new_head, NULL);
 
@@ -2374,7 +2374,7 @@ void absorb_git_dir_into_superproject(const char *path,
 		strvec_pushl(&cp.args, "--super-prefix", sb.buf,
 			     "submodule--helper",
 			     "absorb-git-dirs", NULL);
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		if (run_command(&cp))
 			die(_("could not recurse into submodule '%s'"), path);
 
@@ -2407,8 +2407,8 @@ int get_superproject_working_tree(struct strbuf *buf)
 	subpath = relative_path(cwd, one_up.buf, &sb);
 	strbuf_release(&one_up);
 
-	prepare_submodule_repo_env(&cp.env_array);
-	strvec_pop(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
+	strvec_pop(&cp.env);
 
 	strvec_pushl(&cp.args, "--literal-pathspecs", "-C", "..",
 		     "ls-files", "-z", "--stage", "--full-name", "--",
diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c
index f3b90aa834a..9050e3113c5 100644
--- a/t/helper/test-run-command.c
+++ b/t/helper/test-run-command.c
@@ -390,7 +390,7 @@ int cmd__run_command(int argc, const char **argv)
 	while (!strcmp(argv[1], "env")) {
 		if (!argv[2])
 			die("env specifier without a value");
-		strvec_push(&proc.env_array, argv[2]);
+		strvec_push(&proc.env, argv[2]);
 		argv += 2;
 		argc -= 2;
 	}
diff --git a/trailer.c b/trailer.c
index 1b12f77d945..52fa47aac68 100644
--- a/trailer.c
+++ b/trailer.c
@@ -236,7 +236,7 @@ static char *apply_command(struct conf_info *conf, const char *arg)
 			strbuf_replace(&cmd, TRAILER_ARG_STRING, arg);
 		strvec_push(&cp.args, cmd.buf);
 	}
-	strvec_pushv(&cp.env_array, (const char **)local_repo_env);
+	strvec_pushv(&cp.env, (const char **)local_repo_env);
 	cp.no_stdin = 1;
 	cp.use_shell = 1;
 
diff --git a/transport-helper.c b/transport-helper.c
index b4dbbabb0c2..322c7224782 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -135,7 +135,7 @@ static struct child_process *get_helper(struct transport *transport)
 	helper->silent_exec_failure = 1;
 
 	if (have_git_dir())
-		strvec_pushf(&helper->env_array, "%s=%s",
+		strvec_pushf(&helper->env, "%s=%s",
 			     GIT_DIR_ENVIRONMENT, get_git_dir());
 
 	helper->trace2_child_class = helper->args.v[0]; /* "remote-<name>" */
diff --git a/wt-status.c b/wt-status.c
index d33f9272b72..62fadc0c93d 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -982,7 +982,7 @@ static void wt_longstatus_print_submodule_summary(struct wt_status *s, int uncom
 	struct strbuf summary = STRBUF_INIT;
 	char *summary_content;
 
-	strvec_pushf(&sm_summary.env_array, "GIT_INDEX_FILE=%s", s->index_file);
+	strvec_pushf(&sm_summary.env, "GIT_INDEX_FILE=%s", s->index_file);
 
 	strvec_push(&sm_summary.args, "submodule");
 	strvec_push(&sm_summary.args, "summary");
-- 
2.36.1.957.g2c13267e09b


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 3/4] cocci: remove env_array -> env migration
  2022-05-20  7:24       ` [PATCH v2 0/4] " Ævar Arnfjörð Bjarmason
  2022-05-20  7:24         ` [PATCH v2 1/4] cocci: add a rename of "struct child_process"'s " Ævar Arnfjörð Bjarmason
  2022-05-20  7:24         ` [PATCH v2 2/4] run-command API: rename " Ævar Arnfjörð Bjarmason
@ 2022-05-20  7:24         ` Ævar Arnfjörð Bjarmason
  2022-05-20  7:24         ` [PATCH v2 4/4] run-command API users: use "env" not "env_array" in comments & names Ævar Arnfjörð Bjarmason
                           ` (2 subsequent siblings)
  5 siblings, 0 replies; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-05-20  7:24 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Enzo Matsumiya, Eric Sunshine,
	Ævar Arnfjörð Bjarmason

Remove the coccinelle rule renaming "env_array" to "env". In the
preceding commit we carried out this rename based on this rule, anyone
with out-of-tree patches still referring to "env" will now get a
compilation error.

We could keep the rule to help those developers change their code by
running "make coccicheck", but as the solution is obvious in this case
let's not leave this stale rule in place.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 contrib/coccinelle/run_command.cocci | 11 -----------
 1 file changed, 11 deletions(-)
 delete mode 100644 contrib/coccinelle/run_command.cocci

diff --git a/contrib/coccinelle/run_command.cocci b/contrib/coccinelle/run_command.cocci
deleted file mode 100644
index 709fdfcf720..00000000000
--- a/contrib/coccinelle/run_command.cocci
+++ /dev/null
@@ -1,11 +0,0 @@
-@@
-struct child_process E;
-@@
-- E.env_array
-+ E.env
-
-@@
-struct child_process *E;
-@@
-- E->env_array
-+ E->env
-- 
2.36.1.957.g2c13267e09b


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 4/4] run-command API users: use "env" not "env_array" in comments & names
  2022-05-20  7:24       ` [PATCH v2 0/4] " Ævar Arnfjörð Bjarmason
                           ` (2 preceding siblings ...)
  2022-05-20  7:24         ` [PATCH v2 3/4] cocci: remove env_array -> env migration Ævar Arnfjörð Bjarmason
@ 2022-05-20  7:24         ` Ævar Arnfjörð Bjarmason
  2022-05-20 16:27         ` [PATCH v2 0/4] run-command.h: rename "env_array" to "env" Junio C Hamano
  2022-06-02  9:09         ` [PATCH v3 0/2] " Ævar Arnfjörð Bjarmason
  5 siblings, 0 replies; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-05-20  7:24 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Enzo Matsumiya, Eric Sunshine,
	Ævar Arnfjörð Bjarmason

Follow-up on a preceding commit which changed all references to the
"env_array" when referring to the "struct child_process" member. These
changes are all unnecessary for the compiler, but help the code's
human readers.

All the comments that referred to "env_array" have now been updated,
as well as function names and variables that had "env_array" in their
name, they now refer to "env".

In addition the "out" name for the submodule.h prototype was
inconsistent with the function definition's use of "env_array" in
submodule.c. Both of them use "env" now.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/submodule--helper.c |  2 +-
 run-command.c               |  6 +++---
 run-command.h               | 10 +++++-----
 sequencer.c                 |  6 +++---
 submodule.h                 |  4 ++--
 5 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index b855e544bd6..0d37b9dd5bb 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -513,7 +513,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
 		 * on windows. And since environment variables are
 		 * case-insensitive in windows, it interferes with the
 		 * existing PATH variable. Hence, to avoid that, we expose
-		 * path via the args strvec and not via env_array.
+		 * path via the args strvec and not via env.
 		 */
 		sq_quote_buf(&sb, path);
 		strvec_pushf(&cp.args, "path=%s; %s",
diff --git a/run-command.c b/run-command.c
index 5f7ea713f06..789eaa59750 100644
--- a/run-command.c
+++ b/run-command.c
@@ -1816,16 +1816,16 @@ int run_auto_maintenance(int quiet)
 	return run_command(&maint);
 }
 
-void prepare_other_repo_env(struct strvec *env_array, const char *new_git_dir)
+void prepare_other_repo_env(struct strvec *env, const char *new_git_dir)
 {
 	const char * const *var;
 
 	for (var = local_repo_env; *var; var++) {
 		if (strcmp(*var, CONFIG_DATA_ENVIRONMENT) &&
 		    strcmp(*var, CONFIG_COUNT_ENVIRONMENT))
-			strvec_push(env_array, *var);
+			strvec_push(env, *var);
 	}
-	strvec_pushf(env_array, "%s=%s", GIT_DIR_ENVIRONMENT, new_git_dir);
+	strvec_pushf(env, "%s=%s", GIT_DIR_ENVIRONMENT, new_git_dir);
 }
 
 enum start_bg_result start_bg_command(struct child_process *cmd,
diff --git a/run-command.h b/run-command.h
index d52ebc42b97..8a700da0998 100644
--- a/run-command.h
+++ b/run-command.h
@@ -58,7 +58,7 @@ struct child_process {
 	struct strvec args;
 
 	/**
-	 * Like .args the .env_array is a `struct strvec'.
+	 * Like .args the .env is a `struct strvec'.
 	 *
 	 * To modify the environment of the sub-process, specify an array of
 	 * environment settings. Each string in the array manipulates the
@@ -70,7 +70,7 @@ struct child_process {
 	 * - If the string does not contain '=', it names an environment
 	 *   variable that will be removed from the child process's environment.
 	 *
-	 * The memory in .env_array will be cleaned up automatically during
+	 * The memory in .env will be cleaned up automatically during
 	 * `finish_command` (or during `start_command` when it is unsuccessful).
 	 */
 	struct strvec env;
@@ -479,14 +479,14 @@ int run_processes_parallel_tr2(int n, get_next_task_fn, start_failure_fn,
 			       const char *tr2_category, const char *tr2_label);
 
 /**
- * Convenience function which prepares env_array for a command to be run in a
- * new repo. This adds all GIT_* environment variables to env_array with the
+ * Convenience function which prepares env for a command to be run in a
+ * new repo. This adds all GIT_* environment variables to env with the
  * exception of GIT_CONFIG_PARAMETERS and GIT_CONFIG_COUNT (which cause the
  * corresponding environment variables to be unset in the subprocess) and adds
  * an environment variable pointing to new_git_dir. See local_repo_env in
  * cache.h for more information.
  */
-void prepare_other_repo_env(struct strvec *env_array, const char *new_git_dir);
+void prepare_other_repo_env(struct strvec *env, const char *new_git_dir);
 
 /**
  * Possible return values for start_bg_command().
diff --git a/sequencer.c b/sequencer.c
index 701e420cddd..2ef6bf22e87 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -919,7 +919,7 @@ static char *get_author(const char *message)
 	return NULL;
 }
 
-static const char *author_date_from_env_array(const struct strvec *env)
+static const char *author_date_from_env(const struct strvec *env)
 {
 	int i;
 	const char *date;
@@ -1011,7 +1011,7 @@ static int run_git_commit(const char *defmsg,
 		strvec_pushf(&cmd.env, "GIT_COMMITTER_DATE=%s",
 			     opts->ignore_date ?
 			     "" :
-			     author_date_from_env_array(&cmd.env));
+			     author_date_from_env(&cmd.env));
 	if (opts->ignore_date)
 		strvec_push(&cmd.env, "GIT_AUTHOR_DATE=");
 
@@ -3922,7 +3922,7 @@ static int do_merge(struct repository *r,
 			strvec_pushf(&cmd.env, "GIT_COMMITTER_DATE=%s",
 				     opts->ignore_date ?
 				     "" :
-				     author_date_from_env_array(&cmd.env));
+				     author_date_from_env(&cmd.env));
 		if (opts->ignore_date)
 			strvec_push(&cmd.env, "GIT_AUTHOR_DATE=");
 
diff --git a/submodule.h b/submodule.h
index 40c14452377..2ac7a04e726 100644
--- a/submodule.h
+++ b/submodule.h
@@ -158,11 +158,11 @@ int submodule_move_head(const char *path,
 void submodule_unset_core_worktree(const struct submodule *sub);
 
 /*
- * Prepare the "env_array" parameter of a "struct child_process" for executing
+ * Prepare the "env" parameter of a "struct child_process" for executing
  * a submodule by clearing any repo-specific environment variables, but
  * retaining any config in the environment.
  */
-void prepare_submodule_repo_env(struct strvec *out);
+void prepare_submodule_repo_env(struct strvec *env);
 
 #define ABSORB_GITDIR_RECURSE_SUBMODULES (1<<0)
 void absorb_git_dir_into_superproject(const char *path,
-- 
2.36.1.957.g2c13267e09b


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH v2 0/4] run-command.h: rename "env_array" to "env"
  2022-05-20  7:24       ` [PATCH v2 0/4] " Ævar Arnfjörð Bjarmason
                           ` (3 preceding siblings ...)
  2022-05-20  7:24         ` [PATCH v2 4/4] run-command API users: use "env" not "env_array" in comments & names Ævar Arnfjörð Bjarmason
@ 2022-05-20 16:27         ` Junio C Hamano
  2022-05-21 11:09           ` Ævar Arnfjörð Bjarmason
  2022-06-02  9:09         ` [PATCH v3 0/2] " Ævar Arnfjörð Bjarmason
  5 siblings, 1 reply; 26+ messages in thread
From: Junio C Hamano @ 2022-05-20 16:27 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Jeff King, Enzo Matsumiya, Eric Sunshine

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> Follow-up 32ec72c3e1 (Merge branch 'ab/run-command', 2021-12-15) and
> rename the "env_array" member to simply "env" in the "struct
> child_process".
>
> Changes since v1:
>
>  * Added a commit to remove the coccinelle rule after its application,
>    as suggested by Junio in
>    https://lore.kernel.org/git/xmqqzgjdkxon.fsf@gitster.g/

I actually think we do not even have to tentatively add one, only to
remove it at the end.

Wouldn't a two-patch series whose 

 - first patch does the real damage to the codebase, with the
   coccinelle rule as part of the commit explanation in the proposed
   log message (e.g. "the patch was mechanically prepared with the
   help with this Coccinelle semantic patch"), and

 - the second patch does the non-mechanical "comments and names"

work better than four patch series?  A single patch that says "the
code was mechanically updated with this s-patch, with names and
comments that refer to env_array in the surrounding code manually
adjusted" would also work well.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v2 0/4] run-command.h: rename "env_array" to "env"
  2022-05-20 16:27         ` [PATCH v2 0/4] run-command.h: rename "env_array" to "env" Junio C Hamano
@ 2022-05-21 11:09           ` Ævar Arnfjörð Bjarmason
  0 siblings, 0 replies; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-05-21 11:09 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Jeff King, Enzo Matsumiya, Eric Sunshine


On Fri, May 20 2022, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> Follow-up 32ec72c3e1 (Merge branch 'ab/run-command', 2021-12-15) and
>> rename the "env_array" member to simply "env" in the "struct
>> child_process".
>>
>> Changes since v1:
>>
>>  * Added a commit to remove the coccinelle rule after its application,
>>    as suggested by Junio in
>>    https://lore.kernel.org/git/xmqqzgjdkxon.fsf@gitster.g/
>
> I actually think we do not even have to tentatively add one, only to
> remove it at the end.
>
> Wouldn't a two-patch series whose 
>
>  - first patch does the real damage to the codebase, with the
>    coccinelle rule as part of the commit explanation in the proposed
>    log message (e.g. "the patch was mechanically prepared with the
>    help with this Coccinelle semantic patch"), and
>
>  - the second patch does the non-mechanical "comments and names"
>
> work better than four patch series?  A single patch that says "the
> code was mechanically updated with this s-patch, with names and
> comments that refer to env_array in the surrounding code manually
> adjusted" would also work well.

I can re-roll it if you insist, but I think it's much more useful to
have rules added to contrib/coccinelle, even if they're subsequently
removed within the same series.

I've ofter paged through "git log -p -- contrib/coccinelle" to get
inspiration from previous rules we used or see what's valid syntax. I
think being able to do that consistently and not having to fish through
log messages as well is more useful.

It also makes it easier for someone who needs to modify their code to
just "git checkout" and run "spatch" on the rule, without copy/pasting
from a log message.

But anyway, whatever you prefer. I see from the latest WC you're
expecting a re-roll, maybe the above will convince you, and if not I can
prepare a v3 with your suggested changes. Thanks.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH v3 0/2] run-command.h: rename "env_array" to "env"
  2022-05-20  7:24       ` [PATCH v2 0/4] " Ævar Arnfjörð Bjarmason
                           ` (4 preceding siblings ...)
  2022-05-20 16:27         ` [PATCH v2 0/4] run-command.h: rename "env_array" to "env" Junio C Hamano
@ 2022-06-02  9:09         ` Ævar Arnfjörð Bjarmason
  2022-06-02  9:09           ` [PATCH v3 1/2] run-command API: " Ævar Arnfjörð Bjarmason
  2022-06-02  9:09           ` [PATCH v3 2/2] run-command API users: use "env" not "env_array" in comments & names Ævar Arnfjörð Bjarmason
  5 siblings, 2 replies; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-06-02  9:09 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Enzo Matsumiya, Eric Sunshine,
	Ævar Arnfjörð Bjarmason

Follow-up 32ec72c3e1 (Merge branch 'ab/run-command', 2021-12-15) and
rename the "env_array" member to simply "env" in the "struct
child_process".

Changes since v2[1]:

 * Rebased on "master" (there was one small conflict).
 * Squashed the first 3 commits into one. Now the coccinelle rule is
   mentionid in the 1/2 commit message, instead of adding & removing
   it before/after the change itself.

1. https://lore.kernel.org/git/cover-v2-0.4-00000000000-20220520T072122Z-avarab@gmail.com/

Ævar Arnfjörð Bjarmason (2):
  run-command API: rename "env_array" to "env"
  run-command API users: use "env" not "env_array" in comments & names

 add-patch.c                 |  2 +-
 branch.c                    |  2 +-
 builtin/difftool.c          |  6 ++---
 builtin/receive-pack.c      | 32 +++++++++++++--------------
 builtin/stash.c             | 16 +++++++-------
 builtin/submodule--helper.c | 44 ++++++++++++++++++-------------------
 builtin/worktree.c          |  8 +++----
 connect.c                   |  9 ++++----
 connected.c                 |  2 +-
 daemon.c                    | 14 ++++++------
 editor.c                    |  2 +-
 hook.c                      |  2 +-
 http-backend.c              |  4 ++--
 object-file.c               |  2 +-
 pager.c                     |  4 ++--
 promisor-remote.c           |  2 +-
 run-command.c               | 19 ++++++++--------
 run-command.h               | 14 ++++++------
 sequencer.c                 | 18 +++++++--------
 submodule.c                 | 38 ++++++++++++++++----------------
 submodule.h                 |  4 ++--
 t/helper/test-run-command.c |  2 +-
 trailer.c                   |  2 +-
 transport-helper.c          |  2 +-
 wt-status.c                 |  2 +-
 25 files changed, 127 insertions(+), 125 deletions(-)

Range-diff against v2:
1:  e3f33fce566 < -:  ----------- cocci: add a rename of "struct child_process"'s "env_array" to "env"
2:  5aeb6ec9117 ! 1:  80ef05d5b0a run-command API: rename "env_array" to "env"
    @@ Metadata
      ## Commit message ##
         run-command API: rename "env_array" to "env"
     
    -    As noted in the preceding commit it would be nice to not deal with the
    -    oddity of having an "_array" suffix for the "env" strvec, but not for
    -    its "args" sibling.
    +    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".
     
    -    We can do that with coccinelle in a way that's easy to review. The
    -    only manual changes in this commit are:
    +    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.
     
    -     * git mv contrib/coccinelle/run_command{.pending,}.cocci
    -     * The change in run-command.h to rename the struct member itself, and
    -       to change its initializer.
    +    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 the result of a subsequent:
    +    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.
     
    @@ builtin/receive-pack.c: static const char *push_to_deploy(unsigned char *sha1,
      	child.no_stdin = 1;
      	child.no_stdout = 1;
     @@ builtin/receive-pack.c: static const char *unpack(int err_fd, struct shallow_info *si)
    + 			close(err_fd);
      		return "unable to create temporary object directory";
      	}
    - 	if (tmp_objdir)
    --		strvec_pushv(&child.env_array, tmp_objdir_env(tmp_objdir));
    -+		strvec_pushv(&child.env, tmp_objdir_env(tmp_objdir));
    +-	strvec_pushv(&child.env_array, tmp_objdir_env(tmp_objdir));
    ++	strvec_pushv(&child.env, tmp_objdir_env(tmp_objdir));
      
      	/*
      	 * Normally we just pass the tmp_objdir environment to the child
    @@ connected.c: int check_connected(oid_iterate_fn fn, void *cb_data,
      	rev_list.no_stdout = 1;
      	if (opt->err_fd)
     
    - ## contrib/coccinelle/run_command.pending.cocci => contrib/coccinelle/run_command.cocci ##
    -
      ## daemon.c ##
     @@ daemon.c: static int upload_pack(const struct strvec *env)
      	strvec_pushl(&cld.args, "upload-pack", "--strict", NULL);
3:  ca09da570ef < -:  ----------- cocci: remove env_array -> env migration
4:  5419f839c74 = 2:  4039fec4f29 run-command API users: use "env" not "env_array" in comments & names
-- 
2.36.1.1103.gb3ecdfb3e6a


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH v3 1/2] run-command API: rename "env_array" to "env"
  2022-06-02  9:09         ` [PATCH v3 0/2] " Ævar Arnfjörð Bjarmason
@ 2022-06-02  9:09           ` Ævar Arnfjörð Bjarmason
  2022-06-03  0:37             ` Junio C Hamano
  2022-06-02  9:09           ` [PATCH v3 2/2] run-command API users: use "env" not "env_array" in comments & names Ævar Arnfjörð Bjarmason
  1 sibling, 1 reply; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-06-02  9:09 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Enzo Matsumiya, Eric Sunshine,
	Ævar Arnfjörð Bjarmason

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>
---
 add-patch.c                 |  2 +-
 branch.c                    |  2 +-
 builtin/difftool.c          |  6 +++---
 builtin/receive-pack.c      | 32 ++++++++++++++--------------
 builtin/stash.c             | 16 +++++++-------
 builtin/submodule--helper.c | 42 ++++++++++++++++++-------------------
 builtin/worktree.c          |  8 +++----
 connect.c                   |  9 ++++----
 connected.c                 |  2 +-
 daemon.c                    | 14 ++++++-------
 editor.c                    |  2 +-
 hook.c                      |  2 +-
 http-backend.c              |  4 ++--
 object-file.c               |  2 +-
 pager.c                     |  4 ++--
 promisor-remote.c           |  2 +-
 run-command.c               | 13 ++++++------
 run-command.h               |  4 ++--
 sequencer.c                 | 16 +++++++-------
 submodule.c                 | 38 ++++++++++++++++-----------------
 t/helper/test-run-command.c |  2 +-
 trailer.c                   |  2 +-
 transport-helper.c          |  2 +-
 wt-status.c                 |  2 +-
 24 files changed, 115 insertions(+), 113 deletions(-)

diff --git a/add-patch.c b/add-patch.c
index 55d719f7845..509ca04456b 100644
--- a/add-patch.c
+++ b/add-patch.c
@@ -305,7 +305,7 @@ static void setup_child_process(struct add_p_state *s,
 	va_end(ap);
 
 	cp->git_cmd = 1;
-	strvec_pushf(&cp->env_array,
+	strvec_pushf(&cp->env,
 		     INDEX_ENVIRONMENT "=%s", s->s.r->index_file);
 }
 
diff --git a/branch.c b/branch.c
index 2d6569b0c62..4c8523c66ad 100644
--- a/branch.c
+++ b/branch.c
@@ -587,7 +587,7 @@ static int submodule_create_branch(struct repository *r,
 	child.err = -1;
 	child.stdout_to_stderr = 1;
 
-	prepare_other_repo_env(&child.env_array, r->gitdir);
+	prepare_other_repo_env(&child.env, r->gitdir);
 	/*
 	 * submodule_create_branch() is indirectly invoked by "git
 	 * branch", but we cannot invoke "git branch" in the child
diff --git a/builtin/difftool.c b/builtin/difftool.c
index faa3507369a..b3c509b8de3 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -217,7 +217,7 @@ static void changed_files(struct hashmap *result, const char *index_path,
 	update_index.use_shell = 0;
 	update_index.clean_on_exit = 1;
 	update_index.dir = workdir;
-	strvec_pushf(&update_index.env_array, "GIT_INDEX_FILE=%s", index_path);
+	strvec_pushf(&update_index.env, "GIT_INDEX_FILE=%s", index_path);
 	/* Ignore any errors of update-index */
 	run_command(&update_index);
 
@@ -230,7 +230,7 @@ static void changed_files(struct hashmap *result, const char *index_path,
 	diff_files.clean_on_exit = 1;
 	diff_files.out = -1;
 	diff_files.dir = workdir;
-	strvec_pushf(&diff_files.env_array, "GIT_INDEX_FILE=%s", index_path);
+	strvec_pushf(&diff_files.env, "GIT_INDEX_FILE=%s", index_path);
 	if (start_command(&diff_files))
 		die("could not obtain raw diff");
 	fp = xfdopen(diff_files.out, "r");
@@ -675,7 +675,7 @@ static int run_file_diff(int prompt, const char *prefix,
 
 	child->git_cmd = 1;
 	child->dir = prefix;
-	strvec_pushv(&child->env_array, env);
+	strvec_pushv(&child->env, env);
 
 	return run_command(child);
 }
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index daa153d0446..e6e1d636f9c 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -764,23 +764,23 @@ static void prepare_push_cert_sha1(struct child_process *proc)
 		nonce_status = check_nonce(push_cert.buf, bogs);
 	}
 	if (!is_null_oid(&push_cert_oid)) {
-		strvec_pushf(&proc->env_array, "GIT_PUSH_CERT=%s",
+		strvec_pushf(&proc->env, "GIT_PUSH_CERT=%s",
 			     oid_to_hex(&push_cert_oid));
-		strvec_pushf(&proc->env_array, "GIT_PUSH_CERT_SIGNER=%s",
+		strvec_pushf(&proc->env, "GIT_PUSH_CERT_SIGNER=%s",
 			     sigcheck.signer ? sigcheck.signer : "");
-		strvec_pushf(&proc->env_array, "GIT_PUSH_CERT_KEY=%s",
+		strvec_pushf(&proc->env, "GIT_PUSH_CERT_KEY=%s",
 			     sigcheck.key ? sigcheck.key : "");
-		strvec_pushf(&proc->env_array, "GIT_PUSH_CERT_STATUS=%c",
+		strvec_pushf(&proc->env, "GIT_PUSH_CERT_STATUS=%c",
 			     sigcheck.result);
 		if (push_cert_nonce) {
-			strvec_pushf(&proc->env_array,
+			strvec_pushf(&proc->env,
 				     "GIT_PUSH_CERT_NONCE=%s",
 				     push_cert_nonce);
-			strvec_pushf(&proc->env_array,
+			strvec_pushf(&proc->env,
 				     "GIT_PUSH_CERT_NONCE_STATUS=%s",
 				     nonce_status);
 			if (nonce_status == NONCE_SLOP)
-				strvec_pushf(&proc->env_array,
+				strvec_pushf(&proc->env,
 					     "GIT_PUSH_CERT_NONCE_SLOP=%ld",
 					     nonce_stamp_slop);
 		}
@@ -815,17 +815,17 @@ static int run_and_feed_hook(const char *hook_name, feed_fn feed,
 	if (feed_state->push_options) {
 		size_t i;
 		for (i = 0; i < feed_state->push_options->nr; i++)
-			strvec_pushf(&proc.env_array,
+			strvec_pushf(&proc.env,
 				     "GIT_PUSH_OPTION_%"PRIuMAX"=%s",
 				     (uintmax_t)i,
 				     feed_state->push_options->items[i].string);
-		strvec_pushf(&proc.env_array, "GIT_PUSH_OPTION_COUNT=%"PRIuMAX"",
+		strvec_pushf(&proc.env, "GIT_PUSH_OPTION_COUNT=%"PRIuMAX"",
 			     (uintmax_t)feed_state->push_options->nr);
 	} else
-		strvec_pushf(&proc.env_array, "GIT_PUSH_OPTION_COUNT");
+		strvec_pushf(&proc.env, "GIT_PUSH_OPTION_COUNT");
 
 	if (tmp_objdir)
-		strvec_pushv(&proc.env_array, tmp_objdir_env(tmp_objdir));
+		strvec_pushv(&proc.env, tmp_objdir_env(tmp_objdir));
 
 	if (use_sideband) {
 		memset(&muxer, 0, sizeof(muxer));
@@ -1357,7 +1357,7 @@ static const char *push_to_deploy(unsigned char *sha1,
 
 	strvec_pushl(&child.args, "update-index", "-q", "--ignore-submodules",
 		     "--refresh", NULL);
-	strvec_pushv(&child.env_array, env->v);
+	strvec_pushv(&child.env, env->v);
 	child.dir = work_tree;
 	child.no_stdin = 1;
 	child.stdout_to_stderr = 1;
@@ -1369,7 +1369,7 @@ static const char *push_to_deploy(unsigned char *sha1,
 	child_process_init(&child);
 	strvec_pushl(&child.args, "diff-files", "--quiet",
 		     "--ignore-submodules", "--", NULL);
-	strvec_pushv(&child.env_array, env->v);
+	strvec_pushv(&child.env, env->v);
 	child.dir = work_tree;
 	child.no_stdin = 1;
 	child.stdout_to_stderr = 1;
@@ -1383,7 +1383,7 @@ static const char *push_to_deploy(unsigned char *sha1,
 		     /* diff-index with either HEAD or an empty tree */
 		     head_has_history() ? "HEAD" : empty_tree_oid_hex(),
 		     "--", NULL);
-	strvec_pushv(&child.env_array, env->v);
+	strvec_pushv(&child.env, env->v);
 	child.no_stdin = 1;
 	child.no_stdout = 1;
 	child.stdout_to_stderr = 0;
@@ -1394,7 +1394,7 @@ static const char *push_to_deploy(unsigned char *sha1,
 	child_process_init(&child);
 	strvec_pushl(&child.args, "read-tree", "-u", "-m", hash_to_hex(sha1),
 		     NULL);
-	strvec_pushv(&child.env_array, env->v);
+	strvec_pushv(&child.env, env->v);
 	child.dir = work_tree;
 	child.no_stdin = 1;
 	child.no_stdout = 1;
@@ -2214,7 +2214,7 @@ static const char *unpack(int err_fd, struct shallow_info *si)
 			close(err_fd);
 		return "unable to create temporary object directory";
 	}
-	strvec_pushv(&child.env_array, tmp_objdir_env(tmp_objdir));
+	strvec_pushv(&child.env, tmp_objdir_env(tmp_objdir));
 
 	/*
 	 * Normally we just pass the tmp_objdir environment to the child
diff --git a/builtin/stash.c b/builtin/stash.c
index 3fe549f7d3c..ca8f962e9bc 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -357,7 +357,7 @@ static int restore_untracked(struct object_id *u_tree)
 	cp.git_cmd = 1;
 	strvec_push(&cp.args, "read-tree");
 	strvec_push(&cp.args, oid_to_hex(u_tree));
-	strvec_pushf(&cp.env_array, "GIT_INDEX_FILE=%s",
+	strvec_pushf(&cp.env, "GIT_INDEX_FILE=%s",
 		     stash_index_path.buf);
 	if (run_command(&cp)) {
 		remove_path(stash_index_path.buf);
@@ -367,7 +367,7 @@ static int restore_untracked(struct object_id *u_tree)
 	child_process_init(&cp);
 	cp.git_cmd = 1;
 	strvec_pushl(&cp.args, "checkout-index", "--all", NULL);
-	strvec_pushf(&cp.env_array, "GIT_INDEX_FILE=%s",
+	strvec_pushf(&cp.env, "GIT_INDEX_FILE=%s",
 		     stash_index_path.buf);
 
 	res = run_command(&cp);
@@ -603,9 +603,9 @@ static int do_apply_stash(const char *prefix, struct stash_info *info,
 		 */
 		cp.git_cmd = 1;
 		cp.dir = prefix;
-		strvec_pushf(&cp.env_array, GIT_WORK_TREE_ENVIRONMENT"=%s",
+		strvec_pushf(&cp.env, GIT_WORK_TREE_ENVIRONMENT"=%s",
 			     absolute_path(get_git_work_tree()));
-		strvec_pushf(&cp.env_array, GIT_DIR_ENVIRONMENT"=%s",
+		strvec_pushf(&cp.env, GIT_DIR_ENVIRONMENT"=%s",
 			     absolute_path(get_git_dir()));
 		strvec_push(&cp.args, "status");
 		run_command(&cp);
@@ -1106,7 +1106,7 @@ static int save_untracked_files(struct stash_info *info, struct strbuf *msg,
 	cp_upd_index.git_cmd = 1;
 	strvec_pushl(&cp_upd_index.args, "update-index", "-z", "--add",
 		     "--remove", "--stdin", NULL);
-	strvec_pushf(&cp_upd_index.env_array, "GIT_INDEX_FILE=%s",
+	strvec_pushf(&cp_upd_index.env, "GIT_INDEX_FILE=%s",
 			 stash_index_path.buf);
 
 	strbuf_addf(&untracked_msg, "untracked files on %s\n", msg->buf);
@@ -1180,7 +1180,7 @@ static int stash_patch(struct stash_info *info, const struct pathspec *ps,
 
 	cp_read_tree.git_cmd = 1;
 	strvec_pushl(&cp_read_tree.args, "read-tree", "HEAD", NULL);
-	strvec_pushf(&cp_read_tree.env_array, "GIT_INDEX_FILE=%s",
+	strvec_pushf(&cp_read_tree.env, "GIT_INDEX_FILE=%s",
 		     stash_index_path.buf);
 	if (run_command(&cp_read_tree)) {
 		ret = -1;
@@ -1267,7 +1267,7 @@ static int stash_working_tree(struct stash_info *info, const struct pathspec *ps
 	strvec_pushl(&cp_upd_index.args, "update-index",
 		     "--ignore-skip-worktree-entries",
 		     "-z", "--add", "--remove", "--stdin", NULL);
-	strvec_pushf(&cp_upd_index.env_array, "GIT_INDEX_FILE=%s",
+	strvec_pushf(&cp_upd_index.env, "GIT_INDEX_FILE=%s",
 		     stash_index_path.buf);
 
 	if (pipe_command(&cp_upd_index, diff_output.buf, diff_output.len,
@@ -1543,7 +1543,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q
 			cp.git_cmd = 1;
 			if (startup_info->original_cwd) {
 				cp.dir = startup_info->original_cwd;
-				strvec_pushf(&cp.env_array, "%s=%s",
+				strvec_pushf(&cp.env, "%s=%s",
 					     GIT_WORK_TREE_ENVIRONMENT,
 					     the_repository->worktree);
 			}
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 1a8e5d06214..b855e544bd6 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -292,7 +292,7 @@ static char *compute_rev_name(const char *sub_path, const char* object_id)
 
 	for (d = describe_argv; *d; d++) {
 		struct child_process cp = CHILD_PROCESS_INIT;
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.dir = sub_path;
 		cp.git_cmd = 1;
 		cp.no_stderr = 1;
@@ -479,7 +479,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
 	if (!is_submodule_populated_gently(path, NULL))
 		goto cleanup;
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	/*
 	 * For the purpose of executing <command> in the submodule,
@@ -499,12 +499,12 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
 		char *toplevel = xgetcwd();
 		struct strbuf sb = STRBUF_INIT;
 
-		strvec_pushf(&cp.env_array, "name=%s", sub->name);
-		strvec_pushf(&cp.env_array, "sm_path=%s", path);
-		strvec_pushf(&cp.env_array, "displaypath=%s", displaypath);
-		strvec_pushf(&cp.env_array, "sha1=%s",
+		strvec_pushf(&cp.env, "name=%s", sub->name);
+		strvec_pushf(&cp.env, "sm_path=%s", path);
+		strvec_pushf(&cp.env, "displaypath=%s", displaypath);
+		strvec_pushf(&cp.env, "sha1=%s",
 			     oid_to_hex(ce_oid));
-		strvec_pushf(&cp.env_array, "toplevel=%s", toplevel);
+		strvec_pushf(&cp.env, "toplevel=%s", toplevel);
 
 		/*
 		 * Since the path variable was accessible from the script
@@ -536,7 +536,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
 
 		cpr.git_cmd = 1;
 		cpr.dir = path;
-		prepare_submodule_repo_env(&cpr.env_array);
+		prepare_submodule_repo_env(&cpr.env);
 
 		strvec_pushl(&cpr.args, "--super-prefix", NULL);
 		strvec_pushf(&cpr.args, "%s/", displaypath);
@@ -833,7 +833,7 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,
 
 		cpr.git_cmd = 1;
 		cpr.dir = path;
-		prepare_submodule_repo_env(&cpr.env_array);
+		prepare_submodule_repo_env(&cpr.env);
 
 		strvec_push(&cpr.args, "--super-prefix");
 		strvec_pushf(&cpr.args, "%s/", displaypath);
@@ -955,7 +955,7 @@ static char *verify_submodule_committish(const char *sm_path,
 
 	cp_rev_parse.git_cmd = 1;
 	cp_rev_parse.dir = sm_path;
-	prepare_submodule_repo_env(&cp_rev_parse.env_array);
+	prepare_submodule_repo_env(&cp_rev_parse.env);
 	strvec_pushl(&cp_rev_parse.args, "rev-parse", "-q", "--short", NULL);
 	strvec_pushf(&cp_rev_parse.args, "%s^0", committish);
 	strvec_push(&cp_rev_parse.args, "--");
@@ -996,7 +996,7 @@ static void print_submodule_summary(struct summary_cb *info, char *errmsg,
 
 		cp_log.git_cmd = 1;
 		cp_log.dir = p->sm_path;
-		prepare_submodule_repo_env(&cp_log.env_array);
+		prepare_submodule_repo_env(&cp_log.env);
 		strvec_pushl(&cp_log.args, "log", NULL);
 
 		if (S_ISGITLINK(p->mod_src) && S_ISGITLINK(p->mod_dst)) {
@@ -1113,7 +1113,7 @@ static void generate_submodule_summary(struct summary_cb *info,
 
 		cp_rev_list.git_cmd = 1;
 		cp_rev_list.dir = p->sm_path;
-		prepare_submodule_repo_env(&cp_rev_list.env_array);
+		prepare_submodule_repo_env(&cp_rev_list.env);
 
 		if (!capture_command(&cp_rev_list, &sb_rev_list, 0))
 			total_commits = atoi(sb_rev_list.buf);
@@ -1414,7 +1414,7 @@ static void sync_submodule(const char *path, const char *prefix,
 
 		cpr.git_cmd = 1;
 		cpr.dir = path;
-		prepare_submodule_repo_env(&cpr.env_array);
+		prepare_submodule_repo_env(&cpr.env);
 
 		strvec_push(&cpr.args, "--super-prefix");
 		strvec_pushf(&cpr.args, "%s/", displaypath);
@@ -1819,7 +1819,7 @@ static int clone_submodule(struct module_clone_data *clone_data)
 		strvec_push(&cp.args, clone_data->path);
 
 		cp.git_cmd = 1;
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.no_stdin = 1;
 
 		if(run_command(&cp))
@@ -2294,7 +2294,7 @@ static int is_tip_reachable(const char *path, struct object_id *oid)
 	cp.no_stderr = 1;
 	strvec_pushl(&cp.args, "rev-list", "-n", "1", hex, "--not", "--all", NULL);
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	if (capture_command(&cp, &rev, GIT_MAX_HEXSZ + 1) || rev.len)
 		return 0;
@@ -2306,7 +2306,7 @@ static int fetch_in_submodule(const char *module_path, int depth, int quiet, str
 {
 	struct child_process cp = CHILD_PROCESS_INIT;
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	cp.git_cmd = 1;
 	cp.dir = xstrdup(module_path);
 
@@ -2363,7 +2363,7 @@ static int run_update_command(struct update_data *ud, int subforce)
 	strvec_push(&cp.args, oid);
 
 	cp.dir = xstrdup(ud->sm_path);
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	if (run_command(&cp)) {
 		switch (ud->update_strategy.type) {
 		case SM_UPDATE_CHECKOUT:
@@ -2629,7 +2629,7 @@ static int update_submodule(struct update_data *update_data)
 
 		cp.dir = update_data->sm_path;
 		cp.git_cmd = 1;
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		update_data_to_args(&next, &cp.args);
 
 		/* die() if child process die()'d */
@@ -3122,9 +3122,9 @@ static void append_fetch_remotes(struct strbuf *msg, const char *git_dir_path)
 	struct strbuf sb_remote_out = STRBUF_INIT;
 
 	cp_remote.git_cmd = 1;
-	strvec_pushf(&cp_remote.env_array,
+	strvec_pushf(&cp_remote.env,
 		     "GIT_DIR=%s", git_dir_path);
-	strvec_push(&cp_remote.env_array, "GIT_WORK_TREE=.");
+	strvec_push(&cp_remote.env, "GIT_WORK_TREE=.");
 	strvec_pushl(&cp_remote.args, "remote", "-v", NULL);
 	if (!capture_command(&cp_remote, &sb_remote_out, 0)) {
 		char *next_line;
@@ -3208,7 +3208,7 @@ static int add_submodule(const struct add_data *add_data)
 		if (clone_submodule(&clone_data))
 			return -1;
 
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.git_cmd = 1;
 		cp.dir = add_data->sm_path;
 		/*
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 8b32cd16515..cd62eef240e 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -301,7 +301,7 @@ static int checkout_worktree(const struct add_opts *opts,
 	strvec_pushl(&cp.args, "reset", "--hard", "--no-recurse-submodules", NULL);
 	if (opts->quiet)
 		strvec_push(&cp.args, "--quiet");
-	strvec_pushv(&cp.env_array, child_env->v);
+	strvec_pushv(&cp.env, child_env->v);
 	return run_command(&cp);
 }
 
@@ -433,7 +433,7 @@ static int add_worktree(const char *path, const char *refname,
 			strvec_push(&cp.args, "--quiet");
 	}
 
-	strvec_pushv(&cp.env_array, child_env.v);
+	strvec_pushv(&cp.env, child_env.v);
 	ret = run_command(&cp);
 	if (ret)
 		goto done;
@@ -989,9 +989,9 @@ static void check_clean_worktree(struct worktree *wt,
 	validate_no_submodules(wt);
 
 	child_process_init(&cp);
-	strvec_pushf(&cp.env_array, "%s=%s/.git",
+	strvec_pushf(&cp.env, "%s=%s/.git",
 		     GIT_DIR_ENVIRONMENT, wt->path);
-	strvec_pushf(&cp.env_array, "%s=%s",
+	strvec_pushf(&cp.env, "%s=%s",
 		     GIT_WORK_TREE_ENVIRONMENT, wt->path);
 	strvec_pushl(&cp.args, "status",
 		     "--porcelain", "--ignore-submodules=none",
diff --git a/connect.c b/connect.c
index afc79a6236e..37b56067358 100644
--- a/connect.c
+++ b/connect.c
@@ -1327,7 +1327,7 @@ static void fill_ssh_args(struct child_process *conn, const char *ssh_host,
 
 		strvec_push(&detect.args, ssh);
 		strvec_push(&detect.args, "-G");
-		push_ssh_options(&detect.args, &detect.env_array,
+		push_ssh_options(&detect.args, &detect.env,
 				 VARIANT_SSH, port, version, flags);
 		strvec_push(&detect.args, ssh_host);
 
@@ -1335,7 +1335,8 @@ static void fill_ssh_args(struct child_process *conn, const char *ssh_host,
 	}
 
 	strvec_push(&conn->args, ssh);
-	push_ssh_options(&conn->args, &conn->env_array, variant, port, version, flags);
+	push_ssh_options(&conn->args, &conn->env, variant, port, version,
+			 flags);
 	strvec_push(&conn->args, ssh_host);
 }
 
@@ -1397,7 +1398,7 @@ struct child_process *git_connect(int fd[2], const char *url,
 
 		/* remove repo-local variables from the environment */
 		for (var = local_repo_env; *var; var++)
-			strvec_push(&conn->env_array, *var);
+			strvec_push(&conn->env, *var);
 
 		conn->use_shell = 1;
 		conn->in = conn->out = -1;
@@ -1429,7 +1430,7 @@ struct child_process *git_connect(int fd[2], const char *url,
 			transport_check_allowed("file");
 			conn->trace2_child_class = "transport/file";
 			if (version > 0) {
-				strvec_pushf(&conn->env_array,
+				strvec_pushf(&conn->env,
 					     GIT_PROTOCOL_ENVIRONMENT "=version=%d",
 					     version);
 			}
diff --git a/connected.c b/connected.c
index ed3025e7a2a..74a20cb32e7 100644
--- a/connected.c
+++ b/connected.c
@@ -110,7 +110,7 @@ int check_connected(oid_iterate_fn fn, void *cb_data,
 
 	rev_list.git_cmd = 1;
 	if (opt->env)
-		strvec_pushv(&rev_list.env_array, opt->env);
+		strvec_pushv(&rev_list.env, opt->env);
 	rev_list.in = -1;
 	rev_list.no_stdout = 1;
 	if (opt->err_fd)
diff --git a/daemon.c b/daemon.c
index aeda6966f05..58f1077885c 100644
--- a/daemon.c
+++ b/daemon.c
@@ -484,7 +484,7 @@ static int upload_pack(const struct strvec *env)
 	strvec_pushl(&cld.args, "upload-pack", "--strict", NULL);
 	strvec_pushf(&cld.args, "--timeout=%u", timeout);
 
-	strvec_pushv(&cld.env_array, env->v);
+	strvec_pushv(&cld.env, env->v);
 
 	return run_service_command(&cld);
 }
@@ -494,7 +494,7 @@ static int upload_archive(const struct strvec *env)
 	struct child_process cld = CHILD_PROCESS_INIT;
 	strvec_push(&cld.args, "upload-archive");
 
-	strvec_pushv(&cld.env_array, env->v);
+	strvec_pushv(&cld.env, env->v);
 
 	return run_service_command(&cld);
 }
@@ -504,7 +504,7 @@ static int receive_pack(const struct strvec *env)
 	struct child_process cld = CHILD_PROCESS_INIT;
 	strvec_push(&cld.args, "receive-pack");
 
-	strvec_pushv(&cld.env_array, env->v);
+	strvec_pushv(&cld.env, env->v);
 
 	return run_service_command(&cld);
 }
@@ -904,16 +904,16 @@ static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)
 		char buf[128] = "";
 		struct sockaddr_in *sin_addr = (void *) addr;
 		inet_ntop(addr->sa_family, &sin_addr->sin_addr, buf, sizeof(buf));
-		strvec_pushf(&cld.env_array, "REMOTE_ADDR=%s", buf);
-		strvec_pushf(&cld.env_array, "REMOTE_PORT=%d",
+		strvec_pushf(&cld.env, "REMOTE_ADDR=%s", buf);
+		strvec_pushf(&cld.env, "REMOTE_PORT=%d",
 			     ntohs(sin_addr->sin_port));
 #ifndef NO_IPV6
 	} else if (addr->sa_family == AF_INET6) {
 		char buf[128] = "";
 		struct sockaddr_in6 *sin6_addr = (void *) addr;
 		inet_ntop(AF_INET6, &sin6_addr->sin6_addr, buf, sizeof(buf));
-		strvec_pushf(&cld.env_array, "REMOTE_ADDR=[%s]", buf);
-		strvec_pushf(&cld.env_array, "REMOTE_PORT=%d",
+		strvec_pushf(&cld.env, "REMOTE_ADDR=[%s]", buf);
+		strvec_pushf(&cld.env, "REMOTE_PORT=%d",
 			     ntohs(sin6_addr->sin6_port));
 #endif
 	}
diff --git a/editor.c b/editor.c
index 8b9648281d7..008c04fe2f6 100644
--- a/editor.c
+++ b/editor.c
@@ -80,7 +80,7 @@ static int launch_specified_editor(const char *editor, const char *path,
 
 		strvec_pushl(&p.args, editor, realpath.buf, NULL);
 		if (env)
-			strvec_pushv(&p.env_array, (const char **)env);
+			strvec_pushv(&p.env, (const char **)env);
 		p.use_shell = 1;
 		p.trace2_child_class = "editor";
 		if (start_command(&p) < 0) {
diff --git a/hook.c b/hook.c
index 1d51be3b77a..2b47bdf5ef0 100644
--- a/hook.c
+++ b/hook.c
@@ -54,7 +54,7 @@ static int pick_next_hook(struct child_process *cp,
 		return 0;
 
 	cp->no_stdin = 1;
-	strvec_pushv(&cp->env_array, hook_cb->options->env.v);
+	strvec_pushv(&cp->env, hook_cb->options->env.v);
 	cp->stdout_to_stderr = 1;
 	cp->trace2_hook_name = hook_cb->hook_name;
 	cp->dir = hook_cb->options->dir;
diff --git a/http-backend.c b/http-backend.c
index 81a7229ece0..58b83a9f66b 100644
--- a/http-backend.c
+++ b/http-backend.c
@@ -476,9 +476,9 @@ static void run_service(const char **argv, int buffer_input)
 		host = "(none)";
 
 	if (!getenv("GIT_COMMITTER_NAME"))
-		strvec_pushf(&cld.env_array, "GIT_COMMITTER_NAME=%s", user);
+		strvec_pushf(&cld.env, "GIT_COMMITTER_NAME=%s", user);
 	if (!getenv("GIT_COMMITTER_EMAIL"))
-		strvec_pushf(&cld.env_array,
+		strvec_pushf(&cld.env,
 			     "GIT_COMMITTER_EMAIL=%s@http.%s", user, host);
 
 	strvec_pushv(&cld.args, argv);
diff --git a/object-file.c b/object-file.c
index d35c1820e7a..5a045d424df 100644
--- a/object-file.c
+++ b/object-file.c
@@ -838,7 +838,7 @@ static void fill_alternate_refs_command(struct child_process *cmd,
 		}
 	}
 
-	strvec_pushv(&cmd->env_array, (const char **)local_repo_env);
+	strvec_pushv(&cmd->env, (const char **)local_repo_env);
 	cmd->out = -1;
 }
 
diff --git a/pager.c b/pager.c
index 27877f8ebbc..5cfe23b025c 100644
--- a/pager.c
+++ b/pager.c
@@ -99,7 +99,7 @@ void prepare_pager_args(struct child_process *pager_process, const char *pager)
 {
 	strvec_push(&pager_process->args, pager);
 	pager_process->use_shell = 1;
-	setup_pager_env(&pager_process->env_array);
+	setup_pager_env(&pager_process->env);
 	pager_process->trace2_child_class = "pager";
 }
 
@@ -129,7 +129,7 @@ void setup_pager(void)
 	/* spawn the pager */
 	prepare_pager_args(&pager_process, pager);
 	pager_process.in = -1;
-	strvec_push(&pager_process.env_array, "GIT_PAGER_IN_USE");
+	strvec_push(&pager_process.env, "GIT_PAGER_IN_USE");
 	if (start_command(&pager_process))
 		return;
 
diff --git a/promisor-remote.c b/promisor-remote.c
index 8d6695681c1..5b33f88bca1 100644
--- a/promisor-remote.c
+++ b/promisor-remote.c
@@ -22,7 +22,7 @@ static int fetch_objects(struct repository *repo,
 	child.git_cmd = 1;
 	child.in = -1;
 	if (repo != the_repository)
-		prepare_other_repo_env(&child.env_array, repo->gitdir);
+		prepare_other_repo_env(&child.env, repo->gitdir);
 	strvec_pushl(&child.args, "-c", "fetch.negotiationAlgorithm=noop",
 		     "fetch", remote_name, "--no-tags",
 		     "--no-write-fetch-head", "--recurse-submodules=no",
diff --git a/run-command.c b/run-command.c
index a8501e38ceb..5f7ea713f06 100644
--- a/run-command.c
+++ b/run-command.c
@@ -20,7 +20,7 @@ void child_process_init(struct child_process *child)
 void child_process_clear(struct child_process *child)
 {
 	strvec_clear(&child->args);
-	strvec_clear(&child->env_array);
+	strvec_clear(&child->env);
 }
 
 struct child_to_clean {
@@ -646,7 +646,7 @@ static void trace_run_command(const struct child_process *cp)
 		sq_quote_buf_pretty(&buf, cp->dir);
 		strbuf_addch(&buf, ';');
 	}
-	trace_add_env(&buf, cp->env_array.v);
+	trace_add_env(&buf, cp->env.v);
 	if (cp->git_cmd)
 		strbuf_addstr(&buf, " git");
 	sq_quote_argv_pretty(&buf, cp->args.v);
@@ -751,7 +751,7 @@ int start_command(struct child_process *cmd)
 		set_cloexec(null_fd);
 	}
 
-	childenv = prep_childenv(cmd->env_array.v);
+	childenv = prep_childenv(cmd->env.v);
 	atfork_prepare(&as);
 
 	/*
@@ -914,8 +914,9 @@ int start_command(struct child_process *cmd)
 	else if (cmd->use_shell)
 		cmd->args.v = prepare_shell_cmd(&nargv, sargv);
 
-	cmd->pid = mingw_spawnvpe(cmd->args.v[0], cmd->args.v, (char**) cmd->env_array.v,
-			cmd->dir, fhin, fhout, fherr);
+	cmd->pid = mingw_spawnvpe(cmd->args.v[0], cmd->args.v,
+				  (char**) cmd->env.v,
+				  cmd->dir, fhin, fhout, fherr);
 	failed_errno = errno;
 	if (cmd->pid < 0 && (!cmd->silent_exec_failure || errno != ENOENT))
 		error_errno("cannot spawn %s", cmd->args.v[0]);
@@ -1031,7 +1032,7 @@ int run_command_v_opt_cd_env_tr2(const char **argv, int opt, const char *dir,
 	cmd.close_object_store = opt & RUN_CLOSE_OBJECT_STORE ? 1 : 0;
 	cmd.dir = dir;
 	if (env)
-		strvec_pushv(&cmd.env_array, (const char **)env);
+		strvec_pushv(&cmd.env, (const char **)env);
 	cmd.trace2_child_class = tr2_class;
 	return run_command(&cmd);
 }
diff --git a/run-command.h b/run-command.h
index 5bd0c933e80..d52ebc42b97 100644
--- a/run-command.h
+++ b/run-command.h
@@ -73,7 +73,7 @@ struct child_process {
 	 * The memory in .env_array will be cleaned up automatically during
 	 * `finish_command` (or during `start_command` when it is unsuccessful).
 	 */
-	struct strvec env_array;
+	struct strvec env;
 	pid_t pid;
 
 	int trace2_child_id;
@@ -146,7 +146,7 @@ struct child_process {
 
 #define CHILD_PROCESS_INIT { \
 	.args = STRVEC_INIT, \
-	.env_array = STRVEC_INIT, \
+	.env = STRVEC_INIT, \
 }
 
 /**
diff --git a/sequencer.c b/sequencer.c
index 8c3ed3532ac..701e420cddd 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1000,7 +1000,7 @@ static int run_git_commit(const char *defmsg,
 	if (is_rebase_i(opts) &&
 	    ((opts->committer_date_is_author_date && !opts->ignore_date) ||
 	     !(!defmsg && (flags & AMEND_MSG))) &&
-	    read_env_script(&cmd.env_array)) {
+	    read_env_script(&cmd.env)) {
 		const char *gpg_opt = gpg_sign_opt_quoted(opts);
 
 		return error(_(staged_changes_advice),
@@ -1008,12 +1008,12 @@ static int run_git_commit(const char *defmsg,
 	}
 
 	if (opts->committer_date_is_author_date)
-		strvec_pushf(&cmd.env_array, "GIT_COMMITTER_DATE=%s",
+		strvec_pushf(&cmd.env, "GIT_COMMITTER_DATE=%s",
 			     opts->ignore_date ?
 			     "" :
-			     author_date_from_env_array(&cmd.env_array));
+			     author_date_from_env_array(&cmd.env));
 	if (opts->ignore_date)
-		strvec_push(&cmd.env_array, "GIT_AUTHOR_DATE=");
+		strvec_push(&cmd.env, "GIT_AUTHOR_DATE=");
 
 	strvec_push(&cmd.args, "commit");
 
@@ -3911,7 +3911,7 @@ static int do_merge(struct repository *r,
 		/* Octopus merge */
 		struct child_process cmd = CHILD_PROCESS_INIT;
 
-		if (read_env_script(&cmd.env_array)) {
+		if (read_env_script(&cmd.env)) {
 			const char *gpg_opt = gpg_sign_opt_quoted(opts);
 
 			ret = error(_(staged_changes_advice), gpg_opt, gpg_opt);
@@ -3919,12 +3919,12 @@ static int do_merge(struct repository *r,
 		}
 
 		if (opts->committer_date_is_author_date)
-			strvec_pushf(&cmd.env_array, "GIT_COMMITTER_DATE=%s",
+			strvec_pushf(&cmd.env, "GIT_COMMITTER_DATE=%s",
 				     opts->ignore_date ?
 				     "" :
-				     author_date_from_env_array(&cmd.env_array));
+				     author_date_from_env_array(&cmd.env));
 		if (opts->ignore_date)
-			strvec_push(&cmd.env_array, "GIT_AUTHOR_DATE=");
+			strvec_push(&cmd.env, "GIT_AUTHOR_DATE=");
 
 		cmd.git_cmd = 1;
 		strvec_push(&cmd.args, "merge");
diff --git a/submodule.c b/submodule.c
index 86c8f0f89db..1229660f02c 100644
--- a/submodule.c
+++ b/submodule.c
@@ -711,15 +711,15 @@ void show_submodule_inline_diff(struct diff_options *o, const char *path,
 	if (!(dirty_submodule & DIRTY_SUBMODULE_MODIFIED))
 		strvec_push(&cp.args, oid_to_hex(new_oid));
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	if (!is_directory(path)) {
 		/* fall back to absorbed git dir, if any */
 		if (!sub)
 			goto done;
 		cp.dir = sub->gitdir;
-		strvec_push(&cp.env_array, GIT_DIR_ENVIRONMENT "=.");
-		strvec_push(&cp.env_array, GIT_WORK_TREE_ENVIRONMENT "=.");
+		strvec_push(&cp.env, GIT_DIR_ENVIRONMENT "=.");
+		strvec_push(&cp.env, GIT_WORK_TREE_ENVIRONMENT "=.");
 	}
 
 	if (start_command(&cp)) {
@@ -1019,7 +1019,7 @@ static int submodule_has_commits(struct repository *r,
 		oid_array_for_each_unique(commits, append_oid_to_argv, &cp.args);
 		strvec_pushl(&cp.args, "--not", "--all", NULL);
 
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.git_cmd = 1;
 		cp.no_stdin = 1;
 		cp.dir = path;
@@ -1060,7 +1060,7 @@ static int submodule_needs_pushing(struct repository *r,
 		oid_array_for_each_unique(commits, append_oid_to_argv, &cp.args);
 		strvec_pushl(&cp.args, "--not", "--remotes", "-n", "1" , NULL);
 
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.git_cmd = 1;
 		cp.no_stdin = 1;
 		cp.out = -1;
@@ -1146,7 +1146,7 @@ static int push_submodule(const char *path,
 				strvec_push(&cp.args, rs->raw[i]);
 		}
 
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		cp.git_cmd = 1;
 		cp.no_stdin = 1;
 		cp.dir = path;
@@ -1177,7 +1177,7 @@ static void submodule_push_check(const char *path, const char *head,
 	for (i = 0; i < rs->raw_nr; i++)
 		strvec_push(&cp.args, rs->raw[i]);
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
 	cp.no_stdout = 1;
@@ -1678,7 +1678,7 @@ static int get_next_submodule(struct child_process *cp, struct strbuf *err,
 
 		child_process_init(cp);
 		cp->dir = task->repo->gitdir;
-		prepare_submodule_repo_env_in_gitdir(&cp->env_array);
+		prepare_submodule_repo_env_in_gitdir(&cp->env);
 		cp->git_cmd = 1;
 		strvec_init(&cp->args);
 		if (task->git_args.nr)
@@ -1708,7 +1708,7 @@ static int get_next_submodule(struct child_process *cp, struct strbuf *err,
 			    spf->prefix, task->sub->path);
 
 		child_process_init(cp);
-		prepare_submodule_repo_env_in_gitdir(&cp->env_array);
+		prepare_submodule_repo_env_in_gitdir(&cp->env);
 		cp->git_cmd = 1;
 		cp->dir = task->repo->gitdir;
 
@@ -1882,7 +1882,7 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked)
 	if (ignore_untracked)
 		strvec_push(&cp.args, "-uno");
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
 	cp.out = -1;
@@ -1954,7 +1954,7 @@ int submodule_uses_gitfile(const char *path)
 		     "submodule", "foreach", "--quiet",	"--recursive",
 		     "test -f .git", NULL);
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
 	cp.no_stderr = 1;
@@ -1997,7 +1997,7 @@ int bad_to_remove_submodule(const char *path, unsigned flags)
 	if (!(flags & SUBMODULE_REMOVAL_IGNORE_IGNORED_UNTRACKED))
 		strvec_push(&cp.args, "--ignored");
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
 	cp.out = -1;
@@ -2052,7 +2052,7 @@ static int submodule_has_dirty_index(const struct submodule *sub)
 {
 	struct child_process cp = CHILD_PROCESS_INIT;
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	cp.git_cmd = 1;
 	strvec_pushl(&cp.args, "diff-index", "--quiet",
@@ -2069,7 +2069,7 @@ static int submodule_has_dirty_index(const struct submodule *sub)
 static void submodule_reset_index(const char *path)
 {
 	struct child_process cp = CHILD_PROCESS_INIT;
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
@@ -2153,7 +2153,7 @@ int submodule_move_head(const char *path,
 		}
 	}
 
-	prepare_submodule_repo_env(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
 
 	cp.git_cmd = 1;
 	cp.no_stdin = 1;
@@ -2191,7 +2191,7 @@ int submodule_move_head(const char *path,
 			cp.no_stdin = 1;
 			cp.dir = path;
 
-			prepare_submodule_repo_env(&cp.env_array);
+			prepare_submodule_repo_env(&cp.env);
 			strvec_pushl(&cp.args, "update-ref", "HEAD",
 				     "--no-deref", new_head, NULL);
 
@@ -2374,7 +2374,7 @@ void absorb_git_dir_into_superproject(const char *path,
 		strvec_pushl(&cp.args, "--super-prefix", sb.buf,
 			     "submodule--helper",
 			     "absorb-git-dirs", NULL);
-		prepare_submodule_repo_env(&cp.env_array);
+		prepare_submodule_repo_env(&cp.env);
 		if (run_command(&cp))
 			die(_("could not recurse into submodule '%s'"), path);
 
@@ -2407,8 +2407,8 @@ int get_superproject_working_tree(struct strbuf *buf)
 	subpath = relative_path(cwd, one_up.buf, &sb);
 	strbuf_release(&one_up);
 
-	prepare_submodule_repo_env(&cp.env_array);
-	strvec_pop(&cp.env_array);
+	prepare_submodule_repo_env(&cp.env);
+	strvec_pop(&cp.env);
 
 	strvec_pushl(&cp.args, "--literal-pathspecs", "-C", "..",
 		     "ls-files", "-z", "--stage", "--full-name", "--",
diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c
index f3b90aa834a..9050e3113c5 100644
--- a/t/helper/test-run-command.c
+++ b/t/helper/test-run-command.c
@@ -390,7 +390,7 @@ int cmd__run_command(int argc, const char **argv)
 	while (!strcmp(argv[1], "env")) {
 		if (!argv[2])
 			die("env specifier without a value");
-		strvec_push(&proc.env_array, argv[2]);
+		strvec_push(&proc.env, argv[2]);
 		argv += 2;
 		argc -= 2;
 	}
diff --git a/trailer.c b/trailer.c
index 926a3729df5..d419c20735e 100644
--- a/trailer.c
+++ b/trailer.c
@@ -236,7 +236,7 @@ static char *apply_command(struct conf_info *conf, const char *arg)
 			strbuf_replace(&cmd, TRAILER_ARG_STRING, arg);
 		strvec_push(&cp.args, cmd.buf);
 	}
-	strvec_pushv(&cp.env_array, (const char **)local_repo_env);
+	strvec_pushv(&cp.env, (const char **)local_repo_env);
 	cp.no_stdin = 1;
 	cp.use_shell = 1;
 
diff --git a/transport-helper.c b/transport-helper.c
index b4dbbabb0c2..322c7224782 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -135,7 +135,7 @@ static struct child_process *get_helper(struct transport *transport)
 	helper->silent_exec_failure = 1;
 
 	if (have_git_dir())
-		strvec_pushf(&helper->env_array, "%s=%s",
+		strvec_pushf(&helper->env, "%s=%s",
 			     GIT_DIR_ENVIRONMENT, get_git_dir());
 
 	helper->trace2_child_class = helper->args.v[0]; /* "remote-<name>" */
diff --git a/wt-status.c b/wt-status.c
index d33f9272b72..62fadc0c93d 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -982,7 +982,7 @@ static void wt_longstatus_print_submodule_summary(struct wt_status *s, int uncom
 	struct strbuf summary = STRBUF_INIT;
 	char *summary_content;
 
-	strvec_pushf(&sm_summary.env_array, "GIT_INDEX_FILE=%s", s->index_file);
+	strvec_pushf(&sm_summary.env, "GIT_INDEX_FILE=%s", s->index_file);
 
 	strvec_push(&sm_summary.args, "submodule");
 	strvec_push(&sm_summary.args, "summary");
-- 
2.36.1.1103.gb3ecdfb3e6a


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v3 2/2] run-command API users: use "env" not "env_array" in comments & names
  2022-06-02  9:09         ` [PATCH v3 0/2] " Ævar Arnfjörð Bjarmason
  2022-06-02  9:09           ` [PATCH v3 1/2] run-command API: " Ævar Arnfjörð Bjarmason
@ 2022-06-02  9:09           ` Ævar Arnfjörð Bjarmason
  1 sibling, 0 replies; 26+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-06-02  9:09 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Enzo Matsumiya, Eric Sunshine,
	Ævar Arnfjörð Bjarmason

Follow-up on a preceding commit which changed all references to the
"env_array" when referring to the "struct child_process" member. These
changes are all unnecessary for the compiler, but help the code's
human readers.

All the comments that referred to "env_array" have now been updated,
as well as function names and variables that had "env_array" in their
name, they now refer to "env".

In addition the "out" name for the submodule.h prototype was
inconsistent with the function definition's use of "env_array" in
submodule.c. Both of them use "env" now.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/submodule--helper.c |  2 +-
 run-command.c               |  6 +++---
 run-command.h               | 10 +++++-----
 sequencer.c                 |  6 +++---
 submodule.h                 |  4 ++--
 5 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index b855e544bd6..0d37b9dd5bb 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -513,7 +513,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
 		 * on windows. And since environment variables are
 		 * case-insensitive in windows, it interferes with the
 		 * existing PATH variable. Hence, to avoid that, we expose
-		 * path via the args strvec and not via env_array.
+		 * path via the args strvec and not via env.
 		 */
 		sq_quote_buf(&sb, path);
 		strvec_pushf(&cp.args, "path=%s; %s",
diff --git a/run-command.c b/run-command.c
index 5f7ea713f06..789eaa59750 100644
--- a/run-command.c
+++ b/run-command.c
@@ -1816,16 +1816,16 @@ int run_auto_maintenance(int quiet)
 	return run_command(&maint);
 }
 
-void prepare_other_repo_env(struct strvec *env_array, const char *new_git_dir)
+void prepare_other_repo_env(struct strvec *env, const char *new_git_dir)
 {
 	const char * const *var;
 
 	for (var = local_repo_env; *var; var++) {
 		if (strcmp(*var, CONFIG_DATA_ENVIRONMENT) &&
 		    strcmp(*var, CONFIG_COUNT_ENVIRONMENT))
-			strvec_push(env_array, *var);
+			strvec_push(env, *var);
 	}
-	strvec_pushf(env_array, "%s=%s", GIT_DIR_ENVIRONMENT, new_git_dir);
+	strvec_pushf(env, "%s=%s", GIT_DIR_ENVIRONMENT, new_git_dir);
 }
 
 enum start_bg_result start_bg_command(struct child_process *cmd,
diff --git a/run-command.h b/run-command.h
index d52ebc42b97..8a700da0998 100644
--- a/run-command.h
+++ b/run-command.h
@@ -58,7 +58,7 @@ struct child_process {
 	struct strvec args;
 
 	/**
-	 * Like .args the .env_array is a `struct strvec'.
+	 * Like .args the .env is a `struct strvec'.
 	 *
 	 * To modify the environment of the sub-process, specify an array of
 	 * environment settings. Each string in the array manipulates the
@@ -70,7 +70,7 @@ struct child_process {
 	 * - If the string does not contain '=', it names an environment
 	 *   variable that will be removed from the child process's environment.
 	 *
-	 * The memory in .env_array will be cleaned up automatically during
+	 * The memory in .env will be cleaned up automatically during
 	 * `finish_command` (or during `start_command` when it is unsuccessful).
 	 */
 	struct strvec env;
@@ -479,14 +479,14 @@ int run_processes_parallel_tr2(int n, get_next_task_fn, start_failure_fn,
 			       const char *tr2_category, const char *tr2_label);
 
 /**
- * Convenience function which prepares env_array for a command to be run in a
- * new repo. This adds all GIT_* environment variables to env_array with the
+ * Convenience function which prepares env for a command to be run in a
+ * new repo. This adds all GIT_* environment variables to env with the
  * exception of GIT_CONFIG_PARAMETERS and GIT_CONFIG_COUNT (which cause the
  * corresponding environment variables to be unset in the subprocess) and adds
  * an environment variable pointing to new_git_dir. See local_repo_env in
  * cache.h for more information.
  */
-void prepare_other_repo_env(struct strvec *env_array, const char *new_git_dir);
+void prepare_other_repo_env(struct strvec *env, const char *new_git_dir);
 
 /**
  * Possible return values for start_bg_command().
diff --git a/sequencer.c b/sequencer.c
index 701e420cddd..2ef6bf22e87 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -919,7 +919,7 @@ static char *get_author(const char *message)
 	return NULL;
 }
 
-static const char *author_date_from_env_array(const struct strvec *env)
+static const char *author_date_from_env(const struct strvec *env)
 {
 	int i;
 	const char *date;
@@ -1011,7 +1011,7 @@ static int run_git_commit(const char *defmsg,
 		strvec_pushf(&cmd.env, "GIT_COMMITTER_DATE=%s",
 			     opts->ignore_date ?
 			     "" :
-			     author_date_from_env_array(&cmd.env));
+			     author_date_from_env(&cmd.env));
 	if (opts->ignore_date)
 		strvec_push(&cmd.env, "GIT_AUTHOR_DATE=");
 
@@ -3922,7 +3922,7 @@ static int do_merge(struct repository *r,
 			strvec_pushf(&cmd.env, "GIT_COMMITTER_DATE=%s",
 				     opts->ignore_date ?
 				     "" :
-				     author_date_from_env_array(&cmd.env));
+				     author_date_from_env(&cmd.env));
 		if (opts->ignore_date)
 			strvec_push(&cmd.env, "GIT_AUTHOR_DATE=");
 
diff --git a/submodule.h b/submodule.h
index 437bc96e05e..bfaa9da1868 100644
--- a/submodule.h
+++ b/submodule.h
@@ -158,11 +158,11 @@ int submodule_move_head(const char *path,
 void submodule_unset_core_worktree(const struct submodule *sub);
 
 /*
- * Prepare the "env_array" parameter of a "struct child_process" for executing
+ * Prepare the "env" parameter of a "struct child_process" for executing
  * a submodule by clearing any repo-specific environment variables, but
  * retaining any config in the environment.
  */
-void prepare_submodule_repo_env(struct strvec *out);
+void prepare_submodule_repo_env(struct strvec *env);
 
 #define ABSORB_GITDIR_RECURSE_SUBMODULES (1<<0)
 void absorb_git_dir_into_superproject(const char *path,
-- 
2.36.1.1103.gb3ecdfb3e6a


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH v3 1/2] run-command API: rename "env_array" to "env"
  2022-06-02  9:09           ` [PATCH v3 1/2] run-command API: " Ævar Arnfjörð Bjarmason
@ 2022-06-03  0:37             ` Junio C Hamano
  0 siblings, 0 replies; 26+ messages in thread
From: Junio C Hamano @ 2022-06-03  0:37 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Jeff King, Enzo Matsumiya, Eric Sunshine

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> 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

It makes sense to have this in the log message for documentation
purposes.  We have plenty of examples of renaming a symbol to
another, like the simple ones in object_id.cocci, so adding this to
the collection in contrib/coccinelle would not add much value.

Will replace.  Thanks.

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2022-06-03  0:38 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16  2:32 What's cooking in git.git (Dec 2021, #04; Wed, 15) Junio C Hamano
2021-12-16 11:51 ` ab/run-command (was: What's cooking in git.git (Dec 2021, #04; Wed, 15)) Ævar Arnfjörð Bjarmason
2021-12-16 15:31   ` Jeff King
2021-12-16 15:38     ` Ævar Arnfjörð Bjarmason
2021-12-16 19:11       ` ab/run-command Junio C Hamano
2022-04-06 10:42     ` [PATCH 0/3] run-command.h: rename "env_array" to "env" Ævar Arnfjörð Bjarmason
2022-04-06 10:42       ` [PATCH 1/3] cocci: add a rename of "struct child_process"'s " Ævar Arnfjörð Bjarmason
2022-04-06 10:42       ` [PATCH 2/3] run-command API: rename " Ævar Arnfjörð Bjarmason
2022-04-06 10:42       ` [PATCH 3/3] run-command API users: use "env" not "env_array" in comments & names Ævar Arnfjörð Bjarmason
2022-04-07 12:09       ` [PATCH 0/3] run-command.h: rename "env_array" to "env" Johannes Schindelin
2022-04-07 16:48         ` Junio C Hamano
2022-04-07 17:52           ` Junio C Hamano
2022-05-20  7:24       ` [PATCH v2 0/4] " Ævar Arnfjörð Bjarmason
2022-05-20  7:24         ` [PATCH v2 1/4] cocci: add a rename of "struct child_process"'s " Ævar Arnfjörð Bjarmason
2022-05-20  7:24         ` [PATCH v2 2/4] run-command API: rename " Ævar Arnfjörð Bjarmason
2022-05-20  7:24         ` [PATCH v2 3/4] cocci: remove env_array -> env migration Ævar Arnfjörð Bjarmason
2022-05-20  7:24         ` [PATCH v2 4/4] run-command API users: use "env" not "env_array" in comments & names Ævar Arnfjörð Bjarmason
2022-05-20 16:27         ` [PATCH v2 0/4] run-command.h: rename "env_array" to "env" Junio C Hamano
2022-05-21 11:09           ` Ævar Arnfjörð Bjarmason
2022-06-02  9:09         ` [PATCH v3 0/2] " Ævar Arnfjörð Bjarmason
2022-06-02  9:09           ` [PATCH v3 1/2] run-command API: " Ævar Arnfjörð Bjarmason
2022-06-03  0:37             ` Junio C Hamano
2022-06-02  9:09           ` [PATCH v3 2/2] run-command API users: use "env" not "env_array" in comments & names Ævar Arnfjörð Bjarmason
2021-12-16 23:46 ` ab/make-dependency (was: What's cooking in git.git (Dec 2021, #04; Wed, 15)) Ævar Arnfjörð Bjarmason
2021-12-21  1:34 ` What's cooking in git.git (Dec 2021, #04; Wed, 15) Aleen 徐沛文
2021-12-21  7:30   ` Christian Couder

Code repositories for project(s) associated with this public inbox

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

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