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"> 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 dbda8d6ce9 2007-07-21 drh: trouble tickets. All historical copies of all these dbda8d6ce9 2007-07-21 drh: entities 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 dbda8d6ce9 2007-07-21 drh: collection of files. Each file is named by b807acf62e 2007-07-24 drh: its SHA1 hash encoded in 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: b807acf62e 2007-07-24 drh: <li><p>Because files are named by their SHA1 hash, all files dbda8d6ce9 2007-07-21 drh: are immutable. Any change to the content of a file also dbda8d6ce9 2007-07-21 drh: changes the hash that forms the files name, thus dbda8d6ce9 2007-07-21 drh: creating a new file. Both the old original version of the dbda8d6ce9 2007-07-21 drh: file and the new change are preserved under different names.</p></li> dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: <li><p>It is theoretically possible for two files with different dbda8d6ce9 2007-07-21 drh: content to share the same hash. But finding two such dbda8d6ce9 2007-07-21 drh: files 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: b807acf62e 2007-07-24 drh: <li><p>The signature of a file is the SHA1 hash of the b807acf62e 2007-07-24 drh: file itself, exactly as it appears on disk. No prefix b807acf62e 2007-07-24 drh: or meta-information about the file 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: b807acf62e 2007-07-24 drh: <li><p>The files 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 dbda8d6ce9 2007-07-21 drh: about linkages between files, but all of that added information b807acf62e 2007-07-24 drh: can be discarded and reconstructed by rescanning the content dbda8d6ce9 2007-07-21 drh: files.</p></li> dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: <li><p>Two repositories for the same project can synchronize dbda8d6ce9 2007-07-21 drh: their global states simply by sharing files. 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: b807acf62e 2007-07-24 drh: <li><p>Every repository has a special file at the top-level b807acf62e 2007-07-24 drh: named "manifest" which is an index of all other files in b807acf62e 2007-07-24 drh: the system. The manifest is automatically created and b807acf62e 2007-07-24 drh: maintained by the system.</p></li> dbda8d6ce9 2007-07-21 drh: b807acf62e 2007-07-24 drh: <li><p>The <a href="fileformat.html">file format</a> b807acf62e 2007-07-24 drh: is 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>