tiny little protocol between git-remote-daemon and git-annex-shell

Subset of the git-remote-daemon protocol.
This commit is contained in:
Joey Hess 2014-04-05 14:44:48 -04:00
parent 9b3ca5894b
commit e0b04f2e37
2 changed files with 29 additions and 2 deletions

View file

@ -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

View file

@ -14,8 +14,6 @@ import Common.Annex
import qualified Git.Types as Git import qualified Git.Types as Git
import qualified Utility.SimpleProtocol as Proto import qualified Utility.SimpleProtocol as Proto
import Control.Concurrent.STM
-- Messages that the daemon emits. -- Messages that the daemon emits.
data Emitted data Emitted
= CHANGED RemoteName RefList = CHANGED RemoteName RefList