From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: git@vger.kernel.org, sunshine@sunshineco.com, peff@peff.net,
gitster@pobox.com
Subject: Re: [PATCH] test doc: test_write_lines does not split its arguments
Date: Tue, 6 May 2014 21:20:51 +0300 [thread overview]
Message-ID: <20140506182051.GA10333@redhat.com> (raw)
In-Reply-To: <20140505235143.GU9218@google.com>
On Mon, May 05, 2014 at 04:51:43PM -0700, Jonathan Nieder wrote:
> test_write_lines carefully quotes its arguments as "$@", so
>
> test_write_lines "a b" c
>
> writes two lines as requested, not three.
>
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> Hi,
>
> Michael S. Tsirkin wrote:
>
> > +++ b/t/README
> > @@ -596,6 +596,28 @@ library for your script to use.
> > + test_write_lines "a b c d e f g" >foo
> > +
> > + Is a more compact equivalent of:
> > + cat >foo <<-EOF
> > + a
> > + b
> [...]
> > +++ b/t/test-lib-functions.sh
> > @@ -717,6 +717,11 @@ test_ln_s_add () {
> > fi
> > }
> >
> > +# This function writes out its parameters, one per line
> > +test_write_lines () {
> > + printf "%s\n" "$@"
> > +}
>
> How about this patch?
>
> Thanks,
> Jonathan
>
> t/README | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/t/README b/t/README
> index 2d6232f..8a9d499 100644
> --- a/t/README
> +++ b/t/README
> @@ -596,15 +596,14 @@ library for your script to use.
> ...
> '
>
> - - test_write_lines <text>
> + - test_write_lines <lines>
>
> - Split <text> to white-space separated words and write it out on standard
> - output, one word per line.
> + Write <lines> on standard output, one line per argument.
> Useful to prepare multi-line files in a compact form.
>
> Example:
>
> - test_write_lines "a b c d e f g" >foo
> + test_write_lines a b c d e f g >foo
>
> Is a more compact equivalent of:
> cat >foo <<-EOF
> --
> 1.9.1.423.g4596e3a
next prev parent reply other threads:[~2014-05-06 18:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-27 18:15 [PATCH v6 1/5] patch-id: make it stable against hunk reordering Michael S. Tsirkin
2014-04-27 18:15 ` [PATCH v6 2/5] test: add test_write_lines helper Michael S. Tsirkin
2014-05-05 23:51 ` [PATCH] test doc: test_write_lines does not split its arguments Jonathan Nieder
2014-05-06 18:20 ` Michael S. Tsirkin [this message]
2014-04-27 18:15 ` [PATCH v6 3/5] patch-id-test: test stable and unstable behaviour Michael S. Tsirkin
2014-04-27 18:15 ` [PATCH v6 4/5] patch-id: change default to stable Michael S. Tsirkin
2014-04-27 18:15 ` [PATCH v6 5/5] t4204-patch-id.sh: default is now stable Michael S. Tsirkin
2014-04-29 21:45 ` [PATCH v6 1/5] patch-id: make it stable against hunk reordering Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140506182051.GA10333@redhat.com \
--to=mst@redhat.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
--cc=peff@peff.net \
--cc=sunshine@sunshineco.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.
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 NNTP newsgroup(s).