dbda8d6ce9 2007-07-21 drh: <html> dbda8d6ce9 2007-07-21 drh: <head> dbda8d6ce9 2007-07-21 drh: <title>Fossil - Principles of Operation</title> dbda8d6ce9 2007-07-21 drh: </head> dbda8d6ce9 2007-07-21 drh: <body bgcolor="white"> 469002ccdf 2007-09-12 aku: <p>[ <a href="index.html">Index</a> ]</p> 469002ccdf 2007-09-12 aku: <hr> dbda8d6ce9 2007-07-21 drh: <h1>Principles Of Operation</h1> dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: <p> dbda8d6ce9 2007-07-21 drh: This page attempts to define the foundational principals upon dbda8d6ce9 2007-07-21 drh: which Fossil is built. dbda8d6ce9 2007-07-21 drh: </p> dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: <ul> dbda8d6ce9 2007-07-21 drh: <li><p>A project consists of source files, wiki pages, and 852dbbb65d 2008-02-13 drh: trouble tickets, and control files (collectively "artifacts"). 852dbbb65d 2008-02-13 drh: All historical copies of all artifacts 852dbbb65d 2008-02-13 drh: are saved. The project maintains an audit dbda8d6ce9 2007-07-21 drh: trail.</p></li> dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: <li><p>A project resides in one or more repositories. Each dbda8d6ce9 2007-07-21 drh: repository is administered and operates independently dbda8d6ce9 2007-07-21 drh: of the others.</p></li> dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: <li><p>Each repository has both global and local state. The dbda8d6ce9 2007-07-21 drh: global state is common to all repositories (or at least dbda8d6ce9 2007-07-21 drh: has the potential to be shared in common when the dbda8d6ce9 2007-07-21 drh: repositories are fully synchronized). The local state dbda8d6ce9 2007-07-21 drh: for each repository is private to that repository. dbda8d6ce9 2007-07-21 drh: The global state represents the content of the project. dbda8d6ce9 2007-07-21 drh: The local state identifies the authorized users and dbda8d6ce9 2007-07-21 drh: access policies for a particular repository.</p></li> dbda8d6ce9 2007-07-21 drh: b807acf62e 2007-07-24 drh: <li><p>The global state of a repository is an unordered 852dbbb65d 2008-02-13 drh: collection of artifacts. Each artifact is named by 852dbbb65d 2008-02-13 drh: its SHA1 hash encoded in lowercase hexadecimal. b807acf62e 2007-07-24 drh: In many contexts, the name can be dbda8d6ce9 2007-07-21 drh: abbreviated to a unique prefix. A five- or six-character dbda8d6ce9 2007-07-21 drh: prefix usually suffices to uniquely identify a file.</p></li> dbda8d6ce9 2007-07-21 drh: 852dbbb65d 2008-02-13 drh: <li><p>Because artifacts are named by their SHA1 hash, all artifacts 852dbbb65d 2008-02-13 drh: are immutable. Any change to the content of a artifact also 852dbbb65d 2008-02-13 drh: changes the hash that forms the artifacts name, thus 852dbbb65d 2008-02-13 drh: creating a new artifact. Both the old original version of the 852dbbb65d 2008-02-13 drh: artifact and the new change are preserved under different names.</p></li> dbda8d6ce9 2007-07-21 drh: 852dbbb65d 2008-02-13 drh: <li><p>It is theoretically possible for two artifacts with different dbda8d6ce9 2007-07-21 drh: content to share the same hash. But finding two such 852dbbb65d 2008-02-13 drh: artifacts is so incredibly difficult and unlikely that we dbda8d6ce9 2007-07-21 drh: consider it to be an impossibility.</p></li> dbda8d6ce9 2007-07-21 drh: 852dbbb65d 2008-02-13 drh: <li><p>The signature of an artifact is the SHA1 hash of the 852dbbb65d 2008-02-13 drh: artifact itself, exactly as it would appear in a disk file. No prefix 852dbbb65d 2008-02-13 drh: or meta-information about the artifact is added before computing b807acf62e 2007-07-24 drh: the hash. So you can b807acf62e 2007-07-24 drh: always find the SHA1 signature of a file by using the b807acf62e 2007-07-24 drh: "sha1sum" command-line utility.</p></li> dbda8d6ce9 2007-07-21 drh: 852dbbb65d 2008-02-13 drh: <li><p>The artifacts that comprise the global state of a repository dbda8d6ce9 2007-07-21 drh: are the complete global state of that repository. The SQLite dbda8d6ce9 2007-07-21 drh: database that holds the repository contains additional information 852dbbb65d 2008-02-13 drh: about linkages between artifacts, but all of that added information b807acf62e 2007-07-24 drh: can be discarded and reconstructed by rescanning the content 852dbbb65d 2008-02-13 drh: artifacts.</p></li> dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: <li><p>Two repositories for the same project can synchronize 852dbbb65d 2008-02-13 drh: their global states simply by sharing artifacts. The local dbda8d6ce9 2007-07-21 drh: state of repositories is not normally synchronized or dbda8d6ce9 2007-07-21 drh: shared.</p></li> dbda8d6ce9 2007-07-21 drh: 852dbbb65d 2008-02-13 drh: <li><p>Every baseline has a special file at the top-level b807acf62e 2007-07-24 drh: named "manifest" which is an index of all other files in 852dbbb65d 2008-02-13 drh: that baseline. The manifest is automatically created and b807acf62e 2007-07-24 drh: maintained by the system.</p></li> dbda8d6ce9 2007-07-21 drh: b110d77c36 2007-08-09 drh: <li><p>The <a href="fileformat.html">file formats</a> b110d77c36 2007-08-09 drh: used by Fossil are all very simple so that with access b807acf62e 2007-07-24 drh: to the original content files, one can easily reconstruct b807acf62e 2007-07-24 drh: the content of a baseline without the need for any b807acf62e 2007-07-24 drh: special tools or software.</p></li> dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: </body> dbda8d6ce9 2007-07-21 drh: </html>