Fossil SCM

Document that Fossil is CRLF-free.

drh 2024-10-13 20:27 omit-cr
Commit 038bcc9442e42c74e9e154539bbbce8e7ff64d1d875e6a370bcd5720f6d7e86d
--- a/www/crlf-free.md
+++ b/www/crlf-free.md
@@ -0,0 +1,46 @@
1
+Fossil Does Not Send CRLF
2
+=========================
3
+
4
+Fossil uses \\n (NL) line endings, not \\r\\n (CRLF) line endings, even for
5
+the HTTP and SMTP protocols where CRLF line endings are required. This is
6
+deliberate. The founder of Fossil believes that that CRLF
7
+line endings are a harmful anachronism and need to be abolished.
8
+
9
+The HTTP protocol is defined by RFC-2616. Even though RFC-2616 says that CRLF
10
+line endings are required, that same spec recommends that all clients
11
+also accept bare \\n line endings. Most HTTP clients abide by this
12
+recommendation, and so Fossil's refusal to play by the rules is harmless.
13
+And omitting those extra \\r bytes reduces bandwidth slightly.
14
+The omission of unnecessary \\r characters is a feature of Fossil, not a bug.
15
+
16
+~~~ pikchr
17
+sin45 = sin(3.141592653/4)
18
+C: circle "CRLF" big big bold thick fit
19
+C2: circle thick thick radius C.radius at C.c color red
20
+ line thick thick from (C.x-sin45*C.radius,C.y-sin45*C.radius) \
21
+ to (C.x+sin45*C.radius,C.y+sin45*C.radius) color red
22
+T1: text "CRLF-free" bold fit with .s at 1mm above C.n
23
+T2: text "Zone" bold fit with .n at 1mm below C.s
24
+ box ht dist(T1.s,T2.n)+lineht*1.2 wid C2.width+lineht*0.5 \
25
+ fill yellow thick thick radius 3mm at C.c behind C
26
+~~~
27
+
28
+## How Does This Affect Me
29
+
30
+It doesn't. You won't notice that Fossil omits unnecessary CRs unless you look
31
+at a hex-dump of the HTTP protocol that it generates. This documentation page
32
+exists only so that in case somebody does notice, they won't think the omission
33
+of CRs is a bug.
34
+
35
+## My Boss Says I Can Only Host Standards-Compliant Software.
36
+
37
+If you recompile Fossil using the "`-DSEND_CR=1`" compile-time option, then it
38
+will generate all extra CRs required by HTTP and SMTP.
39
+
40
+## Why Not Just Make Fossil Standards-Compliant By Default?
41
+
42
+Because the standard is wrong. Requiring CRLF as a line-ending is silly.
43
+It wastes bandwidth. It is vexation to programmers that have to deal with the
44
+extra CRs. It is an anachronism based on hardware constraints in 1950s-era
45
+teleprinters. CRLF needs to be abolished. And the only way that will happen
46
+is if the users revolt.
--- a/www/crlf-free.md
+++ b/www/crlf-free.md
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/www/crlf-free.md
+++ b/www/crlf-free.md
@@ -0,0 +1,46 @@
1 Fossil Does Not Send CRLF
2 =========================
3
4 Fossil uses \\n (NL) line endings, not \\r\\n (CRLF) line endings, even for
5 the HTTP and SMTP protocols where CRLF line endings are required. This is
6 deliberate. The founder of Fossil believes that that CRLF
7 line endings are a harmful anachronism and need to be abolished.
8
9 The HTTP protocol is defined by RFC-2616. Even though RFC-2616 says that CRLF
10 line endings are required, that same spec recommends that all clients
11 also accept bare \\n line endings. Most HTTP clients abide by this
12 recommendation, and so Fossil's refusal to play by the rules is harmless.
13 And omitting those extra \\r bytes reduces bandwidth slightly.
14 The omission of unnecessary \\r characters is a feature of Fossil, not a bug.
15
16 ~~~ pikchr
17 sin45 = sin(3.141592653/4)
18 C: circle "CRLF" big big bold thick fit
19 C2: circle thick thick radius C.radius at C.c color red
20 line thick thick from (C.x-sin45*C.radius,C.y-sin45*C.radius) \
21 to (C.x+sin45*C.radius,C.y+sin45*C.radius) color red
22 T1: text "CRLF-free" bold fit with .s at 1mm above C.n
23 T2: text "Zone" bold fit with .n at 1mm below C.s
24 box ht dist(T1.s,T2.n)+lineht*1.2 wid C2.width+lineht*0.5 \
25 fill yellow thick thick radius 3mm at C.c behind C
26 ~~~
27
28 ## How Does This Affect Me
29
30 It doesn't. You won't notice that Fossil omits unnecessary CRs unless you look
31 at a hex-dump of the HTTP protocol that it generates. This documentation page
32 exists only so that in case somebody does notice, they won't think the omission
33 of CRs is a bug.
34
35 ## My Boss Says I Can Only Host Standards-Compliant Software.
36
37 If you recompile Fossil using the "`-DSEND_CR=1`" compile-time option, then it
38 will generate all extra CRs required by HTTP and SMTP.
39
40 ## Why Not Just Make Fossil Standards-Compliant By Default?
41
42 Because the standard is wrong. Requiring CRLF as a line-ending is silly.
43 It wastes bandwidth. It is vexation to programmers that have to deal with the
44 extra CRs. It is an anachronism based on hardware constraints in 1950s-era
45 teleprinters. CRLF needs to be abolished. And the only way that will happen
46 is if the users revolt.
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -41,10 +41,11 @@
4141
copyright-release.html {Contributor License Agreement}
4242
concepts.wiki {Fossil Core Concepts}
4343
contact.md {Developer Contact Information}
4444
containers.md {OCI Containers}
4545
contribute.wiki {Contributing Code or Documentation To The Fossil Project}
46
+ crlf-free.md {Fossil Does Not Send CRLF}
4647
css-tricks.md {Fossil CSS Tips and Tricks}
4748
customgraph.md {Theming: Customizing the Timeline Graph}
4849
customskin.md {Theming: Customizing The Appearance of Web Pages}
4950
customskin.md {Custom Skins}
5051
custom_ticket.wiki {Customizing The Ticket System}
5152
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -41,10 +41,11 @@
41 copyright-release.html {Contributor License Agreement}
42 concepts.wiki {Fossil Core Concepts}
43 contact.md {Developer Contact Information}
44 containers.md {OCI Containers}
45 contribute.wiki {Contributing Code or Documentation To The Fossil Project}
 
46 css-tricks.md {Fossil CSS Tips and Tricks}
47 customgraph.md {Theming: Customizing the Timeline Graph}
48 customskin.md {Theming: Customizing The Appearance of Web Pages}
49 customskin.md {Custom Skins}
50 custom_ticket.wiki {Customizing The Ticket System}
51
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -41,10 +41,11 @@
41 copyright-release.html {Contributor License Agreement}
42 concepts.wiki {Fossil Core Concepts}
43 contact.md {Developer Contact Information}
44 containers.md {OCI Containers}
45 contribute.wiki {Contributing Code or Documentation To The Fossil Project}
46 crlf-free.md {Fossil Does Not Send CRLF}
47 css-tricks.md {Fossil CSS Tips and Tricks}
48 customgraph.md {Theming: Customizing the Timeline Graph}
49 customskin.md {Theming: Customizing The Appearance of Web Pages}
50 customskin.md {Custom Skins}
51 custom_ticket.wiki {Customizing The Ticket System}
52
--- www/permutedindex.html
+++ www/permutedindex.html
@@ -59,10 +59,11 @@
5959
<li><a href="concepts.wiki">Fossil Core Concepts</a></li>
6060
<li><a href="css-tricks.md">Fossil CSS Tips and Tricks</a></li>
6161
<li><a href="delta_encoder_algorithm.wiki">Fossil Delta Encoding Algorithm</a></li>
6262
<li><a href="delta_format.wiki">Fossil Delta Format</a></li>
6363
<li><a href="hacker-howto.wiki">Fossil Developers Guide</a></li>
64
+<li><a href="crlf-free.md">Fossil Does Not Send CRLF</a></li>
6465
<li><a href="fileformat.wiki">Fossil File Format</a></li>
6566
<li><a href="forum.wiki">Fossil Forums</a></li>
6667
<li><a href="grep.md">Fossil grep vs POSIX grep</a></li>
6768
<li><a href="quickstart.wiki">Fossil Quick Start Guide</a></li>
6869
<li><a href="selfcheck.wiki">Fossil Repository Integrity Self Checks</a></li>
6970
--- www/permutedindex.html
+++ www/permutedindex.html
@@ -59,10 +59,11 @@
59 <li><a href="concepts.wiki">Fossil Core Concepts</a></li>
60 <li><a href="css-tricks.md">Fossil CSS Tips and Tricks</a></li>
61 <li><a href="delta_encoder_algorithm.wiki">Fossil Delta Encoding Algorithm</a></li>
62 <li><a href="delta_format.wiki">Fossil Delta Format</a></li>
63 <li><a href="hacker-howto.wiki">Fossil Developers Guide</a></li>
 
64 <li><a href="fileformat.wiki">Fossil File Format</a></li>
65 <li><a href="forum.wiki">Fossil Forums</a></li>
66 <li><a href="grep.md">Fossil grep vs POSIX grep</a></li>
67 <li><a href="quickstart.wiki">Fossil Quick Start Guide</a></li>
68 <li><a href="selfcheck.wiki">Fossil Repository Integrity Self Checks</a></li>
69
--- www/permutedindex.html
+++ www/permutedindex.html
@@ -59,10 +59,11 @@
59 <li><a href="concepts.wiki">Fossil Core Concepts</a></li>
60 <li><a href="css-tricks.md">Fossil CSS Tips and Tricks</a></li>
61 <li><a href="delta_encoder_algorithm.wiki">Fossil Delta Encoding Algorithm</a></li>
62 <li><a href="delta_format.wiki">Fossil Delta Format</a></li>
63 <li><a href="hacker-howto.wiki">Fossil Developers Guide</a></li>
64 <li><a href="crlf-free.md">Fossil Does Not Send CRLF</a></li>
65 <li><a href="fileformat.wiki">Fossil File Format</a></li>
66 <li><a href="forum.wiki">Fossil Forums</a></li>
67 <li><a href="grep.md">Fossil grep vs POSIX grep</a></li>
68 <li><a href="quickstart.wiki">Fossil Quick Start Guide</a></li>
69 <li><a href="selfcheck.wiki">Fossil Repository Integrity Self Checks</a></li>
70

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button