From 0166d3c558e0f7a6da63d4ae92eb46596cf69d2c Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Mon, 17 Jun 2024 20:57:23 +0200 Subject: [PATCH] feat: Remove commit hash from version number This reduces our Template Haskell dependencies. The commit hash never made it into the nix-based static executable anyway. Since we'd like to move to produce more executables via nix in the future, it will be hard to maintain the commit hash. --- src/PostgREST/Version.hs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/PostgREST/Version.hs b/src/PostgREST/Version.hs index e551413e0..b59495789 100644 --- a/src/PostgREST/Version.hs +++ b/src/PostgREST/Version.hs @@ -1,14 +1,10 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE CPP #-} module PostgREST.Version ( docsVersion , prettyVersion ) where -import qualified Data.ByteString as BS -import qualified Data.Text as T - -import Development.GitRev (gitHash) +import qualified Data.Text as T import Protolude @@ -17,16 +13,10 @@ version = T.splitOn "." VERSION_postgrest -- | User friendly version number such as '1.1.1'. -- Pre-release versions are tagged as such, e.g., '1.1 (pre-release)'. --- If a git hash is available, it's added to the version, e.g., '1.1.1 (abcdef0)'. prettyVersion :: ByteString prettyVersion = - VERSION_postgrest <> preRelease <> gitRev + VERSION_postgrest <> preRelease where - gitRev = - if $(gitHash) == ("UNKNOWN" :: Text) then - mempty - else - " (" <> BS.take 7 $(gitHash) <> ")" preRelease = if isPreRelease then " (pre-release)" else mempty