On 6/7/2014 12:32, Richard Hipp wrote:

On Sat, Jun 7, 2014 at 2:03 PM, <to...@acm.org <mailto:to...@acm.org>>
wrote:

    Some tools (compilers, assemblers, editors) can deal with any type
    of line endings so text saved in a different platform is not an
    issue.  But, this is not a universal rule.


Really?  What tool are you using where the line ending makes a difference?

GNU fmt and Notepad. fmt treats CR as any other character, and Notepad treats LF-only files as if they had no line endings at all.

How might such an odd pair of tools ever come up in a single project? You might have a cross-platforms project with *.txt files. Then you have two main failure modes:

1. A Windows user adds a *.txt file with ragged line endings to the repo, checking it in as CRLF-terminated. A Linux user comes along to fix the formatting with fmt, and ends up splitting CR/LF pairs in every reformatted paragraph.

2. Same situation, but reversed: A Unix user writes the initial text files, checks them in with LF endings, making them unreadable on Windows unless you have associated *.txt with something better than Notepad.

The argument about Fossil being an SCM and SCMs being for programmers is fine as far as it goes, but I wouldn't necessarily assume that all Windows programmers have associated *.txt files with Visual Studio The 5000 Pound Text Editor just because they have associated it with *.c. Some Windows users appreciate Notepad for the same reason that some *ix users still use nvi despite the ready availability of more capable editors.

I would expect an autocrlf feature to be purely optional, so that Fossil works as it currently does by default. But, you should be able to mark individual files as "text files", either by glob or with a per-file attribute. When you do that, Fossil should take note of the current line ending style, then convert the in-repo style to the local style on checkout, and automatically back to the canonical style before computing diffs.
_______________________________________________
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