Skip to content

Commit 7316400

Browse files
author
Adam C. Foltzer
committed
add README
1 parent 0612da8 commit 7316400

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Some handy Template Haskell splices for including the current git hash
2+
and branch in the code of your project. Useful for including in panic
3+
messages, `--version` output, or diagnostic info for more informative
4+
bug reports.
5+
6+
Most of the complication in the `GitRev` module is due to the various
7+
places the current git hash might be stored:
8+
9+
1. Detached HEAD: the hash is in `.git/HEAD`
10+
2. On a branch or tag: the hash is in a file pointed to by `.git/HEAD`
11+
in a location like `.git/refs/heads`
12+
3. On a branch or tag but in a repository with packed refs: the hash is
13+
in `.git/packed-refs`
14+
15+
These situations all arise under normal development workflows, but
16+
there might be further scenarios that cause problems. Let me know if
17+
you run into them!

0 commit comments

Comments
 (0)