Python script for automatic synchronization based on inotify
rene at mayrhofer.eu.org
Sun Mar 20 08:31:39 CET 2011
Am Freitag, 18. März 2011, 22:59:07 schrieb Dieter Plaetinck:
> I found sparkleshare very disappointing. I spent more time reporting bugs for all kinds of stupid things then actually using the software.. I got it to sync 1 file then it stopped and I gave up.
On my initial tries, I also ran into a few issues with Sparkleshare, but I haven't given it too much time so far.
> Your program passed my initial testing, the code seems more robust and the design is more sane.
Nice to hear.
> Also, I'll take 605 lines of python over 9k lines of mono any day.
That was my main reason for taking Python: rapid prototyping with mature libraries (pyinotify just rocks, e.g. compared to the JNI inotify wrapper).
> I have already one bugfix for you:
Thanks - I will try to merge this tonight/tomorrow, as soon as I have wrapped my head around the gitorious merge request interface.
> I hope to contribute more later on. Preferably once you have a clean git history.
> I will try to start relying on this to synchronize my notes, and then some other files..
Excellent. I am open to many changes/improvements in this little project.
> 2) What's the very minimum a user should do (other then installing the software and configuring ~/.autosync) ?
> What I did: (in this case, in ~/.autosync path is set to ~/autosync)
> $ ssh server git init --bare test.git
> $ cd ~/autosync && git clone server:test.git
That's basically it. Then you start the script and it should be working for monitoring local changes and automatically committing them. For synchronization with other instances, you will also need to configure an XMPP account to use for this purpose.
> Note if you do this, server:test.git won't actually have a master branch yet.
> So when i touch ~/autosync/test, I get this:
> No refs in common and none specified; doing nothing.
> Perhaps you should specify a branch such as 'master'.
> fatal: The remote end hung up unexpectedly
> error: failed to push some refs to 'server:autosync.git'
> workaround is typing `git push origin master` once. after that it works fine.
You're right. I've never actually tried it on a completely empty repository. We should either document this in README (the setup process) or make the script realize when there is no master branch and do a "git push origin master" in this case. I will need to dig into the git remote command a bit more to see what the best option is here (I don't like parsing the output if I can avoid it).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 836 bytes
Desc: This is a digitally signed message part.
More information about the vcs-home