packages feed

githash 0.1.3.3 → 0.1.4.0

raw patch · 9 files changed

+23/−7 lines, 9 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ GitHash: giDescribe :: GitInfo -> String

Files

ChangeLog.md view
@@ -1,5 +1,9 @@ # ChangeLog for githash +## 0.1.4.0++* Add git-describe output+ ## 0.1.3.3  * Add git-worktree support [#13](https://github.com/snoyberg/githash/issues/13)
LICENSE view
@@ -11,7 +11,7 @@   this list of conditions and the following disclaimer in the documentation   and/or other materials provided with the distribution. -* Neither the name of gitrev nor the names of its+* Neither the name of githash nor the names of its   contributors may be used to endorse or promote products derived from   this software without specific prior written permission. @@ -25,4 +25,3 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.-
README.md view
@@ -1,7 +1,6 @@ # githash -[![Build Status](https://travis-ci.org/snoyberg/githash.svg?branch=master)](https://travis-ci.org/snoyberg/githash)-[![Build status](https://ci.appveyor.com/api/projects/status/g5asio63nfjjhx50/branch/master?svg=true)](https://ci.appveyor.com/project/snoyberg/githash/branch/master)+[![Build Status](https://dev.azure.com/snoyberg/githash/_apis/build/status/snoyberg.githash?branchName=master)](https://dev.azure.com/snoyberg/githash/_build/latest?definitionId=11&branchName=master)  Some handy Template Haskell splices for including the current git hash and branch in the code of your project. Useful for including in panic
githash.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.31.2.+-- This file has been generated from package.yaml by hpack version 0.33.0. -- -- see: https://github.com/sol/hpack ----- hash: dad169c97d7c1d2d5d696f8ca7a5cbdce36b8b181a3c695ffb05681aaa6a226b+-- hash: d5c62b9ed845682638a72f717272a1a46871ad89fc816b8f602622a6a2e17941  name:           githash-version:        0.1.3.3+version:        0.1.4.0 synopsis:       Compile git revision info into Haskell projects description:    Please see the README and documentation at <https://www.stackage.org/package/githash> category:       Development
src/GitHash.hs view
@@ -47,6 +47,7 @@   , giCommitDate   , giCommitCount   , giCommitMessage+  , giDescribe     -- * Creators   , getGitInfo   , getGitRoot@@ -81,6 +82,7 @@   , _giCommitCount :: !Int   , _giFiles :: ![FilePath]   , _giCommitMessage :: !String+  , _giDescribe :: !String   }   deriving (Lift, Show) @@ -111,6 +113,12 @@ giCommitMessage :: GitInfo -> String giCommitMessage = _giCommitMessage +-- | The output of @git describe --always@ for the most recent commit.+--+-- @since 0.1.4.0+giDescribe :: GitInfo -> String+giDescribe = _giDescribe+ -- | Get a list of files from within a @.git@ directory. getGitFilesRegular :: FilePath -> IO [FilePath] getGitFilesRegular git = do@@ -201,6 +209,8 @@   _giCommitDate <- run ["log", "HEAD", "-1", "--format=%cd"]    _giCommitMessage <- run ["log", "-1", "--pretty=%B"]++  _giDescribe <- run ["describe", "--always"]    return GitInfo {..} 
test/GitHashSpec.hs view
@@ -22,3 +22,4 @@             seq (giDirty gi) () `shouldBe` ()             giCommitDate gi `shouldNotBe` []             giCommitCount gi `shouldSatisfy` (>= 1)+            giDescribe gi `shouldStartWith` "githash-"
test/NormalRepoSpec.hs view
@@ -29,6 +29,7 @@                         giCommitDate gi `shouldNotBe` []                         giCommitCount gi `shouldBe` 1                         giCommitMessage gi `shouldBe` "Initial commit"+                        length (giDescribe gi) `shouldBe` 7         describe "getGitRoot" $ do             it "it gets the expected git root for a regular git repository" $ \fp ->                 getGitRoot fp `shouldReturn` Right fp
test/RepoWithASubmoduleSpec.hs view
@@ -31,6 +31,7 @@                                 giCommitDate gi `shouldNotBe` []                                 giCommitCount gi `shouldBe` 1                                 giCommitMessage gi `shouldBe` "Initial commit"+                                length (giDescribe gi) `shouldBe` 7                 sensible fp1                 sensible fp2         describe "getGitRoot" $ do
test/WorktreeRepoSpec.hs view
@@ -29,6 +29,7 @@                         giCommitDate gi `shouldNotBe` []                         giCommitCount gi `shouldBe` 1                         giCommitMessage gi `shouldBe` "Initial commit"+                        length (giDescribe gi) `shouldBe` 7         describe "getGitRoot" $ do             it "it gets the expected git root for a git-worktree repository" $ \fp ->                 getGitRoot fp `shouldReturn` Right fp