Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
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 May 22 '13 at 20:05
    
@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 May 22 '13 at 20:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.