From 13fe079e1a7c1ce4269c1ceb8113c3603d8abe9a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 5 Apr 2014 14:44:48 -0400 Subject: tiny little protocol between git-remote-daemon and git-annex-shell Subset of the git-remote-daemon protocol. --- RemoteDaemon/Endpoint/GitAnnexShell/Types.hs | 29 ++++++++++++++++++++++++++++ RemoteDaemon/Types.hs | 2 -- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 RemoteDaemon/Endpoint/GitAnnexShell/Types.hs 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 + - + - 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 -- cgit v1.2.3