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

Re: What's cooking in git.git (Dec 2017, #01; Mon, 4)

From
Torsten Bögershausen <tboegi@web.de>
Date
Dec 9, 2017, 14:46 UTC
Message-ID
<20171209144607.GA6443@tor.lan>
In-Reply-To
<20171207213312.GB3693@zaya.teonanacatl.net>
On Thu, Dec 07, 2017 at 04:33:12PM -0500, Todd Zullinger wrote:
Show 5 quoted lines
> Jeff Hostetler wrote:
> >I'm looking at t5616 now on my mac.
> >Looks like the MAC doesn't like my line counting in the tests.
> >I'll fix in my next version.
> 
[]
Show 5 quoted lines
> 		| sort >expect_2.oids &&
> -	test "$(wc -l <expect_2.oids)" = "8" &&
> +	test_line_count = 8 expect_2.oids &&
> 	git -C src blame master -- file.1.txt >expect.blame
> '

The problem seems to be the '"' around wc, this would work: test $(wc -l <expect_2.oids) = "8" &&

What do you guys think a about a lint test like this:
diff --git a/t/check-non-portable-shell.pl b/t/check-non-portable-shell.pl
index 03dc9d2852..9ebf65c26f 100755
--- a/t/check-non-portable-shell.pl
+++ b/t/check-non-portable-shell.pl
@@ -21,6 +21,7 @@ while (<>) {
 	/^\s*declare\s+/ and err 'arrays/declare not portable';
 	/^\s*[^#]\s*which\s/ and err 'which is not portable (please use type)';
 	/\btest\s+[^=]*==/ and err '"test a == b" is not portable (please use =)';
+	/\bwc -l.*"\s*=/ and err '`"$(wc -l)"` is not portable, please use `$(wc -l)`';
 	/\bexport\s+[A-Za-z0-9_]*=/ and err '"export FOO=bar" is not portable (please use FOO=bar && expo
Previous: Todd ZullingerNext: Johannes Schindelin
Message 25 of 26 in “What's cooking in git.git (Dec 2017, #01; Mon, 4)”
  1. Junio C HamanoDec 4, 2017
  2. Jeff HostetlerDec 4, 2017
  3. Elijah NewrenDec 4, 2017
  4. Jonathan TanDec 4, 2017
  5. Junio C HamanoDec 5, 2017
  6. Lars SchneiderDec 6, 2017
  7. Torsten BögershausenDec 6, 2017
  8. Junio C HamanoDec 6, 2017
  9. Johannes SchindelinDec 7, 2017
  10. Todd ZullingerDec 7, 2017
  11. Junio C HamanoDec 7, 2017
  12. Lars SchneiderDec 7, 2017
  13. Junio C HamanoDec 7, 2017
  14. Jeff HostetlerDec 7, 2017
  15. Junio C HamanoDec 7, 2017
  16. 1/1 check-non-portable-shell.pl: Quoted `wc -l` is not portabletboegi@web.de, Dec 10, 2017
  17. Johannes SchindelinDec 10, 2017
  18. Junio C HamanoDec 11, 2017
  19. 1/1 check-non-portable-shell.pl: Quoted `wc -l` is not portabletboegi@web.de, Dec 16, 2017
  20. Eric SunshineDec 17, 2017
  21. 1/1 check-non-portable-shell.pl: Quoted `wc -l` is not portabletboegi@web.de, Dec 21, 2017
  22. Junio C HamanoDec 22, 2017
  23. Torsten BögershausenDec 23, 2017
  24. Todd ZullingerDec 7, 2017
  25. Torsten BögershausenDec 9, 2017
  26. Johannes SchindelinDec 10, 2017

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.