
gitty_driver_files.pl -- Gitty plain files driver
This version of the driver uses plain files to store the gitty data. It
consists of a nested directory structure with files named after the
hash. Objects and hash computation is the same as for git. The heads
(files) are computed on startup by scanning all objects. There is a file
ref/head that is updated if a head is updated. Other clients can watch
this file and update their notion of the head. This implies that the
store can handle multiple clients that can access a shared file system,
optionally shared using NFS from different machines.
The store is simple and robust. The main disadvantages are long startup times as the store holds more objects and relatively high disk usage due to rounding the small objects to disk allocation units.
gitty_close(+Store) is det
gitty_file(+Store, ?File, ?Ext, ?Head) is nondet
load_plain_commit(+Store, +Hash, -Meta:dict) is semidet
store_object(+Store, +Hash, +Header:string, +Data:string) is det
load_object(+Store, +Hash, -Data, -Type, -Size) is det
load_object_header(+Store, +Hash, -Type, -Size) is det[private]
gitty_rescan(?Store) is det
gitty_scan(+Store) is det[private]@tdb Possibly we need to maintain a cached version of this index to avoid having to open all objects of the gitty store.
read_heads_from_objects(+Store) is det[private]head(Store,File,Ext,Hash) relation by reading all
objects and adding a fact for the most recent commit.
gitty_scan_latest(+Store)[private]
gitty_hash(+Store, ?Hash) is nondet
delete_object(+Store, +Hash)
gitty_object_file(+Store, +Hash, -Path) is det
gitty_update_head(+Store, +Name, +OldCommit, +NewCommit) is det-.
This operation can fail because another writer has updated the head. This can both be in-process or another process.
remote_updates(+Store)[private]
remote_updates(+Store, -List) is det[private]
restore_heads_from_remote(Store)[private]
delete_head(+Store, +Head) is det
set_head(+Store, +File, +Hash) is det
repack_objects(+Store, +Options) is det[multifile]
pack_objects(+Store, +Objects, +Packs, +PackDir, -PackFile, +Options) is det
add_file(+Out, +Store, +Object) is det[private]
gitty_fsck(+Store) is det
fsck_pack(+File) is det
gitty_attach_packs(+Store) is det[private]
attach_pack(+Store, +PackFile)
detach_pack(+Store, +Pack) is det[private]
load_object_from_pack(+Hash, -Data, -Type, -Size) is semidet
unpack_packs(+Store) is det[multifile]
unpack_pack(+Store, +Pack) is det
remove_objects_after_pack(+Store, +Objects, +Options) is det[private]
remove_repacked_packs(+Store, +Packs, +Options)[private]
prune_empty_directories(+Dir) is det[private]