hbons/SparkleShare — pull request #584 by shish (2012-02-24 17:25:56+00:00)
Title: Gut back-end (Simple API for external tools)

I don't know C# all that well, but I can develop very fast using python - Since I wanted to contribute to sparkleshare with the minimum of fuss, my first idea was to write a new back-end that basically maps the SparkleShare API to a command line. This is it.

Philosophy and protocol notes are here: https://github.com/shish/guts/blob/master/gut.rst

The only thing that is slightly different to the Git API is that rarely-changing parameters (eg, the repository URL and the user's ID) are set with a "configure" command and don't need to be passed every time. This makes the back-ends much more pleasant to use as stand-alone command line tools.

My proof of concept implementation of a back-end executable is here: https://github.com/shish/guts -- it's a very simple and unoptimised sync tool, but it should suffice as a reference (although even as it is, it has some advantages over the git back-end)

So, over to you guys -- do you think allowing external scripts as back-ends is a good approach? Is the sparkleshare C# API good to use as a command-line API? Any other comments?

If the general idea is good, my next idea is to extend the plugin detection -- where currently compiled-in back-ends are detected (eg the repo "foo.git" uses "SparkleRepoGit"), I'd like to also detect external back ends (eg, if SparkleRepoGit didn't exist, sparkleshare would attempt to use the command line tool `/usr/lib/sparkleshare/backends/git`); would that be sensible?