logoalt Hacker News

necovekyesterday at 6:45 AM1 replyview on HN

I agree that files solve some rudimentary cases, but they do not even allow simple conflict resolution. Eg. compressed files, including container formats like OpenOffice (text files in a ZIP archive IIRC), might be simple to apply changes from two sides if they are in distant parts, but syncing full files simply barfs.

Note that this does not even need two users: I hit this problem with a desktop and laptop and self-hosted NextCloud myself.

In general, a filesystem that actually stored both raw data (to fail-over to), but also a per-format event log, and maybe even app specific events (imagine a PNG changes, we could have any change recorded as raw bytes, generic bitmap image operation like "modify pixels at x,y to ..." and app-specific log like "gimp: apply sharpen filter on polygon area ...").

This would allow the other side to attempt to do the smartest sync it has (if it has a compatible version of gimp, it could decide to apply the filter, otherwise fall back to raw pixel changes if no conflicts, and then fall back to full file contents reconciliation).

Just like MIME handlers get registered, if file systems provided such change logs, some could have very advanced sync systems with this support from "filesystems".


Replies

monkeyeliteyesterday at 2:49 PM

The log is just a block of data. All the burden to use the log is on the application so the OS is providing very little general functionality.

I’m also suspect of logs as a general form of conflict resolution as you are just hoping the two edits don’t touch the same area. And if they do then you are left in an invalid state.

You brought up zips. Pile of files seems like a way you can divide up data so it can have more pieces that are mergable/diffable.

For example “the folder can contain N files” or “there must be exactly 1 of this file”.

show 1 reply