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

Safe HaskellNone
LanguageHaskell2010

Data.GitEmbed

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 Data.GitEmbed

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.