git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Jacob Keller <jacob.e.keller@intel.com>
Cc: git@vger.kernel.org, Mark Strapetz <marc.strapetz@syntevo.com>,
	Stefan Beller <sbeller@google.com>,
	Junio C Hamano <gitster@pobox.com>,
	Jacob Keller <jacob.keller@gmail.com>
Subject: Re: [PATCH v4 3/3] git: submodule honor -c credential.* from command line
Date: Fri, 26 Feb 2016 17:05:54 -0500	[thread overview]
Message-ID: <20160226220553.GA1835@sigill.intra.peff.net> (raw)
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:

> +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

  reply	other threads:[~2016-02-26 22:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 19:18 [PATCH v4 1/3] t/lib-httpd: load mod_unixd Jacob Keller
2016-02-26 19:18 ` [PATCH v4 2/3] sumodule--helper: fix submodule--helper clone usage and check argc count Jacob Keller
2016-02-26 19:31   ` Stefan Beller
2016-02-26 22:08     ` Jacob Keller
2016-02-26 19:18 ` [PATCH v4 3/3] git: submodule honor -c credential.* from command line Jacob Keller
2016-02-26 22:05   ` Jeff King [this message]
2016-02-26 22:20     ` Jacob Keller
2016-02-27  0:01       ` Jacob Keller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160226220553.GA1835@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jacob.e.keller@intel.com \
    --cc=jacob.keller@gmail.com \
    --cc=marc.strapetz@syntevo.com \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).