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

Re: [PATCH v4 3/3] git: submodule honor -c credential.* from command line

From
Jeff King <peff@peff.net>
Date
Feb 26, 2016, 22:05 UTC
Message-ID
<20160226220553.GA1835@sigill.intra.peff.net>
In-Reply-To
<1456514328-10153-3-git-send-email-jacob.e.keller@intel.com>
On Fri, Feb 26, 2016 at 11:18:48AM -0800, Jacob Keller wrote:
Show 7 quoted lines
> +test_expect_success 'sanitize-config keeps credential.helper' "
> +	git -c credential.helper=helper submodule--helper sanitize-config >actual &&
> +	cat >expect <<-EOF &&
> +	'credential.helper=helper'
> +	EOF
> +	test_cmp expect actual
> +"
This can (and should) be "<<-\EOF", right?

I happened to be writing a test with the exact same problem (embedded single-quotes) today, and realized we have another solution which is used elsewhere in the test suite:

  sq="'"
  test_expect_success '...' '
	echo "${sq}credential.helper=helper${sq}" >expect &&
	...
  '

that is slightly more verbose, but it does let us keep the main body inside single-quotes, without restoring to confusing backslash escaping.

-Peff
Previous: Jacob KellerNext: Jacob Keller
Message 6 of 8 in “t/lib-httpd: load mod_unixd”
  1. 1/3 t/lib-httpd: load mod_unixdJacob Keller, Feb 26, 2016
  2. 2/3 sumodule--helper: fix submodule--helper clone usage and check argc countJacob Keller, Feb 26, 2016
  3. Stefan BellerFeb 26, 2016
  4. Jacob KellerFeb 26, 2016
  5. 3/3 git: submodule honor -c credential.* from command lineJacob Keller, Feb 26, 2016
  6. Jeff KingFeb 26, 2016
  7. Jacob KellerFeb 26, 2016
  8. Jacob KellerFeb 27, 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.