summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-01-13 14:00:09 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-01-13 14:00:09 -0400
commitc5caba1e6f0c3308946ab035ae0d71e160b17096 (patch)
tree95dbd26b1953f239a572e86bbef90e65b56125a2
parentf69a115326880ca632f347ced426ce32125c9ddd (diff)
external special remote protocol: Added GETGITDIR.
-rw-r--r--Remote/External.hs1
-rw-r--r--Remote/External/Types.hs2
-rw-r--r--debian/changelog1
-rw-r--r--doc/design/external_special_remote_protocol.mdwn4
4 files changed, 8 insertions, 0 deletions
diff --git a/Remote/External.hs b/Remote/External.hs
index f09589b25..34810c4ac 100644
--- a/Remote/External.hs
+++ b/Remote/External.hs
@@ -230,6 +230,7 @@ handleRequest' lck external req mp responsehandler
send $ CREDS (fst creds) (snd creds)
handleRemoteRequest GETUUID = send $
VALUE $ fromUUID $ externalUUID external
+ handleRemoteRequest GETGITDIR = send . VALUE =<< fromRepo Git.localGitDir
handleRemoteRequest (SETWANTED expr) =
preferredContentSet (externalUUID external) expr
handleRemoteRequest GETWANTED = do
diff --git a/Remote/External/Types.hs b/Remote/External/Types.hs
index 4c62c2f84..c7085e39a 100644
--- a/Remote/External/Types.hs
+++ b/Remote/External/Types.hs
@@ -168,6 +168,7 @@ data RemoteRequest
| SETCREDS Setting String String
| GETCREDS Setting
| GETUUID
+ | GETGITDIR
| SETWANTED PreferredContentExpression
| GETWANTED
| SETSTATE Key String
@@ -184,6 +185,7 @@ instance Receivable RemoteRequest where
parseCommand "SETCREDS" = parse3 SETCREDS
parseCommand "GETCREDS" = parse1 GETCREDS
parseCommand "GETUUID" = parse0 GETUUID
+ parseCommand "GETGITDIR" = parse0 GETGITDIR
parseCommand "SETWANTED" = parse1 SETWANTED
parseCommand "GETWANTED" = parse0 GETWANTED
parseCommand "SETSTATE" = parse2 SETSTATE
diff --git a/debian/changelog b/debian/changelog
index fc1791d19..be9e2e695 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
git-annex (5.20140108) UNRELEASED; urgency=medium
* Added tahoe special remote.
+ * external special remote protocol: Added GETGITDIR.
-- Joey Hess <joeyh@debian.org> Wed, 08 Jan 2014 13:13:54 -0400
diff --git a/doc/design/external_special_remote_protocol.mdwn b/doc/design/external_special_remote_protocol.mdwn
index 3f4cdcb73..85df31681 100644
--- a/doc/design/external_special_remote_protocol.mdwn
+++ b/doc/design/external_special_remote_protocol.mdwn
@@ -212,6 +212,10 @@ in control.
* `GETUUID`
Queries for the UUID of the special remote being used.
(git-annex replies with VALUE followed by the UUID.)
+* `GETGITDIR`
+ Queries for the path to the git directory of the repository that
+ is using the external special remote.
+ (git-annex replies with VALUE followed by the path.)
* `SETWANTED PreferredContentExpression`
Can be used to set the preferred content of a repository. Normally
this is not configured by a special remote, but it may make sense