<h1>Fossil Library API Scratchpad</h1>

See also: [download], [th1ish], docs] (refreshed occasionally from current sources)


This source code repository houses experimentation for a potential library API for the SCM]. The primary goal is to port existing behaviour into a library form (the v1 app is extremely monolithic in nature). While it has been informally dubbed "v2", so far no format-breaking changes are planned so it might turn out to provide an alternative to fossil v1, as opposed to a replacement.


This code currently doesn't do much - it is intended for those interested in following or participating in the design of libfossil. All current Fossil committers (those who have a signed a license waiver on file with DRH) are welcomed contributors - email me your preferred user name to get access:


<h2>Status, TODOs, and Whatnot</h2>

All of this code is an <em>experiment</em>, and it does not represent a commitment by anyone that any of this code wll some day end up living under the umbrella of the larger Fossil SCM project. If all goes well, that's the eventual goal, though. It is pre-alpha quality. What's there works but there is still a a great deal of the SCM-specific infrastructure left to port in and refactor to make it usable via library-style interfaces. Anyone looking for a project roadmap/timeline is asked respectfully to look elsewhere - there is no timebox on nor schedule for this project/experiment.

The current public (and documented) API can be found in and occasionally that gets to doxygen].

TODOs, design discussions, etc... you might want to get a before starting through list].

A list of recent notable changes is maintained below.

An experimental [th1ish|script engine binding] is being created in parallel with the library.

<h2>"Rules" for Code Contributors</h2>

   *  All code contributors must have a license waiver on file with DRH, as the hope is to eventually release this code as the next generation of Fossil. Non-code contributions are happily accepted from anyone.
   *  When working on bits which themselves write to the repository, e.g. creating checkins, please be exceedingly careful not to corrupt the db :-D.
   *  Please try to conform to the overall coding style (as laid out by Fossil v1).
   *  Don't bother using branches unless you really want to - the trunk has no stability guarantees and is very much in flux, so feel free to work there instead of a branch.

There is nothing holy or sacred about this repo, so feel free to hack at will. Generally the quickest/most complete way to test changes it to add them to the th1ish script bindings (in If you prefer writing C-level tests, please add them to <tt>test.c</tt> in the top-level directory or to a new test app if you like. See <tt>FossilApp.c</tt> for a mini-framework to bootstrap new test apps.


<h2>News</h2>

Notable changes (newest at the top)...
   *  20130808: Restructured source tree and ported build configuration process to (because that's what Fossil uses). Existing build files (not the sources) still require GNU Make on a Unix platform, though. Many thanks to Steve Bennett (autosetup's author) for his assistance.
   *  20130804: ported in the symbol-to-uuid resolution bits from the main repo. These are what allow apps to use short-form UUIDs and symbolic names like "trunk," instead of having to use 40-byte UUIDs everywhere.
   *  20130803: most of the infrastructure for creating and control artifacts] is in place, but we don't yet write them to the db.
   *  20130801: ported in the delta generation/apply code and added script bindings for them.
   *  20130730: changed internal handling of DBs from 1 connection per db to a single main connection to an in-memory db and attaching the to that. Not yet sure if this is a feature or a bug, but it simplifies the internal tracking of db handles notably.
   *  20130728: it can now search for and open a checkout based on a directory name, analog to how v1 finds an open checkout.
   *  20130727: started work on a [/dir?ci=tip&name=th1ish|th1ish script engine binding] for v2. It is of course a work-in-progress but it is extended in parallel to the core lib because that simplifies testing and helps work the kinks out of the core API.
   *  20130726: when opening a repo db, the library now validates that it is a repo db, and can distinguish between/report various types of errors, e.g. repo schema is out of data or the db is not a fossil repo.
   *  20130725: removed the per-instance allocator configuration - it is now library-wide. This simplifies buffer usage and makes it legal to use them before instantiating a fossil context.