Skip to content
This repository was archived by the owner on Jan 3, 2024. It is now read-only.

Expose git tree too #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Development/GitRev.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module Development.GitRev
, gitDirty
, gitDirtyTracked
, gitHash
, gitTree
) where

import Control.Exception
Expand Down Expand Up @@ -178,3 +179,8 @@ gitCommitCount =
gitCommitDate :: ExpQ
gitCommitDate =
stringE =<< runGit ["log", "HEAD", "-1", "--format=%cd"] "UNKNOWN" IdxNotUsed

-- | Return the hash of the current tree
gitTree :: ExpQ
gitTree =
stringE =<< runGit ["show", "HEAD", "--format=%T", "--no-patch"] "UNKNOWN" IdxNotUsed