githash: Compile git revision info into Haskell projects

[ bsd3, development, library ] [ Propose Tags ] [ Report a vulnerability ]

Please see the README and documentation at https://www.stackage.org/package/githash


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.1.0, 0.1.2.0, 0.1.3.0, 0.1.3.1, 0.1.3.2, 0.1.3.3, 0.1.4.0, 0.1.5.0, 0.1.6.0, 0.1.6.1, 0.1.6.2, 0.1.6.3, 0.1.7.0
Change log ChangeLog.md
Dependencies base (>=4.9.1 && <5), bytestring, directory, filepath, process, template-haskell, th-compat [details]
License BSD-3-Clause
Author Michael Snoyman, Adam C. Foltzer
Maintainer michael@snoyman.com
Category Development
Home page https://github.com/snoyberg/githash#readme
Bug tracker https://github.com/snoyberg/githash/issues
Source repo head: git clone https://github.com/snoyberg/githash
Uploaded by MichaelSnoyman at 2023-06-21T05:05:14Z
Distributions Arch:0.1.6.3, Debian:0.1.4.0, Fedora:0.1.7.0, LTSHaskell:0.1.7.0, NixOS:0.1.7.0, Stackage:0.1.7.0, openSUSE:0.1.7.0
Reverse Dependencies 19 direct, 41 indirect [details]
Downloads 22177 total (242 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2023-06-21 [all 1 reports]

Readme for githash-0.1.7.0

[back to package description]

githash

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!