
gitty.pl -- Single-file GIT like version systemThis library provides a first implementation of a lightweight versioned file store with dynamic meta-data. The store is partly modelled after GIT. Like GIT, it uses a content-based store. In fact, the stored objects are compatible with GIT. Unlike GIT though, there are no trees. Each entry (file) has its own history. Each commit is associated with a dict that can carry aribitrary meta-data. The following fields are reserved for gitties bookkeeping:
The key commit is reserved and returned as part of the meta-data of
the newly created (gitty_create/5) or updated object (gitty_update/5).
gitty_open(+Store, +Options) is detfiles or bdb. When
omitted and the store exists, the current store is
examined. If the store does not exist, the default
is files.
Other options are passed to the driver method gitty_open(Store,
Options).
gitty_driver(+Store, -Driver)
gitty_close(+Store) is det
gitty_file(+Store, ?Head, ?Hash) is nondet
gitty_file(+Store, ?Head, ?Ext, ?Hash) is nondet
gitty_create(+Store, +Name, +Data, +Meta, -Commit) is det
gitty_update(+Store, +Name, +Data, +Meta, -Commit) is det
gitty_data(+Store, +NameOrHash, -Data, -Meta) is semidet
gitty_commit(+Store, +NameOrHash, -Meta) is semidetcommit is
added to the meta-data to specify the commit hash.
gitty_plain_commit(+Store, +Hash, -Meta) is semidet
gitty_history(+Store, +NameOrHash, -History, +Options) is dethistory with a list of dicts
representating the history of Name in Store. The toplevel dict
also contains skipped, indicating the number of skipped items
from the HEAD. Options:
gitty_fsck(+Store) is det
fsck_object(+Store, +Hash) is semidet
gitty_save(+Store, +Data, +Type, -Hash) is det
gitty_load(+Store, +Hash, -Data, -Type) is det
gitty_hash(+Store, ?Hash) is nondet
delete_object(+Store, +Hash)
gitty_reserved_meta(?Key) is nondet
is_gitty_hash(@Term) is semidet
delete_head(+Store, +Head) is det
set_head(+Store, +File, +Head) is det
gitty_diff(+Store, ?Hash1, +FileOrHash2OrData, -Dict) is detprevious of
FileOrHash2. Returns _{initial:true} if Hash1 is unbound and
FileOrHash2 is the initial commit. Dict contains:
data_diff(+Data1, +Data2, -UDiff) is detudiff(L1,S1,L2,S2,Diff)
Diff is a list holding
udiff_string(+UDiff, -String) is detThe following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
gitty_file(+Store, ?Head, ?Hash) is nondet
gitty_file(+Store, ?Head, ?Ext, ?Hash) is nondet
gitty_save(+Store, +Data, +Type, -Hash) is det
gitty_load(+Store, +Hash, -Data, -Type) is det