git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/4] t0021: put $TEST_ROOT in $PATH

From
Lars Schneider <larsxschneider@gmail.com>
Date
Nov 6, 2016, 14:29 UTC
Message-ID
<C023A4E4-AA9B-45EF-AA34-C249323F2AE8@gmail.com>
In-Reply-To
<20161102181824.mi6lmfnfckvrav7n@sigill.intra.peff.net>
Show 58 quoted lines
> On 02 Nov 2016, at 19:18, Jeff King <peff@peff.net> wrote:
> 
> We create a rot13.sh script in the trash directory, but need
> to call it by its full path when we have moved our cwd to
> another directory. Let's just put $TEST_ROOT in our $PATH so
> that the script is always found.
> 
> This is a minor convenience for rot13.sh, but will be a
> major one when we switch rot13-filter.pl to a script in the
> same directory, as it means we will not have to deal with
> shell quoting inside the filter-process config.
> 
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> t/t0021-conversion.sh | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
> index dfde22549..c1ad20c61 100755
> --- a/t/t0021-conversion.sh
> +++ b/t/t0021-conversion.sh
> @@ -5,6 +5,7 @@ test_description='blob conversion via gitattributes'
> . ./test-lib.sh
> 
> TEST_ROOT="$(pwd)"
> +PATH=$TEST_ROOT:$PATH
> 
> write_script <<\EOF "$TEST_ROOT/rot13.sh"
> tr \
> @@ -64,7 +65,7 @@ test_cmp_exclude_clean () {
> # is equal to the committed content.
> test_cmp_committed_rot13 () {
> 	test_cmp "$1" "$2" &&
> -	"$TEST_ROOT/rot13.sh" <"$1" >expected &&
> +	rot13.sh <"$1" >expected &&
> 	git cat-file blob :"$2" >actual &&
> 	test_cmp expected actual
> }
> @@ -513,7 +514,7 @@ test_expect_success PERL 'required process filter should process multiple packet
> 		for FILE in "$TEST_ROOT"/*.file
> 		do
> 			cp "$FILE" . &&
> -			"$TEST_ROOT/rot13.sh" <"$FILE" >"$FILE.rot13"
> +			rot13.sh <"$FILE" >"$FILE.rot13"
> 		done &&
> 
> 		echo "*.file filter=protocol" >.gitattributes &&
> @@ -616,7 +617,7 @@ test_expect_success PERL 'process filter should restart after unexpected write f
> 
> 		# Smudge failed
> 		! test_cmp smudge-write-fail.o smudge-write-fail.r &&
> -		"$TEST_ROOT/rot13.sh" <smudge-write-fail.o >expected &&
> +		rot13.sh <smudge-write-fail.o >expected &&
> 		git cat-file blob :smudge-write-fail.r >actual &&
> 		test_cmp expected actual
> 	)
> -- 
> 2.11.0.rc0.258.gf434c15

Looks good to me and the PWD Windows fix suggested by Hannes [1] works great on macOS.

Thanks, Lars

[1] http://public-inbox.org/git/20161103204438.zfe653c2bsv3zqkx@sigill.intra.peff.net/
Previous: Johannes SixtNext: Jeff King
Message 17 of 30 in “What's cooking in git.git (Oct 2016, #09; Mon, 31)”
  1. Junio C HamanoOct 31, 2016
  2. Torsten BögershausenNov 2, 2016
  3. Junio C HamanoNov 2, 2016
  4. Johannes SchindelinNov 2, 2016
  5. Junio C HamanoNov 2, 2016
  6. Torsten BögershausenNov 2, 2016
  7. Jeff KingNov 2, 2016
  8. 0/4 t0021 perl portability fixupsJeff King, Nov 2, 2016
  9. 1/4 t0021: use write_script to create rot13 shell scriptJeff King, Nov 2, 2016
  10. Lars SchneiderNov 6, 2016
  11. Jeff KingNov 6, 2016
  12. Lars SchneiderNov 6, 2016
  13. 2/4 t0021: put $TEST_ROOT in $PATHJeff King, Nov 2, 2016
  14. Johannes SixtNov 3, 2016
  15. Jeff KingNov 3, 2016
  16. Johannes SixtNov 3, 2016
  17. Lars SchneiderNov 6, 2016
  18. 3/4 t0021: use $PERL_PATH for rot13-filter.plJeff King, Nov 2, 2016
  19. Lars SchneiderNov 6, 2016
  20. Jeff KingNov 6, 2016
  21. 4/4 t0021: fix filehandle usage on older perlJeff King, Nov 2, 2016
  22. Torsten BögershausenNov 2, 2016
  23. Lars SchneiderNov 6, 2016
  24. Johannes SixtNov 2, 2016
  25. Lars SchneiderNov 3, 2016
  26. Lars SchneiderNov 2, 2016
  27. Torsten BögershausenNov 5, 2016
  28. Karthik NayakNov 8, 2016
  29. Torsten BögershausenNov 5, 2016
  30. Karthik NayakNov 8, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.