On Sat, Jun 7, 2014 at 2:32 PM, Stephan Beal <sgb...@googlemail.com> wrote:

> On Sat, Jun 7, 2014 at 8:03 PM, <to...@acm.org> wrote:
>
>>   As for the hash mismatch this is just a minor technical issue easily
>> solved.  The hash would have to calculated after stripping off all CRs
>> (Win/DOS) or converting to LFs (Macs) in text files.  Then it will always
>> match the repo hash.
>>
>
> It's unfortunately not a "minor technical issue" because of how fossil
> calculates the hash for the whole contents of a repository for
> manifest-creation (and comparison) reasons (namely its Z-card and R-card
> constructs). The on-disk and in-db copies have to be identical or
> higher-level hashing calculations which know nothing about the individual
> files (they just see one contiguous byte stream flying by) will have
> different results.
>
>
Years ago (decades ago, actually), somebody rigged up fopen() so that it
did automatic NL <-> CRNL conversions unless you used "rb" or "wb" as the
"type" parameter.  This seemed like a clever solution at the time and was
warmly embraced by many developers.

However, with the passage of time, this auto-convert-by-fopen idea was
found to be a misfeature.  An anti-pattern.  It lead to a lot of bugs, and
a lot of work-around code.  It sometimes converts when you do not want it
to.  It sometimes fails to convert when you do want it to.  It is a general
nuisance and pain.

Automatic conversion between NL and CRNL by the version control system
strikes me as exactly the same thing.  It seems clever at first glance.
But if your goal is to precisely control the content of your project,
having the VCS subtly change things under the covers is not a desirable
feature.

As Stephan point out, Fossil goes to a lot of effort to record your files
*exactly* as you checked them in.  Making an exception for NL<->CRNL
changes will only lead to a proliferation of special-case code,
command-line options, and configuration parameters, resulting in confusion,
errors, and bugs.

-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
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