git.iko.soy/typeable/gitrev
on 6ca8aa1 help sign in
typeable/gitrev/Example.hs
12 lines 345 B history raw
1{-# LANGUAGE TemplateHaskell #-}
2module Example where
3import Development.GitRev
5panic :: String -> a
6panic msg = error panicMsg
7 where panicMsg =
8 concat [ "[panic ", $(gitBranch), "@", $(gitHash), dirty, "] ", msg ]
9 dirty | $(gitDirty) = " (uncommitted files present)"
10 | otherwise = ""
12main = panic "oh no!"