On Wed, Aug 28, 2013 at 3:51 PM, Andy Bradford <amb-fos...@bradfords.org>wrote:

>     2.1 Identification Of Artifacts
>
>     A  particular  version  of  a   particular  file  is  called  an
>     "artifact". Each artifact has a universally unique name which is
>     the  SHA1 hash  of  the content  of that  file  expressed as  40
>     characters of lower-case hexadecimal. ...
>     Changing (or adding or removing) a single byte in a file results
>     in a completely different artifact ID. And since the artifact ID
>     is the name of the artifact, making any change to a file results
>     in a new artifact. In this way, artifacts are immutable.
>


A slight addition, which i only recently learned but might be of interest
to someone else out there: the content is immutable in the logical sense,
but not a physical sense. Fossil will occasionally (or more often, or less
often) replace the content of a blob with a delta generated from a newer
version (potentially long after the original blob was saved). When fetching
the blob, all such deltas (there may be a series of them) are
expanded/applied, and the SHA1 is checked against the expanded content.
Whenever Fossil saves anything of note (e.g. any user content, but not a
config entry), it queues up that content for a "before-commit check", to
ensure (before committing the SQL transaction) that it can actually read
back/process what it wrote and that everything is legal for extraction
purposes. Only if that check passes does the transaction get committed,
otherwise it gets rolled back and the content is not saved. i've never
actually seen that part fail, but know from having gone through the code
that Fossil makes sure that if it's going to fail, it will fail before
Fossil can commit it (in the SQL sense, not 'checkin' sense).

Put briefly: when you tell fossil to give you the contents of file
abcdef...., it may internally go through several versions of that file on
its way to generating the one you requested, applying deltas as it goes.
The end result is that the content is logically immutable, and always
convertible to its original form (as determined by SHA1 comparison), but
Fossil doesn't actually store it immutably.

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
_______________________________________________
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