On May 15, 2017, at 4:16 PM, Thomas <tho...@dateiliste.com> wrote:
> 
> On 2017-05-15 23:09, Warren Young wrote:
>> On May 15, 2017, at 3:27 PM, Thomas <tho...@dateiliste.com> wrote:
>>> 
>>> Does it really matter in the 21st century if a line is terminated by CR, 
>>> LF, or CR/LF anymore?
>> 
>> Notepad.exe
> 
> So, after editing a file that belongs to your project with Notepad on 
> Windows, would you expect an SCM complaining about it when you commit?

If I knew I was building a project where the *.txt files needed to be readable 
on all common platforms, including Windows, I’d save them with CRLF line 
endings and add a *.txt line in .fossil-settings/crlf-glob.  That way, the text 
editors on Linux, macOS, and such won’t molest the CRLF endings, and if the 
Windows-based end users of the project haven’t associated something decent with 
*.txt, they’ll see the file as-intended and their text editor will save the 
file back out with CRLF, which is fine.

This policy means you can save most every other text file in the project with 
LF line endings since those are probably only associated with decent text 
editors on Windows (e.g. *.c, *.md, *.xml…) so those line endings won’t be 
molested, either.

The core of this philosophy is to cause the files in the repository to obey the 
principle of least surprise, with the burden of understanding what’s going on 
being placed on the person(s) maintaining the repository.

The alternative, where Fossil just tries to do magic but dumps a burden on the 
end users of the repository when the heuristics fail is fundamentally 
backwards.  It burdens the masses for the sake of the few.

Maybe you’d like to explain how the line endings got screwed up in your 
project?  
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to