How Does SparkleShare Work With Git?

3

1

I haven't been able to find an answer to this anywhere on the internet so I wanted to bring my question here, to see if anyone has an answer!

I'm new to the Git scene and I'm curious how SparkleShare works in conjunction with Git.

I know that SparkleShare connects to the repository on a private server over SSH & by default uses port 22 which is the default port for sFTP under the SSH protocol. What I don't understand is how it synchronizes the files between machines through the server. When you make an edit to a file is SparkleShare pushing the commit to the server, and all the other machines are waiting to fetch file changes? Or does the server push the changes to associated machines? Or is it a git hook that gets the data from the server?

Thanks in advance for any insight.

Far_Eggs

Posted 2013-05-22T18:37:13.733

Reputation: 33

Answers

3

SparkleShare gets notified of local changes to the data via inotify, then it waits until the filesystem activities settle and starts commiting and pushing the changes to the server via SSH. In order to know when new files are available, there is a server provided by the Sparkleshare developers where Sparkleshare creates a new channel for each repository so push notifications can be sent to every instance subscribed to the channel when files are changed. If this is not possible SparkleShare falls back to polling.

The server side is fully passive and doesn't know anything about SparkleShare at all, it's just a git repository.

Now some of my experience with the conflict management and binary files, this might be biased:

I've been trying to use SparkleShare for half a year now but I gave up last week. Everything goes fine until you make different changes on different devices while being offline. This nearly always resulted in me having to resolve the conflicts manually with my not that good git skills. As far as I know, when having a conflict, Sparkleshare tries to get the HEAD of the repository back to the commit that is common between both conflicting changes, then plays the commits from the server on top of it and then tries to apply the local changes, but I'm not sure about that and it didn't work for me. This problem in combination with some problems that git has with binary files that are changing, resulted in times when my CPU was at 100% regularly until resolving the conflicts manually. On one of my devices with a low ram environment, it couldn't even clone one of my repositories, because I ran out of memory reproducably.

I know you didn't ask for my advice on how to use SparkleShare, but I advise you not to use it with binary files and/or files that are changing rapidly like savegames, some config files etc.

FSMaxB

Posted 2013-05-22T18:37:13.733

Reputation: 1 528

A year or two ago when I first heard of sparkleshare (before it was out on linux) and saw it used git under the hood I was wondering how they were going to avoid it totally sucking with binary files... Sounds like they didn't. – Sirex – 2013-05-22T20:05:31.097

@Sirex Yes, they should better not be planning mercurial as an alternative backend in the future, but implement it right now (or they should have used it right from the beginning) – FSMaxB – 2013-05-22T20:07:48.800