{"thread":{"id":"25462","subject":"[PATCH] t0003: properly quote $HOME","startedAt":"2010-10-17T19:13:53Z","lastAt":"2010-10-18T19:15:30Z","messageCount":8,"participants":["Thomas Rast","Jonathan Nieder","Matthieu Moy","Johannes Sixt","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"153671","messageId":"decc39532e1706c50964bad14c51d0bcd9ab09a6.1287342744.git.trast@student.ethz.ch","threadId":"25462","inReplyTo":null,"subject":"[PATCH] t0003: properly quote $HOME","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-10-17T19:13:53Z","receivedAt":"2010-10-17T19:13:53Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"6df42ab (Add global and system-wide gitattributes, 2010-09-01) forgot\nto quote one instance of $HOME in the tests.  This broke the test for\nme with the shell complaining about an ambiguous redirect (but only\nwhen run with --root for some reason).\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n t/t0003-attributes.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh\nindex 25205ac..e75153b 100755\n--- a/t/t0003-attributes.sh\n+++ b/t/t0003-attributes.sh\n@@ -38,7 +38,7 @@ test_expect_success 'setup' '\n \t) >a/b/.gitattributes\n \t(\n \t\techo \"global test=global\"\n-\t) >$HOME/global-gitattributes\n+\t) >\"$HOME\"/global-gitattributes\n \n '\n \n-- \n1.7.3.1.266.g3c065\n"},{"id":"153672","messageId":"20101017191827.GD3202@burratino","threadId":"25462","inReplyTo":"decc39532e1706c50964bad14c51d0bcd9ab09a6.1287342744.git.trast@student.ethz.ch","subject":"Re: [PATCH] t0003: properly quote $HOME","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-17T19:18:27Z","receivedAt":"2010-10-17T19:18:27Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Thomas Rast wrote:\n\n> 6df42ab (Add global and system-wide gitattributes, 2010-09-01) forgot\n> to quote one instance of $HOME in the tests.  This broke the test for\n> me with the shell complaining about an ambiguous redirect (but only\n> when run with --root for some reason).\n\nThanks.  What shell do you use?\n\nIIRC it is not ambiguous according to POSIX but since e.g. OpenBSD\ncomplains it is worth fixing.\n"},{"id":"153676","messageId":"201010172134.43983.trast@student.ethz.ch","threadId":"25462","inReplyTo":"20101017191827.GD3202@burratino","subject":"Re: [PATCH] t0003: properly quote $HOME","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-10-17T19:34:43Z","receivedAt":"2010-10-17T19:34:43Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Jonathan Nieder wrote:\n> Thomas Rast wrote:\n> \n> > 6df42ab (Add global and system-wide gitattributes, 2010-09-01) forgot\n> > to quote one instance of $HOME in the tests.  This broke the test for\n> > me with the shell complaining about an ambiguous redirect (but only\n> > when run with --root for some reason).\n> \n> Thanks.  What shell do you use?\n> \n> IIRC it is not ambiguous according to POSIX but since e.g. OpenBSD\n> complains it is worth fixing.\n\nOh, huh, so much for the theory that it's --root causing it:\n\n  $ sh ./t0003-attributes.sh -q\n  # passed all 8 test(s)\n  1..8\n  $ dash ./t0003-attributes.sh -q\n  # passed all 8 test(s)\n  1..8\n  $ bash ./t0003-attributes.sh -q\n  not ok - 1 setup\n[...]\n  $ bash --version\n  GNU bash, version 4.1.7(1)-release (x86_64-suse-linux-gnu)\n[...]\n\nThen again, so much for your theory that it's only OpenBSD... ;-)\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"153677","messageId":"vpqiq10a9vu.fsf@bauges.imag.fr","threadId":"25462","inReplyTo":"decc39532e1706c50964bad14c51d0bcd9ab09a6.1287342744.git.trast@student.ethz.ch","subject":"Re: [PATCH] t0003: properly quote $HOME","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-10-17T19:37:25Z","receivedAt":"2010-10-17T19:37:25Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Thomas Rast <trast@student.ethz.ch> writes:\n\n> 6df42ab (Add global and system-wide gitattributes, 2010-09-01) forgot\n> to quote one instance of $HOME in the tests.  This broke the test for\n> me with the shell complaining about an ambiguous redirect (but only\n> when run with --root for some reason).\n\nMy bad, sorry. ACK for the fix.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"153680","messageId":"201010172303.58780.j6t@kdbg.org","threadId":"25462","inReplyTo":"decc39532e1706c50964bad14c51d0bcd9ab09a6.1287342744.git.trast@student.ethz.ch","subject":"Re: [PATCH] t0003: properly quote $HOME","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2010-10-17T21:03:58Z","receivedAt":"2010-10-17T21:03:58Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"On Sonntag, 17. Oktober 2010, Thomas Rast wrote:\n> 6df42ab (Add global and system-wide gitattributes, 2010-09-01) forgot\n> to quote one instance of $HOME in the tests.  This broke the test for\n> me with the shell complaining about an ambiguous redirect (but only\n> when run with --root for some reason).\n>\n> Signed-off-by: Thomas Rast <trast@student.ethz.ch>\n> ---\n>  t/t0003-attributes.sh |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh\n> index 25205ac..e75153b 100755\n> --- a/t/t0003-attributes.sh\n> +++ b/t/t0003-attributes.sh\n> @@ -38,7 +38,7 @@ test_expect_success 'setup' '\n>  \t) >a/b/.gitattributes\n>  \t(\n>  \t\techo \"global test=global\"\n> -\t) >$HOME/global-gitattributes\n> +\t) >\"$HOME\"/global-gitattributes\n>\n>  '\n\nFWIW, the failure is due to bash trying to be helpful. Variable expansions \nafter redirections are not word-split, but bash incorrectly detects \nan \"ambiguous redirect\" if the expanded text contains IFS characters. Your \nfix is of course the right way to work it around. But you might update the \ncommit message.\n\n-- Hannes\n"},{"id":"153702","messageId":"b280c19ddc25f2f3a76d1871ed79906663daa802.1287392872.git.trast@student.ethz.ch","threadId":"25462","inReplyTo":"201010172134.43983.trast@student.ethz.ch","subject":"[PATCH v2] t0003: properly quote $HOME","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-10-18T09:09:54Z","receivedAt":"2010-10-18T09:09:54Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"6df42ab (Add global and system-wide gitattributes, 2010-09-01) forgot\nto quote one instance of $HOME in the tests.  This would be valid\naccording to POSIX, but bash 4 helpfully declines to execute the\ncommand in question with an \"ambiguous redirection\" error.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nChanged the commit message to state the actual reason.\n\n t/t0003-attributes.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh\nindex 25205ac..e75153b 100755\n--- a/t/t0003-attributes.sh\n+++ b/t/t0003-attributes.sh\n@@ -38,7 +38,7 @@ test_expect_success 'setup' '\n \t) >a/b/.gitattributes\n \t(\n \t\techo \"global test=global\"\n-\t) >$HOME/global-gitattributes\n+\t) >\"$HOME\"/global-gitattributes\n \n '\n \n-- \n1.7.3.1.270.gbc760\n"},{"id":"153708","messageId":"20101018100237.GB5641@burratino","threadId":"25462","inReplyTo":"b280c19ddc25f2f3a76d1871ed79906663daa802.1287392872.git.trast@student.ethz.ch","subject":"Re: [PATCH v2] t0003: properly quote $HOME","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-18T10:02:37Z","receivedAt":"2010-10-18T10:02:37Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Thomas Rast wrote:\n\n>                                               This would be valid\n> according to POSIX, but bash 4 helpfully declines to execute the\n> command in question with an \"ambiguous redirection\" error.\n\nFor the benefit of those wondering why they never saw this problem,\neven after using bash for a while: bash in POSIX mode (e.g. when\nrunning as \"sh\") does not have the same problem.\n\nPresumably that's why this problem was not noticed until on a platform\nwithout bash as /bin/sh, in v1.7.0-rc1~30 (work around an obnoxious\nbash \"safety feature\" on OpenBSD, 2010-01-26).\n\nI still like the patch. :)\n"},{"id":"153742","messageId":"7veibn48j1.fsf@alter.siamese.dyndns.org","threadId":"25462","inReplyTo":"decc39532e1706c50964bad14c51d0bcd9ab09a6.1287342744.git.trast@student.ethz.ch","subject":"Re: [PATCH] t0003: properly quote $HOME","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-18T19:15:30Z","receivedAt":"2010-10-18T19:15:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Rast <trast@student.ethz.ch> writes:\n\n> 6df42ab (Add global and system-wide gitattributes, 2010-09-01) forgot\n> to quote one instance of $HOME in the tests.  This broke the test for\n> me with the shell complaining about an ambiguous redirect (but only\n> when run with --root for some reason).\n\nSounds like a similar breakage to what was fixed in 3fa7c3d (work around\nan obnoxious bash \"safety feature\" on OpenBSD, 2010-01-26) to me.\n\nThanks.\n"}]}