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

Re: [msysGit] Re: Git for Windows and line endings

From
John Szakmeister <john@szakmeister.net>
Date
Oct 19, 2012, 21:53 UTC
Message-ID
<CAEBDL5UX+bT5eSf4_QxfcOgwH0Vtco43rM78HKUJTr75uUXhFA@mail.gmail.com>
In-Reply-To
<CADKp0pxuFsSEeZoeemyaqhSJEcsjj1arEOsF4Ub8=76y7tkwHg@mail.gmail.com>

On Fri, Oct 19, 2012 at 10:39 AM, Chris B <chris.blaszczynski@gmail.com> wrote: [snip]

> - Windows has been able to cope with UNIX line endings a long time; no
> developer is using a default Notepad to open files with high
> expectations. Any Windows development tool and editor worth anything
> I've used is able to handle both just fine.

That's simply not a true, across the board statement. I really wish it was, because I find the issue troublesome as well. Unfortunately, there are still plenty of applications that don't cope with mixed line endings very well. We have a backend that targets several platforms, and the Windows toolchain is quite keen on having CRLF endings, but we like LF under Linux, and others.

I also wish that no developers were using Notepad either. Any time I've run across it, I've tried to point folks at much more capable environments... but that only has moderate success. Of course, it's even worse these days because Notepad puts a BOM at the front of the file, making Git think it's a binary file.

One thing I do wish is that I didn't have to do the song and dance to convert all the files when I set gitattributes:

    $ echo "* text=auto" >>.gitattributes
    $ rm .git/index     # Remove the index to force git to
    $ git reset         # re-scan the working directory
    $ git status        # Show files that will be normalized
    $ git add -u
    $ git add .gitattributes
    $ git commit -m "Introduce end-of-line normalization"

One thing that I like about Subversion was that when you set svn:eol-style, it took.

-John
Previous: Jeff KingNext: Raja R Harinath
Message 7 of 8 in “Git for Windows and line endings”
  1. Chris BOct 18, 2012
  2. Erik Faye-LundOct 18, 2012
  3. Johannes SchindelinOct 19, 2012
  4. Chris BOct 19, 2012
  5. Junio C HamanoOct 19, 2012
  6. Jeff KingOct 19, 2012
  7. John SzakmeisterOct 19, 2012
  8. Raja R HarinathNov 4, 2012

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.