
Eugene Kirpichov
writes: It can be used like this:
{-# LANGUAGE TemplateHaskell #-} import Distribution.VcsRevision.Git import Language.Haskell.TH.Syntax
showMyGitVersion :: String showMyGitVersion = $(do v <- qRunIO getRevision lift $ case v of Nothing -> "<none>" Just (hash,True) -> hash ++ " (with local modifications)" Just (hash,False) -> hash)
Btw, I'm wondering (haven't tried myself), when using TH to generate the version string, does GHC's and/or cabal's dependency tracking
a) reliably refresh the generated hash so that you can be sure it's the git-commit id compiled into the binary is reliable, and
b) avoid re-generating the TH file and redundant recompilation if the git commit-id hasn't changed?
Do you mean all this in the context where this resides in a library rather
On Wed, Feb 22, 2012 at 2:57 PM, Herbert Valerio Riedel
hvr --
-- Eugene Kirpichov Principal Engineer, Mirantis Inc. http://www.mirantis.com/ Editor, http://fprog.ru/