1[](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
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
15is in `.git/packed-refs`
164. In any of the above situations, if the current repo is checked out
17as a submodule, follow the reference to its `.git` directory first
19These files are added as dependencies to modules that use `GitRev`, and
20so the module should be rebuilt automatically whenever these files
23If you run into further scenarios that cause problems, let me know!
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list