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

Re: mingw, windows, crlf/lf, and git

From
Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Date
Feb 13, 2007, 21:58 UTC
Message-ID
<200702132258.20278.robin.rosenberg.lists@dewire.com>
In-Reply-To
<eqt40c$5ov$1@sea.gmane.org>
tisdag 13 februari 2007 20:36 skrev Mark Levedahl:
Show 30 quoted lines
> Alexander Litvinov wrote:
> 
> > ? ????????? ?? Tuesday 13 February 2007 16:06 Johannes Schindelin
> > ???????(a):
> >> Hi,
> >>
> >> On Tue, 13 Feb 2007, Alexander Litvinov wrote:
> >> > When I have file that was converted from dos to unix format (or from
> >> > unix to dos) git genereta big diff. But anyway, c++ compiler works well
> >> > with both formats and in this case I simply convert file to dos format
> >> > and git shows again nice diff. If unix format was commited to git I
> >> > simply change the format and commit that file again.
> >>
> >> That's awful!
> > If you are tring to build history that looks good - you are right this is
> > a terrible workflow.
> > 
> >> > The only trouble is the rebase, it does not like \r\n ending and othen
> >> > produce unexpected merge conflict. But I don't use rebse to othen to
> >> > realy investigate and try to solve the problem.
> >>
> >> Well, if everybody thinks like you, maybe we do not have to change
> >> anything for Windows after all?
> > I still wish to have working rebase so if git will hanle somehow \r\n it
> > would be nice. But please do not produce the same behavior as cvs does:
> > under cygwin it still use \n !
> 
> Cygwin != Windows, Cygwin is a POSIX emulation layer with the explicit goal
> of providing user tools behaving exactly as they do under Linux, and this
> includes line ending style.

Line ending style is selectable in cygwin, both on a global level and path level (cygwin mounts). If you use CVS for windows development using CRLF works well and is the only option if you want to use the same working are with both native CVS clients like TortoiseCVS and the cygwin client. I use the CRLF style by default and LF only for selected directories. The only annoying thing I see is that files transformed by patch end up with LF-only line endings.

Show 6 quoted lines
> So, the Cygwin ports of various Linux tools are not expected to satisfy
> users who want native Win32 behavior. This is where the mingw port of git
> fits in. Yes, under Cygwin git can track files with \r\n endings, but: 
> 1) Those projects are not portable to non-windows platforms, and 
> 2) As you noted, git will have trouble with rebase, merge, etc. as there is
> an assumption of \n endings throughout.

Even if there is a native port, I'm inclined to want to use the cygwin version anyway because of the nice shell and scripting capabilities and large selection of packages that match what I'm used to in Linux. Git under cygwin should do CRLF transformations according to the same rules that apply to text files in cygwin.

-- robin
Previous: Linus TorvaldsNext: Mark Levedahl
Message 41 of 83 in “mingw, windows, crlf/lf, and git”
  1. Mark LevedahlFeb 11, 2007
  2. Johannes SchindelinFeb 11, 2007
  3. Jakub NarebskiFeb 12, 2007
  4. Mark LevedahlFeb 12, 2007
  5. Johannes SchindelinFeb 12, 2007
  6. Robin RosenbergFeb 12, 2007
  7. Mark LevedahlFeb 12, 2007
  8. Theodore TsoFeb 12, 2007
  9. David LangFeb 12, 2007
  10. Johannes SchindelinFeb 12, 2007
  11. Linus TorvaldsFeb 12, 2007
  12. Johannes SchindelinFeb 12, 2007
  13. Linus TorvaldsFeb 12, 2007
  14. Junio C HamanoFeb 12, 2007
  15. Junio C HamanoFeb 12, 2007
  16. Linus TorvaldsFeb 12, 2007
  17. Linus TorvaldsFeb 12, 2007
  18. David LangFeb 12, 2007
  19. Johannes SchindelinFeb 12, 2007
  20. Junio C HamanoFeb 12, 2007
  21. David LangFeb 12, 2007
  22. Johannes SchindelinFeb 12, 2007
  23. Mark LevedahlFeb 13, 2007
  24. Johannes SchindelinFeb 13, 2007
  25. Shawn O. PearceFeb 13, 2007
  26. David LangFeb 13, 2007
  27. Mark LevedahlFeb 13, 2007
  28. Jeff KingFeb 13, 2007
  29. Mark LevedahlFeb 13, 2007
  30. Junio C HamanoFeb 13, 2007
  31. Mark LevedahlFeb 13, 2007
  32. Junio C HamanoFeb 13, 2007
  33. Alexander LitvinovFeb 13, 2007
  34. Johannes SchindelinFeb 13, 2007
  35. Alexander LitvinovFeb 13, 2007
  36. Johannes SchindelinFeb 13, 2007
  37. Mark LevedahlFeb 13, 2007
  38. Linus TorvaldsFeb 13, 2007
  39. Mark LevedahlFeb 14, 2007
  40. Linus TorvaldsFeb 14, 2007
  41. Robin RosenbergFeb 13, 2007
  42. Mark LevedahlFeb 14, 2007
  43. Linus TorvaldsFeb 13, 2007
  44. Linus TorvaldsFeb 13, 2007
  45. Linus TorvaldsFeb 13, 2007
  46. Junio C HamanoFeb 13, 2007
  47. Linus TorvaldsFeb 13, 2007
  48. Sam RavnborgFeb 13, 2007
  49. Nicolas PitreFeb 13, 2007
  50. David LangFeb 13, 2007
  51. Linus TorvaldsFeb 13, 2007
  52. Sam RavnborgFeb 14, 2007
  53. Linus TorvaldsFeb 14, 2007
  54. Sam RavnborgFeb 14, 2007
  55. Alexander LitvinovFeb 14, 2007
  56. Junio C HamanoFeb 14, 2007
  57. Linus TorvaldsFeb 14, 2007
  58. Johannes SchindelinFeb 14, 2007
  59. Mark LevedahlFeb 14, 2007
  60. Linus TorvaldsFeb 14, 2007
  61. Junio C HamanoFeb 14, 2007
  62. Linus TorvaldsFeb 14, 2007
  63. Junio C HamanoFeb 14, 2007
  64. Linus TorvaldsFeb 14, 2007
  65. Johannes SchindelinFeb 14, 2007
  66. Linus TorvaldsFeb 14, 2007
  67. Mark LevedahlFeb 14, 2007
  68. Robin RosenbergFeb 14, 2007
  69. Linus TorvaldsFeb 14, 2007
  70. Robin RosenbergFeb 14, 2007
  71. Linus TorvaldsFeb 14, 2007
  72. Johannes SchindelinFeb 14, 2007
  73. Alexander LitvinovFeb 14, 2007
  74. Linus TorvaldsFeb 14, 2007
  75. Junio C HamanoFeb 14, 2007
  76. Johannes SixtFeb 14, 2007
  77. Linus TorvaldsFeb 14, 2007
  78. Johannes SchindelinFeb 13, 2007
  79. Nicolas PitreFeb 13, 2007
  80. Johannes SchindelinFeb 13, 2007
  81. Junio C HamanoFeb 13, 2007
  82. Linus TorvaldsFeb 13, 2007
  83. Johannes SchindelinFeb 13, 2007

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.