diff options
author | Joey Hess <joey@kitenet.net> | 2014-04-05 14:44:48 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-04-05 14:44:48 -0400 |
commit | 13fe079e1a7c1ce4269c1ceb8113c3603d8abe9a (patch) | |
tree | a109be360913e7408522c22edfcf4866ae41ed36 | |
parent | 35229f26a496cecc2a85ec2ad3bb54d63d274b63 (diff) |
tiny little protocol between git-remote-daemon and git-annex-shell
Subset of the git-remote-daemon protocol.
-rw-r--r-- | RemoteDaemon/Endpoint/GitAnnexShell/Types.hs | 29 | ||||
-rw-r--r-- | RemoteDaemon/Types.hs | 2 |
2 files changed, 29 insertions, 2 deletions
diff --git a/RemoteDaemon/Endpoint/GitAnnexShell/Types.hs b/RemoteDaemon/Endpoint/GitAnnexShell/Types.hs new file mode 100644 index 000000000..dd8b59d1d --- /dev/null +++ b/RemoteDaemon/Endpoint/GitAnnexShell/Types.hs @@ -0,0 +1,29 @@ +{- git-remote-daemon, git-annex-shell endpoint, datatypes + - + - Copyright 2014 Joey Hess <joey@kitenet.net> + - + - Licensed under the GNU GPL version 3 or higher. + -} + +{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} + +module RemoteDaemon.EndPoint.GitAnnexShell.Types where + +import Common.Annex +import qualified Git.Types as Git +import qualified Utility.SimpleProtocol as Proto +import RemoteDaemon.Types (RemoteName, RefList) + +data Notifications + = CHANGED RemoteName RefList + +instance Proto.Sendable Notifications where + formatMessage (CHANGED remote refs) = + ["CHANGED" + , Proto.serialize remote + , Proto.serialize refs + ] + +instance Proto.Receivable Notifications where + parseCommand "CHANGED" = Proto.parse2 CHANGED diff --git a/RemoteDaemon/Types.hs b/RemoteDaemon/Types.hs index 49813fc89..746b895f6 100644 --- a/RemoteDaemon/Types.hs +++ b/RemoteDaemon/Types.hs @@ -14,8 +14,6 @@ import Common.Annex import qualified Git.Types as Git import qualified Utility.SimpleProtocol as Proto -import Control.Concurrent.STM - -- Messages that the daemon emits. data Emitted = CHANGED RemoteName RefList |