git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 11/14] t3032-*.sh: Pass the -b (--binary) option to sed on cygwin

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Dec 16, 2010, 21:19 UTC
Message-ID
<4D0A8250.5090403@ramsay1.demon.co.uk>
In-Reply-To
<4D088AB6.5090501@sunshineco.com>
Eric Sunshine wrote:
Show 49 quoted lines
> On 12/15/2010 3:22 AM, Johannes Sixt wrote:
>> Am 12/15/2010 0:32, schrieb Eric Sunshine:
>>> On 12/14/2010 2:24 PM, Junio C Hamano wrote:
>>>> Ramsay Jones<ramsay@ramsay1.demon.co.uk>   writes:
>>>>> The test using the conflict_hunks helper function (test 9) fails
>>>>> on cygwin, since sed (by default) throws away the CR from CRLF
>>>>> line endings. This behaviour is undesirable, since the validation
>>>>> code expects the CRLF line-ending to be present. In order to fix
>>>>> the problem we pass the -b (--binary) option to sed, using the
>>>>> SED_OPTIONS variable. We use the SED_STRIPS_CR prerequisite in the
>>>>> conditional initialisation of SED_OPTIONS.
>>>>>
>>>>> Signed-off-by: Ramsay Jones<ramsay@ramsay1.demon.co.uk>
>>>>> ---
>>>>>
>>>>> Note that this test does not fail on MinGW, but I don't
>>>>> really know why, given commit ca02ad3... ahem ;-)
>>>> Ahem, indeed.  Why?
>>> t3032 does indeed fail on MinGW, and was fixed in the msysgit port by [1],
>>> but was subsequently "lost" when msysgit was rebased onto junio/next [2]
>>> which did not have that test. Consequently, the fix never made it into the
>>> mainline git source.
>> Sorry, but on MinGW, I only need the GREP_OPTIONS part of that fix, but
>> not the SED_OPTIONS. It's also mysterious for me.
>>
>> OTOH, the fix in ca02ad3 that applies to t6038, does not work for me as is
>> because my sed does not understand -b; it needs --nocr. Maybe it is the
>> sed version that makes the difference?
>>
>> D:\Src\mingw-git\t>sed --version
>> GNU sed version 3.02
> 
> Failure of t3032 was reported by Pat Thoyts [1] when preparing for the 
> v1.7.3 release. The problem was diagnosed and patched via [2] under the 
> standard msysgit netinstall [3] environment. From commit message [2], 
> GREP_OPTIONS and SED_OPTIONS were applied to resolve distinct cases of 
> line-terminator "corruption" (t3032.4-t3032.8 and t3032.9, respectively) 
> within that environment at the time the patch was prepared.
> 
> Your tool versions may indeed not be compatible with those of the 
> netinstall environment [3]:
> 
> $ sed --version
> GNU sed version 4.2.1
> 
> Unfortunately, the old --nocr is not recognized by modern GNU sed:
> 
> $ sed --nocr
> sed: unrecognized option `--nocr'

Yes. Like Johannes, I have sed version 3.02 on MinGW, but on cygwin I have sed version 4.1.5. See patch #14, where I introduce the SED_BIN_OPT variable to allow me to run the tests with SED_OPTIONS set to -c instead of -b.

[I thought I was unusual in having such an old sed version, but apparently not... ;-) ]

ATB, Ramsay Jones

Previous: Eric SunshineNext: Johannes Sixt
Message 6 of 8 in “t3032-*.sh: Pass the -b (--binary) option to sed on cygwin”
  1. 11/14 t3032-*.sh: Pass the -b (--binary) option to sed on cygwinRamsay Jones, Dec 14, 2010
  2. Junio C HamanoDec 14, 2010
  3. Eric SunshineDec 14, 2010
  4. Johannes SixtDec 15, 2010
  5. Eric SunshineDec 15, 2010
  6. Ramsay JonesDec 16, 2010
  7. Johannes SixtDec 17, 2010
  8. Ramsay JonesDec 18, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.