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

fast-import problem importing dos format files under cygwin

From
JHJan Hudec <bulb@ucw.cz>
Date
Dec 3, 2008, 07:51 UTC
Message-ID
<43827.194.138.12.144.1228290700.squirrel@artax.karlin.mff.cuni.cz>
Hello folks,

I have been playing with fast-import in cygwin and I have problems importing files with CR/LF line-endings. The size in data command is calculated including the CRs and than the file is copied binary to the fast-import input stream. However fast-import skips the CRs when reading, overreads by that number of bytes and fails when it tries to read the next command from the middle.

Attached is a test input stream and crash report generated by fast-import when reading it. In case mail system damages it along the way despite being attached to prevent that, the file should be in unix format -- that is what my cygwin perl outputs by default -- and has CRs only on lines 15 and 16. The unix.txt and dos.txt should only differ that the '.'s in former are replaced by '^M's in the later (so the data commands are otherwise same).

Note, that when I convert the file to dos format, it is read as intended. However, that is inconsistent with rest of the cygwin environment which generated and expects files in unix format. I use binary mounts (not converting) and CYGWIN environment variable is empty. My git version is 1.6.0.4 from official Cygwin package.

Is this behaviour intentional workaround for something or a bug?
-- 
                                        - Jan Hudec <bulb@ucw.cz>
Next: Jan Hudec
Message 1 of 7 in “fast-import problem importing dos format files under cygwin”
  1. Jan HudecDec 3, 2008
  2. Ad: fast-import problem importing dos format files under cygwinJan Hudec, Dec 3, 2008
  3. Johannes SixtDec 3, 2008
  4. Jan HudecDec 3, 2008
  5. Shawn O. PearceDec 3, 2008
  6. Johannes SchindelinDec 3, 2008
  7. Jan HudecDec 3, 2008

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.