git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/4] test-lint: detect one-shot "FOO=bar shell_func"
@ 2018-07-13  5:52 Eric Sunshine
  2018-07-13  5:52 ` [PATCH 1/4] t6046/t9833: fix use of "VAR=VAL cmd" with a shell function Eric Sunshine
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Eric Sunshine @ 2018-07-13  5:52 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Jeff King, Eric Sunshine

One-shot "FOO=bar cmd" environment variable assignments exist only
during invocation of 'cmd'. However, if 'cmd' is a shell function, then
the variable is assigned in the running shell and exists until the
process exits (or is unset explicitly). Such a side-effect is almost
certainly unintended by a test author and is likely due to lack of
familiarity with the problem.

Upgrade "make test-lint" to detect this sort of suspect usage.

Also fix a couple instances of "FOO=bar shell_func" detected by the
improved linting.

This series is built atop 'jc/t3404-one-shot-export-fix'[1].

[1]: https://public-inbox.org/git/xmqqefg8w73c.fsf@gitster-ct.c.googlers.com/T/

Eric Sunshine (4):
  t6046/t9833: fix use of "VAR=VAL cmd" with a shell function
  t/check-non-portable-shell: stop being so polite
  t/check-non-portable-shell: make error messages more compact
  t/check-non-portable-shell: detect "FOO=bar shell_func"

 t/check-non-portable-shell.pl          | 31 +++++++++++++++++++++-----
 t/t6046-merge-skip-unneeded-updates.sh |  4 +++-
 t/t9833-errors.sh                      |  4 +++-
 3 files changed, 32 insertions(+), 7 deletions(-)

-- 
2.18.0.233.g985f88cf7e

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

end of thread, other threads:[~2018-07-13  5:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-13  5:52 [PATCH 0/4] test-lint: detect one-shot "FOO=bar shell_func" Eric Sunshine
2018-07-13  5:52 ` [PATCH 1/4] t6046/t9833: fix use of "VAR=VAL cmd" with a shell function Eric Sunshine
2018-07-13  5:52 ` [PATCH 2/4] t/check-non-portable-shell: stop being so polite Eric Sunshine
2018-07-13  5:52 ` [PATCH 3/4] t/check-non-portable-shell: make error messages more compact Eric Sunshine
2018-07-13  5:52 ` [PATCH 4/4] t/check-non-portable-shell: detect "FOO=bar shell_func" Eric Sunshine

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).