sahib / brig

File synchronization on top of ipfs with git like interface & web based UI
https://brig.readthedocs.io
GNU Affero General Public License v3.0
567 stars 33 forks source link

Introduce option to keep full file history on Sync #62

Open sahib opened 3 years ago

sahib commented 3 years ago

By default we're sending compressed patches over the wire on sync. Those are applied on the metadata copy of the respective remote and only contain the latest change. As an example:

When bob syncs with alice a patch is send that has only this information:

Bob will never see the moves in between. This is probably not very interesting for him either, but there might be use cases where we also want to see intermediate modifications (e.g. to see how modifications evolved).

Recent changes allow now to send individual patches. Those are then applied individually on the remote's metadata copy via ApplyPatch() resulting in a commit each. However Sync() is only called once, producing only a single commit. We should add an option to sync (working title: --persist-history / -p) that does the following:

By default we should use the combined patch system since most users might not be interested in the intermediate history. This is also more efficient space- and time-wise.