implement GETCONFIG and SETCONFIG

Changed protocol spec to make SETCONFIG only store it persistently when run
during INITREMOTE. I see no reason to support storing it persistently at
other times, and doing so would unnecessarily complicate the code.

Also, letting that be done would probably result in use for storing data that
doesn't really belong there, and special remote authors who don't
understand how the union merging works would probably be surprised the
results.
This commit is contained in:
Joey Hess 2013-12-27 12:37:23 -04:00
parent d8741e571d
commit a7f3724e21
3 changed files with 34 additions and 19 deletions

View file

@ -177,14 +177,17 @@ in control.
creating hash directory structures to store Keys in.
(git-annex replies with VALUE followed by the value.)
* `SETCONFIG Setting`
Sets one of the special remote's configuration settings. These settings
are stored in the git-annex branch, so will be available if the same
special remote is used elsewhere.
(Typically only done during INITREMOTE, although it is accepted at other
times.)
Sets one of the special remote's configuration settings.
Normally this is sent during INITREMOTE, which allows these settings
to be stored in the git-annex branch, so will be available if the same
special remote is used elsewhere. (If sent after INITREMOTE, the changed
configuration will only be available while the remote is running.)
* `GETCONFIG Setting`
Gets one of the special remote's configuration settings.
(git-annex replies with VALUE followed by the value.)
Gets one of the special remote's configuration settings, which can have
been passed by the user when running `git annex initremote`, or
can have been set by a previous SETCONFIG. Can be run at any time.
(git-annex replies with VALUE followed by the value. If the setting is
not set, the value will be empty.)
* `SETSTATE Key Value`
git-annex can store state in the git-annex branch on a
per-special-remote, per-key basis. This sets that state.