git.iko.soy/typeable/gitrev
on 2ae047b help sign in
typeable/gitrev/Example.hs
15 lines 474 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)
9 , " (", $(gitCommitDate), ")"
10 , " (", $(gitCommitCount), " commits in HEAD)"
11 , dirty, "] ", msg ]
12 dirty | $(gitDirty) = " (uncommitted files present)"
13 | otherwise = ""
15main = panic "oh no!"