git.iko.soy/typeable/gitrev
on 2ae047b help sign in
typeable/gitrev/README.md
19 lines 861 B history raw
1[![Build Status](https://travis-ci.org/acfoltzer/gitrev.svg?branch=master)](https://travis-ci.org/acfoltzer/gitrev)
3Some handy Template Haskell splices for including the current git hash
4and branch in the code of your project. Useful for including in panic
5messages, `--version` output, or diagnostic info for more informative
6bug reports.
8Most of the complication in the `GitRev` module is due to the various
9places the current git hash might be stored:
111. Detached HEAD: the hash is in `.git/HEAD`
122. On a branch or tag: the hash is in a file pointed to by `.git/HEAD`
13in a location like `.git/refs/heads`
143. On a branch or tag but in a repository with packed refs: the hash is
15in `.git/packed-refs`
17These situations all arise under normal development workflows, but
18there might be further scenarios that cause problems. Let me know if
19you run into them!