On May 10, 2018, at 4:50 PM, Will Parsons <varro@nodomain.invalid> wrote:
> 
> I know (at least I think I know) that I can get the effect I want by
> making the file a Markdown file by renaming it LICENCE.md

Yes.  Scroll to the final paragraph of this Fossil wiki document for a case in 
point:

    https://tangentsoft.com/pidp8i/wiki?name=A+Field+Guide+to+PDP-8+Assemblers

That link was made directly, with no mimetype trickery.

> I don’t want to do that.

MIME type detection in Fossil — as in most other HTML-via-HTTP servers — is 
based on file name matches, which generally means file name extensions.  That 
design allows the creator of the files to give a clear signal to the server 
what the Right Thing is in the specific case.

While Fossil could add RE patterns like ^.*/LICENSE$ to cover cases like yours, 
I think that’s a borderline violation of the principle of least astonishment.  
That is to say, it’s arguably wrong, though not unassailably so.

Another risky alternative is file content sniffing.  That’s fine for files with 
magic bytes, but it’s difficult to get right in all cases with plain text.  
Ever had your programmer’s text editor misidentify a file type and give you 
bogus syntax highlighting?  That’s what comes of trying to autodetect it.  It’s 
why many programmer’s text editors have an override mechanism that lets someone 
put a special comment into the file to force a specific interpretation.

> Traditionally files named README, INSTALL, and
> LICENSE/LICENCE have been plain-text files with no extension, and I'd
> like to keep it that way.

That philosophy was fine in the CLI-only world, where the computer user had to 
type a command to act on the file, so you had human intuition, training, and 
knowledge to aid in giving the right command, but in the modern world, we are 
often depending on the dumb computer to do something automatic, yet still 
“correct” by our human perceptions.  

Until we get generalized AI, that means we’re going to have to give the 
computer reliable clues to work with.  For binary files, that can be magic 
bytes, but for plain text files, file name extensions are the best the industry 
has come up with so far.

Other attempts, like file metadata tags (e.g. classic Mac OS 4-letter codes) 
have been rejected as causing more problems than they solve.
_______________________________________________
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