From 33c5726a96383d07d96a79c85f95ffd85bb94ad4 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 5 Aug 2021 22:04:20 -1000 Subject: [PATCH] cli: require githash >=0.1.4.0, simplify version code --- hledger/Hledger/Cli/Version.hs | 19 +++++++++---------- hledger/package.yaml | 2 +- stack8.6.yaml | 1 + 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hledger/Hledger/Cli/Version.hs b/hledger/Hledger/Cli/Version.hs index 72c895160..c6254fd93 100644 --- a/hledger/Hledger/Cli/Version.hs +++ b/hledger/Hledger/Cli/Version.hs @@ -13,11 +13,7 @@ module Hledger.Cli.Version ( ) where -#if MIN_VERSION_githash(0,1,4) import GitHash (giDescribe, tGitInfoCwdTry) -#else -import GitHash (giHash, tGitInfoCwdTry) -#endif import System.Info (os, arch) import Hledger.Utils @@ -62,12 +58,15 @@ buildversion = prettify . splitAtElement '.' $ version ++ patchlevel -- | A string representing the version description of the current package versiondescription :: String -> String -versiondescription progname = concat -#if MIN_VERSION_githash(0,1,4) - [progname, " ", either (const buildversion) giDescribe gi, ", ", os', "-", arch] -#else - [progname, " ", buildversion, either (const "") (\x -> ", git revision " ++ giHash x) gi, ", ", os', "-", arch] -#endif +versiondescription progname = concat [ + progname + , " " + , either (const buildversion) giDescribe gi + , ", " + , os' + , "-" + , arch + ] where gi = $$tGitInfoCwdTry os' | os == "darwin" = "mac" diff --git a/hledger/package.yaml b/hledger/package.yaml index 9b8c8d3c5..e16bd2fe0 100644 --- a/hledger/package.yaml +++ b/hledger/package.yaml @@ -109,7 +109,7 @@ dependencies: - directory - extra >=1.6.3 - filepath -- githash >=0.1.2 +- githash >=0.1.4 - haskeline >=0.6 - megaparsec >=7.0.0 && <9.2 - mtl >=2.2.1 diff --git a/stack8.6.yaml b/stack8.6.yaml index a0fac951b..816f916eb 100644 --- a/stack8.6.yaml +++ b/stack8.6.yaml @@ -28,6 +28,7 @@ extra-deps: - prettyprinter-ansi-terminal-1.1.2 - doctest-0.18.1 # for hledger: +- githash-0.1.4.0 # for hledger-ui: # for hledger-web: