git-embed-0.1.0: Use TH to embed Git repo information.

Safe HaskellNone
LanguageHaskell2010

Git.Embed

Description

Use Template Haskell to embed Git revision, branch, and tag information.

Also adds dependent files so that changes to Git refs cause a rebuild.

Example:

{-# LANGUAGE TemplateHaskell #-}
import Git.Embed

main :: IO ()
main = putStrLn ("Git revision: " ++ gitRev ++ ", branch: " ++ gitBranch)

gitRev :: String
gitRev = $(embedGitShortRevision)

gitBranch :: String
gitBranch = $(embedGitBranch)

Synopsis

Documentation

embedGitRevision :: Q Exp Source

Embed the current Git long hexadecimal revision ID.

embedGitShortRevision :: Q Exp Source

Embed the current Git short hexadecimal revision ID (first 7 digits).

embedGitBranch :: Q Exp Source

Embed the current Git branch name.

embedGitDescribe Source

Arguments

:: [String]

Arguments to pass to git describe command. Run git help describe for documentation of options.

-> Q Exp 

Embed output of git describe.

embedGit Source

Arguments

:: [String]

Arguments to pass to git command. Run git help for documentation.

-> Q Exp 

Embed output of any Git command.