{"thread":{"id":"33236","subject":"[PATCH jk/checkout-attribute-lookup] t2003: work around path mangling issue on Windows","startedAt":"2013-03-20T08:47:57Z","lastAt":"2013-03-21T06:46:45Z","messageCount":3,"participants":["Johannes Sixt","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"211728","messageId":"514977BD.6060604@viscovery.net","threadId":"33236","inReplyTo":null,"subject":"[PATCH jk/checkout-attribute-lookup] t2003: work around path mangling issue on Windows","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2013-03-20T08:47:57Z","receivedAt":"2013-03-20T08:47:57Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"From: Johannes Sixt <j6t@kdbg.org>\n\nMSYS bash considers the part \"/g\" in the sed expression \"s/./=/g\" as an\nabsolute path after an assignment, and mangles it to a C:/something\nstring. Do not attract bash's attention by avoiding the equals sign.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t2003-checkout-cache-mkdir.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t2003-checkout-cache-mkdir.sh b/t/t2003-checkout-cache-mkdir.sh\nindex 4c97468..ff163cf 100755\n--- a/t/t2003-checkout-cache-mkdir.sh\n+++ b/t/t2003-checkout-cache-mkdir.sh\n@@ -94,14 +94,14 @@ test_expect_success 'apply filter from working tree .gitattributes with --prefix\n \trm -fr path0 path1 path2 tmp* &&\n \tmkdir path1 &&\n \tmkdir tmp &&\n-\tgit config filter.replace-all.smudge \"sed -e s/./=/g\" &&\n+\tgit config filter.replace-all.smudge \"sed -e s/./,/g\" &&\n \tgit config filter.replace-all.clean cat &&\n \tgit config filter.replace-all.required true &&\n \techo \"file1 filter=replace-all\" >path1/.gitattributes &&\n \tgit checkout-index --prefix=tmp/ -f -a &&\n \techo frotz >expected &&\n \ttest_cmp expected tmp/path0 &&\n-\techo ====== >expected &&\n+\techo ,,,,,, >expected &&\n \ttest_cmp expected tmp/path1/file1\n '\n \n-- \n1.8.2.1433.g0074116\n"},{"id":"211767","messageId":"7vli9if159.fsf@alter.siamese.dyndns.org","threadId":"33236","inReplyTo":"514977BD.6060604@viscovery.net","subject":"Re: [PATCH jk/checkout-attribute-lookup] t2003: work around path mangling issue on Windows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-20T17:10:10Z","receivedAt":"2013-03-20T17:10:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n> From: Johannes Sixt <j6t@kdbg.org>\n>\n> MSYS bash considers the part \"/g\" in the sed expression \"s/./=/g\" as an\n> absolute path after an assignment, and mangles it to a C:/something\n> string. Do not attract bash's attention by avoiding the equals sign.\n\nIf this breakage is about path mangling, I suspect it may be cleaner\nto work it around by not using / as the pattern separator, e.g.\n\n\tsed -e s!.!=!g\n\nOr perhaps use SHELL_PATH to point at a more reasonable\nimplementation of shell that does not have such an idiocy?\n\n> Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n> ---\n>  t/t2003-checkout-cache-mkdir.sh | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/t/t2003-checkout-cache-mkdir.sh b/t/t2003-checkout-cache-mkdir.sh\n> index 4c97468..ff163cf 100755\n> --- a/t/t2003-checkout-cache-mkdir.sh\n> +++ b/t/t2003-checkout-cache-mkdir.sh\n> @@ -94,14 +94,14 @@ test_expect_success 'apply filter from working tree .gitattributes with --prefix\n>  \trm -fr path0 path1 path2 tmp* &&\n>  \tmkdir path1 &&\n>  \tmkdir tmp &&\n> -\tgit config filter.replace-all.smudge \"sed -e s/./=/g\" &&\n> +\tgit config filter.replace-all.smudge \"sed -e s/./,/g\" &&\n>  \tgit config filter.replace-all.clean cat &&\n>  \tgit config filter.replace-all.required true &&\n>  \techo \"file1 filter=replace-all\" >path1/.gitattributes &&\n>  \tgit checkout-index --prefix=tmp/ -f -a &&\n>  \techo frotz >expected &&\n>  \ttest_cmp expected tmp/path0 &&\n> -\techo ====== >expected &&\n> +\techo ,,,,,, >expected &&\n>  \ttest_cmp expected tmp/path1/file1\n>  '\n"},{"id":"211841","messageId":"514AACD5.3010106@viscovery.net","threadId":"33236","inReplyTo":"7vli9if159.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH jk/checkout-attribute-lookup] t2003: work around path mangling issue on Windows","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2013-03-21T06:46:45Z","receivedAt":"2013-03-21T06:46:45Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 3/20/2013 18:10, schrieb Junio C Hamano:\n> Johannes Sixt <j.sixt@viscovery.net> writes:\n> \n>> From: Johannes Sixt <j6t@kdbg.org>\n>>\n>> MSYS bash considers the part \"/g\" in the sed expression \"s/./=/g\" as an\n>> absolute path after an assignment, and mangles it to a C:/something\n>> string. Do not attract bash's attention by avoiding the equals sign.\n> \n> If this breakage is about path mangling, I suspect it may be cleaner\n> to work it around by not using / as the pattern separator, e.g.\n> \n> \tsed -e s!.!=!g\n\nHalf a year down the road you'd scratch your head why you were not using\n'/' as separator. As the replacement character is irrelevant here, it's\nbetter to exchange that. Therefore, I still prefer my version.\n\n> Or perhaps use SHELL_PATH to point at a more reasonable\n> implementation of shell that does not have such an idiocy?\n\nWell, POSIX and DOS paths look inherently different, particularly absolute\npaths. You can't write a reasonably portable shell script if the shell\ndoesn't help in some way.\n\nNot to mention that the supply of POSIX shells on Windows is inherently\nscarce.\n\n-- Hannes\n"}]}