top | item 43392071

(no title)

jxhdbd | 11 months ago

Have you tried using git with Windows clients?

There are so many random line conversions going on and the detection on what is a binary file is clearly broken.

I don't understand why the default would be anything but "commit the file as is"

discuss

order

layer8|11 months ago

> I don't understand why the default would be anything but "commit the file as is"

Because it’s not uncommon for dev tools on Windows to generate DOS line endings when modifying files (for example when adding an element to an XML configuration file, all line endings of the file may be converted when it is rewritten out from its parsed form), and if those where committed as-is, you’d get a lot of gratuitous changes in the commit and also complaints from the Unix users.

For Git, the important thing is to have a .gitattributes file in the repository with “* text=auto” in it (plus more specific settings as desired). The text/binary auto-detection works mostly fine.

kbolino|11 months ago

Up until just a few years ago, Notepad on Windows could not handle Unix-style line endings. It probably makes sense now to adopt the as-is convention, but for a while, it made more sense to convert when checking out, and then to prevent spurious diffs, convert back when committing.

hnlmorg|11 months ago

Line endings between windows and unix-like systems were so painful that when I started development on my shell scripting language, I wrote a bunch of code to all Linux to handle Windows files and visa versa.

Though this has nothing to do with FTP. I’d already abandoned that protocol by then.

IshKebab|11 months ago

Yes I have. For binary files it's never an issue because Git detects those and doesn't to line ending conversion.

And I agree "commit the file as-is" should be the default - what programming editor can't handle unix newlines?