This PR replaces the Timeline with a new CRDT called WorkTree. In the previous implementation, every file in the CRDT was created via an operation. Now, we only create operations for changes since a base commit. This exploits the fact that Git commits can be thought of as global synchronization points across all replicas, having fixed contents that all replicas agree upon.
When the work tree is first created, operations from existing replicas can be applied immediately, but the tree also needs to be populated with paths from the base commit via the append_base_entries method before most of these operations can be interpreted. When a buffer is opened for the first time on any replica, the buffers base text also needs to be supplied from the underlying base commit in the Git repository.
This PR also incorporates buffers and brings our API into a usable state for the first time. Next, we plan to expose this core API to JavaScript via WebAssembly so this can be used in web-based projects to get some feedback.
This PR replaces the
Timeline
with a new CRDT calledWorkTree
. In the previous implementation, every file in the CRDT was created via an operation. Now, we only create operations for changes since a base commit. This exploits the fact that Git commits can be thought of as global synchronization points across all replicas, having fixed contents that all replicas agree upon.When the work tree is first created, operations from existing replicas can be applied immediately, but the tree also needs to be populated with paths from the base commit via the
append_base_entries
method before most of these operations can be interpreted. When a buffer is opened for the first time on any replica, the buffers base text also needs to be supplied from the underlying base commit in the Git repository.This PR also incorporates buffers and brings our API into a usable state for the first time. Next, we plan to expose this core API to JavaScript via WebAssembly so this can be used in web-based projects to get some feedback.