All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Thomas Rast <trast@student.ethz.ch>
Cc: Junio C Hamano <gitster@pobox.com>,
	Petr Onderka <gsvick@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] t0003: properly quote $HOME
Date: Sun, 17 Oct 2010 23:03:58 +0200	[thread overview]
Message-ID: <201010172303.58780.j6t@kdbg.org> (raw)
In-Reply-To: <decc39532e1706c50964bad14c51d0bcd9ab09a6.1287342744.git.trast@student.ethz.ch>

On Sonntag, 17. Oktober 2010, Thomas Rast wrote:
> 6df42ab (Add global and system-wide gitattributes, 2010-09-01) forgot
> to quote one instance of $HOME in the tests.  This broke the test for
> me with the shell complaining about an ambiguous redirect (but only
> when run with --root for some reason).
>
> Signed-off-by: Thomas Rast <trast@student.ethz.ch>
> ---
>  t/t0003-attributes.sh |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh
> index 25205ac..e75153b 100755
> --- a/t/t0003-attributes.sh
> +++ b/t/t0003-attributes.sh
> @@ -38,7 +38,7 @@ test_expect_success 'setup' '
>  	) >a/b/.gitattributes
>  	(
>  		echo "global test=global"
> -	) >$HOME/global-gitattributes
> +	) >"$HOME"/global-gitattributes
>
>  '

FWIW, the failure is due to bash trying to be helpful. Variable expansions 
after redirections are not word-split, but bash incorrectly detects 
an "ambiguous redirect" if the expanded text contains IFS characters. Your 
fix is of course the right way to work it around. But you might update the 
commit message.

-- Hannes

  parent reply	other threads:[~2010-10-17 21:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-17 19:13 [PATCH] t0003: properly quote $HOME Thomas Rast
2010-10-17 19:18 ` Jonathan Nieder
2010-10-17 19:34   ` Thomas Rast
2010-10-18  9:09     ` [PATCH v2] " Thomas Rast
2010-10-18 10:02       ` Jonathan Nieder
2010-10-17 19:37 ` [PATCH] " Matthieu Moy
2010-10-17 21:03 ` Johannes Sixt [this message]
2010-10-18 19:15 ` 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=201010172303.58780.j6t@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=gsvick@gmail.com \
    --cc=trast@student.ethz.ch \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.