@@ -29,7 +29,7 @@
2929-- > % cabal exec runhaskell Example.hs
3030-- > Example.hs: [panic master@2ae047ba5e4a6f0f3e705a43615363ac006099c1 (Mon Jan 11 11:50:59 2016 -0800) (14 commits in HEAD) (uncommitted files present)] oh no!
3131
32−module Development.GitRev (gitHash, gitBranch, gitDirty, gitCommitCount, gitCommitDate) where
32+module Development.GitRev (gitHash, gitBranch, gitDirty, gitDirtyTracked, gitCommitCount, gitCommitDate) where
3333
3434import Control.Applicative
3535import Control.Exception
@@ -112,6 +112,15 @@ gitDirty = do
112112 "" -> conE falseName
113113 _ -> conE trueName
114114
115+-- | Return @True@ if there are non-commited changes to tracked files
116+-- present in the repository
117+gitDirtyTracked :: ExpQ
118+gitDirtyTracked = do
119+ output <- runGit ["status", "--porcelain","--untracked-files=no"] "" IdxUsed
120+ case output of
121+ "" -> conE falseName
122+ _ -> conE trueName
123+
115124-- | Return the number of commits in the current head
116125gitCommitCount :: ExpQ
117126gitCommitCount =