@@ -29,7 +29,14 @@
29-- > % cabal exec runhaskell Example.hs
29-- > % cabal exec runhaskell Example.hs
30-- > Example.hs: [panic master@2ae047ba5e4a6f0f3e705a43615363ac006099c1 (Mon Jan 11 11:50:59 2016 -0800) (14 commits in HEAD) (uncommitted files present)] oh no!
30-- > Example.hs: [panic master@2ae047ba5e4a6f0f3e705a43615363ac006099c1 (Mon Jan 11 11:50:59 2016 -0800) (14 commits in HEAD) (uncommitted files present)] oh no!
32−module Development.GitRev (gitHash, gitBranch, gitDirty, gitCommitCount, gitCommitDate) where
32+module Development.GitRev
34import Control.Applicative
41import Control.Applicative
35import Control.Exception
42import Control.Exception
@@ -103,6 +110,12 @@ gitBranch :: ExpQ
103gitBranch =
110gitBranch =
104 stringE =<< runGit ["rev-parse", "--abbrev-ref", "HEAD"] "UNKNOWN" IdxNotUsed
111 stringE =<< runGit ["rev-parse", "--abbrev-ref", "HEAD"] "UNKNOWN" IdxNotUsed
113+-- | Return the long git description for the current git commit, or @UNKNOWN@
114+-- it not in a git repository.
117+ stringE =<< runGit ["describe", "--long", "--always"] "UNKNOWN" IdxNotUsed
106-- | Return @True@ if there are non-committed files present in the
119-- | Return @True@ if there are non-committed files present in the
107-- repository
120-- repository
108gitDirty :: ExpQ
121gitDirty :: ExpQ