{"thread":{"id":"26065","subject":"[PATCH 11/14] t3032-*.sh: Pass the -b (--binary) option to sed on cygwin","startedAt":"2010-12-14T18:34:29Z","lastAt":"2010-12-18T20:16:37Z","messageCount":8,"participants":["Ramsay Jones","Junio C Hamano","Eric Sunshine","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":14},"messages":[{"id":"158077","messageId":"4D07B8B5.2030409@ramsay1.demon.co.uk","threadId":"26065","inReplyTo":null,"subject":"[PATCH 11/14] t3032-*.sh: Pass the -b (--binary) option to sed on cygwin","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2010-12-14T18:34:29Z","receivedAt":"2010-12-14T18:34:29Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nThe test using the conflict_hunks helper function (test 9) fails\non cygwin, since sed (by default) throws away the CR from CRLF\nline endings. This behaviour is undesirable, since the validation\ncode expects the CRLF line-ending to be present. In order to fix\nthe problem we pass the -b (--binary) option to sed, using the\nSED_OPTIONS variable. We use the SED_STRIPS_CR prerequisite in the\nconditional initialisation of SED_OPTIONS.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nNote that this test does not fail on MinGW, but I don't\nreally know why, given commit ca02ad3... ahem ;-)\n\n t/t3032-merge-recursive-options.sh |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t3032-merge-recursive-options.sh b/t/t3032-merge-recursive-options.sh\nindex 2293797..f70f6c4 100755\n--- a/t/t3032-merge-recursive-options.sh\n+++ b/t/t3032-merge-recursive-options.sh\n@@ -13,9 +13,11 @@ test_description='merge-recursive options\n \n . ./test-lib.sh\n \n+test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b\n+\n test_expect_success 'setup' '\n \tconflict_hunks () {\n-\t\tsed -n -e \"\n+\t\tsed $SED_OPTIONS -n -e \"\n \t\t\t/^<<<</ b inconflict\n \t\t\tb\n \t\t\t: inconflict\n-- \n1.7.3\n"},{"id":"158083","messageId":"7vtyigtaxn.fsf@alter.siamese.dyndns.org","threadId":"26065","inReplyTo":"4D07B8B5.2030409@ramsay1.demon.co.uk","subject":"Re: [PATCH 11/14] t3032-*.sh: Pass the -b (--binary) option to sed on cygwin","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-12-14T19:24:20Z","receivedAt":"2010-12-14T19:24:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n\n> The test using the conflict_hunks helper function (test 9) fails\n> on cygwin, since sed (by default) throws away the CR from CRLF\n> line endings. This behaviour is undesirable, since the validation\n> code expects the CRLF line-ending to be present. In order to fix\n> the problem we pass the -b (--binary) option to sed, using the\n> SED_OPTIONS variable. We use the SED_STRIPS_CR prerequisite in the\n> conditional initialisation of SED_OPTIONS.\n>\n> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n> ---\n>\n> Note that this test does not fail on MinGW, but I don't\n> really know why, given commit ca02ad3... ahem ;-)\n\nAhem, indeed.  Why?\n"},{"id":"158123","messageId":"4D07FE91.2090003@sunshineco.com","threadId":"26065","inReplyTo":"7vtyigtaxn.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 11/14] t3032-*.sh: Pass the -b (--binary) option to sed on cygwin","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2010-12-14T23:32:33Z","receivedAt":"2010-12-14T23:32:33Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On 12/14/2010 2:24 PM, Junio C Hamano wrote:\n> Ramsay Jones<ramsay@ramsay1.demon.co.uk>  writes:\n>> The test using the conflict_hunks helper function (test 9) fails\n>> on cygwin, since sed (by default) throws away the CR from CRLF\n>> line endings. This behaviour is undesirable, since the validation\n>> code expects the CRLF line-ending to be present. In order to fix\n>> the problem we pass the -b (--binary) option to sed, using the\n>> SED_OPTIONS variable. We use the SED_STRIPS_CR prerequisite in the\n>> conditional initialisation of SED_OPTIONS.\n>>\n>> Signed-off-by: Ramsay Jones<ramsay@ramsay1.demon.co.uk>\n>> ---\n>>\n>> Note that this test does not fail on MinGW, but I don't\n>> really know why, given commit ca02ad3... ahem ;-)\n>\n> Ahem, indeed.  Why?\n\nt3032 does indeed fail on MinGW, and was fixed in the msysgit port by \n[1], but was subsequently \"lost\" when msysgit was rebased onto \njunio/next [2] which did not have that test. Consequently, the fix never \nmade it into the mainline git source.\n\n[1]: \nhttp://groups.google.com/group/msysgit/browse_thread/thread/587d32ee034b0cbe/dca93dc6ad755012#dca93dc6ad755012\n[2]: \nhttp://groups.google.com/group/msysgit/browse_thread/thread/d522ec5c13a3af0b/718eaedffc042fb5#718eaedffc042fb5\n\n-- ES\n"},{"id":"158145","messageId":"4D087AC7.2090705@viscovery.net","threadId":"26065","inReplyTo":"4D07FE91.2090003@sunshineco.com","subject":"Re: [PATCH 11/14] t3032-*.sh: Pass the -b (--binary) option to sed on cygwin","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-12-15T08:22:31Z","receivedAt":"2010-12-15T08:22:31Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 12/15/2010 0:32, schrieb Eric Sunshine:\n> On 12/14/2010 2:24 PM, Junio C Hamano wrote:\n>> Ramsay Jones<ramsay@ramsay1.demon.co.uk>  writes:\n>>> The test using the conflict_hunks helper function (test 9) fails\n>>> on cygwin, since sed (by default) throws away the CR from CRLF\n>>> line endings. This behaviour is undesirable, since the validation\n>>> code expects the CRLF line-ending to be present. In order to fix\n>>> the problem we pass the -b (--binary) option to sed, using the\n>>> SED_OPTIONS variable. We use the SED_STRIPS_CR prerequisite in the\n>>> conditional initialisation of SED_OPTIONS.\n>>>\n>>> Signed-off-by: Ramsay Jones<ramsay@ramsay1.demon.co.uk>\n>>> ---\n>>>\n>>> Note that this test does not fail on MinGW, but I don't\n>>> really know why, given commit ca02ad3... ahem ;-)\n>>\n>> Ahem, indeed.  Why?\n> \n> t3032 does indeed fail on MinGW, and was fixed in the msysgit port by [1],\n> but was subsequently \"lost\" when msysgit was rebased onto junio/next [2]\n> which did not have that test. Consequently, the fix never made it into the\n> mainline git source.\n\nSorry, but on MinGW, I only need the GREP_OPTIONS part of that fix, but\nnot the SED_OPTIONS. It's also mysterious for me.\n\nOTOH, the fix in ca02ad3 that applies to t6038, does not work for me as is\nbecause my sed does not understand -b; it needs --nocr. Maybe it is the\nsed version that makes the difference?\n\nD:\\Src\\mingw-git\\t>sed --version\nGNU sed version 3.02\n...\n\n-- Hannes\n"},{"id":"158153","messageId":"4D088AB6.5090501@sunshineco.com","threadId":"26065","inReplyTo":"4D087AC7.2090705@viscovery.net","subject":"Re: [PATCH 11/14] t3032-*.sh: Pass the -b (--binary) option to sed on cygwin","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2010-12-15T09:30:30Z","receivedAt":"2010-12-15T09:30:30Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On 12/15/2010 3:22 AM, Johannes Sixt wrote:\n> Am 12/15/2010 0:32, schrieb Eric Sunshine:\n>> On 12/14/2010 2:24 PM, Junio C Hamano wrote:\n>>> Ramsay Jones<ramsay@ramsay1.demon.co.uk>   writes:\n>>>> The test using the conflict_hunks helper function (test 9) fails\n>>>> on cygwin, since sed (by default) throws away the CR from CRLF\n>>>> line endings. This behaviour is undesirable, since the validation\n>>>> code expects the CRLF line-ending to be present. In order to fix\n>>>> the problem we pass the -b (--binary) option to sed, using the\n>>>> SED_OPTIONS variable. We use the SED_STRIPS_CR prerequisite in the\n>>>> conditional initialisation of SED_OPTIONS.\n>>>>\n>>>> Signed-off-by: Ramsay Jones<ramsay@ramsay1.demon.co.uk>\n>>>> ---\n>>>>\n>>>> Note that this test does not fail on MinGW, but I don't\n>>>> really know why, given commit ca02ad3... ahem ;-)\n>>>\n>>> Ahem, indeed.  Why?\n>>\n>> t3032 does indeed fail on MinGW, and was fixed in the msysgit port by [1],\n>> but was subsequently \"lost\" when msysgit was rebased onto junio/next [2]\n>> which did not have that test. Consequently, the fix never made it into the\n>> mainline git source.\n>\n> Sorry, but on MinGW, I only need the GREP_OPTIONS part of that fix, but\n> not the SED_OPTIONS. It's also mysterious for me.\n>\n> OTOH, the fix in ca02ad3 that applies to t6038, does not work for me as is\n> because my sed does not understand -b; it needs --nocr. Maybe it is the\n> sed version that makes the difference?\n>\n> D:\\Src\\mingw-git\\t>sed --version\n> GNU sed version 3.02\n\nFailure of t3032 was reported by Pat Thoyts [1] when preparing for the \nv1.7.3 release. The problem was diagnosed and patched via [2] under the \nstandard msysgit netinstall [3] environment. From commit message [2], \nGREP_OPTIONS and SED_OPTIONS were applied to resolve distinct cases of \nline-terminator \"corruption\" (t3032.4-t3032.8 and t3032.9, respectively) \nwithin that environment at the time the patch was prepared.\n\nYour tool versions may indeed not be compatible with those of the \nnetinstall environment [3]:\n\n$ sed --version\nGNU sed version 4.2.1\n\nUnfortunately, the old --nocr is not recognized by modern GNU sed:\n\n$ sed --nocr\nsed: unrecognized option `--nocr'\n\n[1]: \nhttp://groups.google.com/group/msysgit/browse_thread/thread/70110298ae72caea/a39b121bb0feccf4?lnk=gst&q=t3032#a39b121bb0feccf4\n[2]: \nhttp://groups.google.com/group/msysgit/browse_thread/thread/587d32ee034b0cbe/dca93dc6ad755012#dca93dc6ad755012\n[3]: http://code.google.com/p/msysgit/downloads/list \n[msysGit-netinstall-1.7.3.1-preview20101002.exe]\n\n-- ES\n"},{"id":"158235","messageId":"4D0A8250.5090403@ramsay1.demon.co.uk","threadId":"26065","inReplyTo":"4D088AB6.5090501@sunshineco.com","subject":"Re: [PATCH 11/14] t3032-*.sh: Pass the -b (--binary) option to sed on cygwin","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2010-12-16T21:19:12Z","receivedAt":"2010-12-16T21:19:12Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Eric Sunshine wrote:\n> On 12/15/2010 3:22 AM, Johannes Sixt wrote:\n>> Am 12/15/2010 0:32, schrieb Eric Sunshine:\n>>> On 12/14/2010 2:24 PM, Junio C Hamano wrote:\n>>>> Ramsay Jones<ramsay@ramsay1.demon.co.uk>   writes:\n>>>>> The test using the conflict_hunks helper function (test 9) fails\n>>>>> on cygwin, since sed (by default) throws away the CR from CRLF\n>>>>> line endings. This behaviour is undesirable, since the validation\n>>>>> code expects the CRLF line-ending to be present. In order to fix\n>>>>> the problem we pass the -b (--binary) option to sed, using the\n>>>>> SED_OPTIONS variable. We use the SED_STRIPS_CR prerequisite in the\n>>>>> conditional initialisation of SED_OPTIONS.\n>>>>>\n>>>>> Signed-off-by: Ramsay Jones<ramsay@ramsay1.demon.co.uk>\n>>>>> ---\n>>>>>\n>>>>> Note that this test does not fail on MinGW, but I don't\n>>>>> really know why, given commit ca02ad3... ahem ;-)\n>>>> Ahem, indeed.  Why?\n>>> t3032 does indeed fail on MinGW, and was fixed in the msysgit port by [1],\n>>> but was subsequently \"lost\" when msysgit was rebased onto junio/next [2]\n>>> which did not have that test. Consequently, the fix never made it into the\n>>> mainline git source.\n>> Sorry, but on MinGW, I only need the GREP_OPTIONS part of that fix, but\n>> not the SED_OPTIONS. It's also mysterious for me.\n>>\n>> OTOH, the fix in ca02ad3 that applies to t6038, does not work for me as is\n>> because my sed does not understand -b; it needs --nocr. Maybe it is the\n>> sed version that makes the difference?\n>>\n>> D:\\Src\\mingw-git\\t>sed --version\n>> GNU sed version 3.02\n> \n> Failure of t3032 was reported by Pat Thoyts [1] when preparing for the \n> v1.7.3 release. The problem was diagnosed and patched via [2] under the \n> standard msysgit netinstall [3] environment. From commit message [2], \n> GREP_OPTIONS and SED_OPTIONS were applied to resolve distinct cases of \n> line-terminator \"corruption\" (t3032.4-t3032.8 and t3032.9, respectively) \n> within that environment at the time the patch was prepared.\n> \n> Your tool versions may indeed not be compatible with those of the \n> netinstall environment [3]:\n> \n> $ sed --version\n> GNU sed version 4.2.1\n> \n> Unfortunately, the old --nocr is not recognized by modern GNU sed:\n> \n> $ sed --nocr\n> sed: unrecognized option `--nocr'\n\nYes. Like Johannes, I have sed version 3.02 on MinGW, but on cygwin\nI have sed version 4.1.5. See patch #14, where I introduce the\nSED_BIN_OPT variable to allow me to run the tests with SED_OPTIONS\nset to -c instead of -b.\n\n[I thought I was unusual in having such an old sed version, but\napparently not... ;-) ]\n\nATB,\nRamsay Jones\n"},{"id":"158268","messageId":"4D0B126A.8080702@viscovery.net","threadId":"26065","inReplyTo":"4D0A8250.5090403@ramsay1.demon.co.uk","subject":"Re: [PATCH 11/14] t3032-*.sh: Pass the -b (--binary) option to sed on cygwin","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-12-17T07:34:02Z","receivedAt":"2010-12-17T07:34:02Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 12/16/2010 22:19, schrieb Ramsay Jones:\n> Eric Sunshine wrote:\n>> Your tool versions may indeed not be compatible with those of the \n>> netinstall environment [3]:\n>>\n>> $ sed --version\n>> GNU sed version 4.2.1\n>>\n>> Unfortunately, the old --nocr is not recognized by modern GNU sed:\n>>\n>> $ sed --nocr\n>> sed: unrecognized option `--nocr'\n> \n> Yes. Like Johannes, I have sed version 3.02 on MinGW, but on cygwin\n> I have sed version 4.1.5. See patch #14, where I introduce the\n> SED_BIN_OPT variable to allow me to run the tests with SED_OPTIONS\n> set to -c instead of -b.\n> \n> [I thought I was unusual in having such an old sed version, but\n> apparently not... ;-) ]\n\nAs far as I'm concerned, I'm not married to this old version, and I'll\nupdate to a recent msysgit/MinGW environment RSN. So, in the long run,\nyour setup might turn out to be unusal ;-)\n\n-- Hannes\n"},{"id":"158343","messageId":"4D0D16A5.1010406@ramsay1.demon.co.uk","threadId":"26065","inReplyTo":"4D0B126A.8080702@viscovery.net","subject":"Re: [PATCH 11/14] t3032-*.sh: Pass the -b (--binary) option to sed on cygwin","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2010-12-18T20:16:37Z","receivedAt":"2010-12-18T20:16:37Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Johannes Sixt wrote:\n>> [I thought I was unusual in having such an old sed version, but\n>> apparently not... ;-) ]\n> \n> As far as I'm concerned, I'm not married to this old version, and I'll\n> update to a recent msysgit/MinGW environment RSN. So, in the long run,\n> your setup might turn out to be unusal ;-)\n\nYeah, I've been meaning to upgrade too. (However, I've been saying that\nfor quite some time now!)\n\n[I had to install the Perl CGI module by hand to get one test to run.\n(There is something funny going on with the Config, ExtUtils and Test\nmodules as well!)]\n\nATB,\nRamsay Jones\n"}]}