githash

Compile git revision info into Haskell projects

https://github.com/snoyberg/githash#readme

Version on this page:0.1.2.0
LTS Haskell 22.14:0.1.7.0
Stackage Nightly 2024-03-28:0.1.7.0
Latest on Hackage:0.1.7.0

See all snapshots githash appears in

BSD-3-Clause licensed by Michael Snoyman, Adam C. Foltzer
Maintained by [email protected]
This version can be pinned in stack with:githash-0.1.2.0@sha256:800750160748becd557f4fedd737f998c2d714f4e761ea8f302139ad1d28ac82,1549

Module documentation for 0.1.2.0

githash

Build Status Build status

Some handy Template Haskell splices for including the current git hash and branch in the code of your project. Useful for including in panic messages, --version output, or diagnostic info for more informative bug reports.

Most of the complication in the GitHash module is due to the various places the current git hash might be stored:

  1. Detached HEAD: the hash is in .git/HEAD
  2. On a branch or tag: the hash is in a file pointed to by .git/HEAD in a location like .git/refs/heads
  3. On a branch or tag but in a repository with packed refs: the hash is in .git/packed-refs

These situations all arise under normal development workflows, but there might be further scenarios that cause problems. Let me know if you run into them!

Changes

ChangeLog for githash

0.1.2.0

  • Add tGitInfoTry and tGitInfoCwdTry

0.1.1.0

  • Add message of the most recent commit

0.1.0.1

  • Update the test suite

0.1.0.0

  • Initial release