2013-12-26 22:14:52 +00:00
|
|
|
There are three ways to implement a new special remote:
|
|
|
|
|
|
|
|
1. Using the [[hook]] special remote to tell git-annex what commands
|
|
|
|
to run to store and retrieve data. This is the easiest way, and
|
|
|
|
is great for prototyping.
|
|
|
|
2. Writing it in Haskell and adding it to git-annex.
|
|
|
|
3. Writing a program in any language you like that speaks the
|
2013-12-27 18:15:01 +00:00
|
|
|
[[design/external_special_remote_protocol]].
|
2013-12-26 22:14:52 +00:00
|
|
|
|
2013-12-26 22:20:32 +00:00
|
|
|
The rest of this page concentrates on writing new external special remotes.
|
|
|
|
It's not hard!
|
2013-12-26 22:14:52 +00:00
|
|
|
|
|
|
|
* All you need is to make a program with a name like `git-annex-remote-$bar`.
|
|
|
|
* Install it in PATH.
|
|
|
|
* When the user runs `git annex initremote foo type=external externaltype=$bar`,
|
|
|
|
it will use your program.
|
2013-12-27 07:10:00 +00:00
|
|
|
* If things don't seem to work, pass `--debug` and you'll see, amoung other
|
|
|
|
things, a transcript of git-annex's communication with your program.
|
2013-12-26 22:20:32 +00:00
|
|
|
* If you build a new special remote, please add it to the list
|
|
|
|
of [[special_remotes]].
|
2013-12-26 22:14:52 +00:00
|
|
|
|
|
|
|
Here's a simple shell script example, which can easily be adapted
|
2013-12-27 18:13:52 +00:00
|
|
|
to run whatever commands you need. Or better, re-written in some better
|
2013-12-27 18:15:35 +00:00
|
|
|
language of your choice. See [[design/external_special_remote_protocol]]
|
|
|
|
for the details.
|
2013-12-26 22:14:52 +00:00
|
|
|
|
2013-12-27 18:13:52 +00:00
|
|
|
[[!inline pages="special_remotes/external/example.sh" feeds=no]]
|