I have some repositories where I want to manually control what files are added (autocommit=false), but would like to have the assistant/webapp automatically sync commits and transfer files. However it seems that the assistant is not notified if I manually do a commit.
The only solution right now seems to frequently restart the assistant since the startup scan will transfer files if required or run git annex get/copy manually.
Is there another possibility?
Right, the assistant doesn't have a way to get notified of your manual commits, so it doesn't promptly push them.
While the assistant could be modified to watch git branch files for changes, I think that for most people wanting to make manual commits, running
git annex sync --content
is a better approach. It does all the same syncing that the assistant would.I've now written a custom solution for myself which uses inotifywait to trigger
annex sync
whenmaster
orsynced/master
is updated.I'm running this on a mesh of remotes which all have the daemon running, so that a manual commit on any remote can be spotted and distributed throughout the network.
However from a synchronisation PoV, this is pretty ugly:
master
and initiates anannex sync
which updates at leastsynced/master
on the other remotes, even if notmaster
due toreceive.denyCurrentBranch
being set torefuse
.synced/master
and each initiateannex sync
.annex sync
at roughly the same time, and the window for weird race conditions is large.However even though the design is ugly, so far I haven't spotted any issues, which is presumably testament to the quality of the locking / synchronisation code within both
git
andgit-annex
. Kudos!Of course I would prefer to ditch my custom hack and use the assistant, but that would require this feature to be added (as well as a solution to assistant sometimes removes and re-adds whole file). I'd happily sponsor development of that but IIUC you aren't accepting sponsorship of individual features, so I'll live with my ugly hack for now until I get round to learning Haskell