1{- git-annex remote messages
2 -
3 - Copyright 2013 Joey Hess <id@joeyh.name>
4 -
5 - Licensed under the GNU AGPL version 3 or higher.
6 -}
7
8{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
9
10module Remote.Helper.Messages where
11
12import Annex.Common
13import qualified Git
14import qualified Types.Remote as Remote
15
16class Describable a where
17	describe :: a -> String
18
19instance Describable Git.Repo where
20	describe = Git.repoDescribe
21
22instance Describable (Remote.RemoteA a) where
23	describe = Remote.name
24
25instance Describable String where
26	describe = id
27
28cantCheck :: Describable a => a -> e
29cantCheck v = giveup $ "unable to check " ++ describe v
30
31showLocking :: Describable a => a -> Annex ()
32showLocking v = showAction $ "locking " ++ describe v
33