Copyright | (c) 2015 Adam C. Foltzer 2025 Thomas Bidne |
---|---|
License | BSD3 |
Maintainer | tbidne@protonmail.com |
Safe Haskell | None |
Language | Haskell2010 |
Development.GitRev
Description
Untyped Template Haskell splices for including git information in your project.
Since: 0.1
Synopsis
- gitBranch :: ExpQ
- gitCommitCount :: ExpQ
- gitCommitDate :: ExpQ
- gitDescribe :: ExpQ
- gitDiff :: ExpQ
- gitDirty :: ExpQ
- gitDirtyTracked :: ExpQ
- gitHash :: ExpQ
- gitShortHash :: ExpQ
- gitTree :: ExpQ
Documentation
Return the branch (or tag) name of the current git commit, or UNKNOWN
if not in a git repository. For detached heads, this will just be
HEAD.
Examples
λ. $gitBranch "main"
Since: 0.1
gitCommitCount :: ExpQ Source #
Return the number of commits in the current head.
Examples
λ. $gitCommitCount "47"
Since: 0.1
gitCommitDate :: ExpQ Source #
Return the commit date of the current head.
Examples
λ. $gitCommitDate "Mon Apr 14 22:14:44 2025 +1200"
Since: 0.1
gitDescribe :: ExpQ Source #
Return the long git description for the current git commit, or
UNKNOWN
if not in a git repository.
Examples
λ. $gitDescribe "1.2.0-14-g40b5d7b"
Since: 0.1
Return the diff of the working copy with HEAD.
Examples
λ. $gitDiff "diff ..."
Since: 0.1
Return True
if there are non-committed files present in the
repository.
Examples
λ. $gitDirty False
Since: 0.1
gitDirtyTracked :: ExpQ Source #
Return True
if there are non-commited changes to tracked files
present in the repository.
Examples
λ. $gitDirtyTracked False
Since: 0.1
Return the hash of the current git commit, or UNKNOWN
if not in
a git repository.
Examples
λ. $gitHash "e67e943dd03744d3f93c21f84e127744e6a04543"
Since: 0.1
gitShortHash :: ExpQ Source #
Return the short hash of the current git commit, or UNKNOWN
if not in
a git repository.
Examples
λ. $gitShortHash "e67e943"
Since: 0.1