May 17, 2014

SparkleShare: Sharing & merging text files between computers

SparkleShare is basically a file syncing frontend for Git. I have meantime dumped it in favor of secure cloud storage with client-side encryption, but SparkleShare might still find some fringe applications and my experience with it might be of use to someone, so here it goes.

SparkleShare is based on Git, but it doesn't merge files. It creates two copies of the file upon conflict. That puts SparkleShare on the same level as Dropbox, for example. That's rather annoying, because all syncing must be real-time enough to avoid conflicts.

I will have to mess with WinMerge to get my text files merged in case they are edited on computer without Internet connection that is later reconnected (hello, cellular networks). I cannot even imagine the kind of trouble I would have to go through on mobile devices to get my files merged. Fortunately I am a proud owner of a PC.

SparkleShare can encrypt the data on the client, which is essential for security. It won't encrypt file names though. The downside is that it further complicates manual merge using Git tools.

In order to prevent my favorite Notepad++ from constantly complaining about changed files, I had to check "Update silently" in preferences. Yet Notepad++ notices changes only after switching windows. Some kind of auto-save would be desirable, but there's no seamless plug-in doing that.

SparkleShare works wonders. Nice wizard for setting up a repository. Syncing takes a couple of seconds. The fast sync makes conflicts unlikely.

BitBucket is fairly tolerant with repositories. I store text files there, so it shouldn't bother anyone. I am sure they won't like you uploading gigabytes of music files though. The only stumbling block was that it wasn't obvious that I have to upload SparkleShare's per-machine key to my BitBucket account.

SparkleShare is a bit dangerous in that it doesn't have any limits. If I accidentally drop 5GB disk image in the shared folder, SparkleShare will most likely nuke my repository.

Commit messages are not very informative. It hinders search for specific version of the file to some degree. This is something that Git-based tool could do much better. But then one would have to encrypt the messages too. They are already quite telling.

Synchronization used to be quite slow when waking the computer up from sleep. It took well over 1 minute to update the local copy. SparkleShare was meantime patched to use smarter exponential backoff that fixes the problem.

SparkleShare does some automated merging, but it takes several minutes to sync changes both ways. It's not instant at all, I believe this is another bug in SparkleShare, but I haven't investigated this one.

Automated merge applies only to simple edits made in different parts of the file. I am usually writing various kinds of logs where I append lines at the end of at the beginning of the file. So even with automated merge I won't be able to avoid frequent edit conflicts.

The conflict resolution is so painful that it is much easier to just wait for the files to sync before editing them. Since the initial sync took 1-2 minutes due to above mentioned bug, this poor conflict resolution caused tons of wasted time and eventually led me to use cloud storage instead.

SparkleShare has an architectural limitation stemming from Git. It archives almost every change made to every file forever. That will bloat repositories quickly if images or other media get accidentally shared over SparkleShare. Maybe SparkleShare authors will implement some form of version collapsing someday in the future. Git encourages history rewriting, so it should be technically possible.

When both devices are on, syncing takes about 20-40 seconds, which is way slower than Dropbox's 10 seconds. Most of this time is spent running git commands.Maybe some git optimizations could make SparkleShare faster in the future. Meantime I am a big fan of the traditional cloud storage.

No comments:

Post a Comment