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

Re: [PATCH 08/12] t9150-svk-mergetickets.sh: use the $( ... ) construct for command substitution

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 12, 2016, 19:59 UTC
Message-ID
<xmqq8u3utvpq.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1452599378-47882-9-git-send-email-gitter.spiros@gmail.com>
Elia Pinto <gitter.spiros@gmail.com> writes:
>  test_expect_success 'svk merges were represented coming in' "
> -	[ `git cat-file commit HEAD | grep parent | wc -l` -eq 2 ]
> +	[ $(git cat-file commit HEAD | grep parent | wc -l) -eq 2 ]
>  	"

Entirely outside of the theme of this topic, but this should be corrected to use "test".

More importantly, the outer quote should become single quote. As it currently is written, "git cat-file" runs outside the protection of test_expect_success when the command line of the test_expect_success is formulated, which defeats the whole purpose of test helper macros to run everything "git" inside them.

Previous: Elia PintoNext: Elia Pinto
Message 10 of 15 in “use the $( ... ) construct for command substitution”
  1. 00/12 use the $( ... ) construct for command substitutionElia Pinto, Jan 12, 2016
  2. 01/12 t9119-git-svn-info.sh: use the $( ... ) construct for command substitutionElia Pinto, Jan 12, 2016
  3. 02/12 t9129-git-svn-i18n-commitencoding.sh: use the $( ... ) construct for command substitutionElia Pinto, Jan 12, 2016
  4. 03/12 t9130-git-svn-authors-file.sh: use the $( ... ) construct for command substitutionElia Pinto, Jan 12, 2016
  5. 04/12 t9132-git-svn-broken-symlink.sh: use the $( ... ) construct for command substitutionElia Pinto, Jan 12, 2016
  6. 05/12 t9137-git-svn-dcommit-clobber-series.sh: use the $( ... ) construct for command substitutionElia Pinto, Jan 12, 2016
  7. 06/12 t9138-git-svn-authors-prog.sh: use the $( ... ) construct for command substitutionElia Pinto, Jan 12, 2016
  8. 07/12 t9145-git-svn-master-branch.sh: use the $( ... ) construct for command substitutionElia Pinto, Jan 12, 2016
  9. 08/12 t9150-svk-mergetickets.sh: use the $( ... ) construct for command substitutionElia Pinto, Jan 12, 2016
  10. Junio C HamanoJan 12, 2016
  11. 09/12 t9300-fast-import.sh: use the $( ... ) construct for command substitutionElia Pinto, Jan 12, 2016
  12. 10/12 t9350-fast-export.sh: use the $( ... ) construct for command substitutionElia Pinto, Jan 12, 2016
  13. 11/12 t9501-gitweb-standalone-http-status.sh: use the $( ... ) construct for command substitutionElia Pinto, Jan 12, 2016
  14. 12/12 t9901-git-web--browse.sh: use the $( ... ) construct for command substitutionElia Pinto, Jan 12, 2016
  15. Junio C HamanoJan 12, 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.