aboutsummaryrefslogtreecommitdiff
path: root/Remote/Helper/Messages.hs
blob: 01482577603bf10d27d4452b7898c2c4a8bcd3ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{- git-annex remote messages
 -
 - Copyright 2013 Joey Hess <id@joeyh.name>
 -
 - Licensed under the GNU GPL version 3 or higher.
 -}

{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}

module Remote.Helper.Messages where

import Annex.Common
import qualified Git
import qualified Types.Remote as Remote

class Describable a where
	describe :: a -> String

instance Describable Git.Repo where
	describe = Git.repoDescribe

instance Describable (Remote.RemoteA a) where
	describe = Remote.name

instance Describable String where
	describe = id

showChecking :: Describable a => a -> Annex ()
showChecking v = showAction $ "checking " ++ describe v

cantCheck :: Describable a => a -> e
cantCheck v = giveup $ "unable to check " ++ describe v

showLocking :: Describable a => a -> Annex ()
showLocking v = showAction $ "locking " ++ describe v