diff --git a/CHANGELOG b/CHANGELOG index 673e75001b..df0c6cb687 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,8 @@ git-annex (8.20200618) UNRELEASED; urgency=medium * Fix a deadlock that could occur after git-annex got an unlocked file, causing the command to hang indefinitely. Known to happen on vfat filesystems, possibly others. + * Build with the git-lfs library when available, otherwise use the + vendored copy as before. -- Joey Hess Thu, 18 Jun 2020 12:21:14 -0400 diff --git a/Remote/GitLFS.hs b/Remote/GitLFS.hs index 1d2444b050..a829bd39e8 100644 --- a/Remote/GitLFS.hs +++ b/Remote/GitLFS.hs @@ -6,6 +6,7 @@ -} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE CPP #-} module Remote.GitLFS (remote, gen, configKnownUrl) where @@ -39,9 +40,14 @@ import Utility.SshHost import Utility.Url import Logs.Remote import Logs.RemoteState -import qualified Utility.GitLFS as LFS import qualified Git.Config +#ifdef WITH_GIT_LFS +import qualified Network.GitLFS as LFS +#else +import qualified Utility.GitLFS as LFS +#endif + import Control.Concurrent.STM import Data.String import Network.HTTP.Types diff --git a/Utility/GitLFS.hs b/Utility/GitLFS.hs index 82c4808e39..831423502a 100644 --- a/Utility/GitLFS.hs +++ b/Utility/GitLFS.hs @@ -21,6 +21,9 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} +-- This is a vendored copy of Network.GitLFS from the git-lfs package, +-- and will be removed once that package is available in all build +-- environments. module Utility.GitLFS ( -- * Transfer requests TransferRequest(..), diff --git a/git-annex.cabal b/git-annex.cabal index 670f711173..35dd3ef3c5 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -289,6 +289,10 @@ Flag NetworkBSD Description: Build with network-3.0 which split out network-bsd Default: True +Flag GitLfs + Description: Build with git-lfs library (rather than vendored copy) + Default: True + source-repository head type: git location: git://git-annex.branchable.com/ @@ -407,6 +411,12 @@ Executable git-annex else Build-Depends: network (< 3.0.0.0), network (>= 2.6.3.0) + if flag(GitLfs) + Build-Depends: git-lfs (>= 1.1.0) + CPP-Options: -DWITH_GIT_LFS + else + Other-Modules: Utility.GitLFS + if flag(S3) Build-Depends: aws (>= 0.20) CPP-Options: -DWITH_S3 @@ -418,6 +428,7 @@ Executable git-annex Other-Modules: Remote.WebDAV Remote.WebDAV.DavLocation + if flag(S3) || flag(WebDAV) Other-Modules: Remote.Helper.Http @@ -1059,7 +1070,6 @@ Executable git-annex Utility.FileSystemEncoding Utility.Format Utility.FreeDesktop - Utility.GitLFS Utility.Glob Utility.Gpg Utility.Hash diff --git a/stack-lts-12.14.yaml b/stack-lts-12.14.yaml index 93ee338fa7..918a042c6c 100644 --- a/stack-lts-12.14.yaml +++ b/stack-lts-12.14.yaml @@ -12,6 +12,7 @@ flags: debuglocks: false benchmark: false networkbsd: false + gitlfs: true packages: - '.' extra-deps: diff --git a/stack.yaml b/stack.yaml index 487ccfad2d..d2ee985a14 100644 --- a/stack.yaml +++ b/stack.yaml @@ -12,6 +12,7 @@ flags: debuglocks: false benchmark: false networkbsd: false + gitlfs: true packages: - '.' extra-deps: