smudge: Print a warning when annex.thin is set, as git's smudge interface does not allow honoring that configuration.
This commit is contained in:
parent
c47d7d0f7e
commit
402e5adab8
4 changed files with 23 additions and 4 deletions
|
@ -8,6 +8,7 @@
|
||||||
module Command.Smudge where
|
module Command.Smudge where
|
||||||
|
|
||||||
import Command
|
import Command
|
||||||
|
import qualified Annex
|
||||||
import Annex.Content
|
import Annex.Content
|
||||||
import Annex.Link
|
import Annex.Link
|
||||||
import Annex.FileMatcher
|
import Annex.FileMatcher
|
||||||
|
@ -54,6 +55,8 @@ smudge file = do
|
||||||
ifM (inAnnex k)
|
ifM (inAnnex k)
|
||||||
( do
|
( do
|
||||||
content <- calcRepo (gitAnnexLocation k)
|
content <- calcRepo (gitAnnexLocation k)
|
||||||
|
whenM (annexThin <$> Annex.getGitConfig) $
|
||||||
|
warning $ "Not able to honor annex.thin when git is checking out " ++ file ++ " (run git annex fix to re-thin files)"
|
||||||
liftIO $ B.putStr . fromMaybe b
|
liftIO $ B.putStr . fromMaybe b
|
||||||
=<< catchMaybeIO (B.readFile content)
|
=<< catchMaybeIO (B.readFile content)
|
||||||
, liftIO $ B.putStr b
|
, liftIO $ B.putStr b
|
||||||
|
|
7
debian/changelog
vendored
7
debian/changelog
vendored
|
@ -1,3 +1,10 @@
|
||||||
|
git-annex (6.20160413) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
* smudge: Print a warning when annex.thin is set, as git's smudge
|
||||||
|
interface does not allow honoring that configuration.
|
||||||
|
|
||||||
|
-- Joey Hess <id@joeyh.name> Wed, 13 Apr 2016 13:30:32 -0400
|
||||||
|
|
||||||
git-annex (6.20160412) unstable; urgency=medium
|
git-annex (6.20160412) unstable; urgency=medium
|
||||||
|
|
||||||
* adjust --unlock: Enters an adjusted branch in which all annexed files
|
* adjust --unlock: Enters an adjusted branch in which all annexed files
|
||||||
|
|
|
@ -932,8 +932,8 @@ Here are all the supported configuration settings.
|
||||||
Set this to `true` to make unlocked files be a hard link to their content
|
Set this to `true` to make unlocked files be a hard link to their content
|
||||||
in the annex, rather than a second copy. (Only when supported by the file
|
in the annex, rather than a second copy. (Only when supported by the file
|
||||||
system, and only in repository version 6.) This can save considerable
|
system, and only in repository version 6.) This can save considerable
|
||||||
disk space, but modification made to a file will lose the local (and
|
disk space, but when a modification is made to a file, you will lose the
|
||||||
possibly only) copy of the old version. So, enable with care.
|
local (and possibly only) copy of the old version. So, enable with care.
|
||||||
|
|
||||||
After setting (or unsetting) this, you should run `git annex fix` to
|
After setting (or unsetting) this, you should run `git annex fix` to
|
||||||
fix up the annexed files in the work tree to be hard links (or copies).
|
fix up the annexed files in the work tree to be hard links (or copies).
|
||||||
|
|
|
@ -135,6 +135,11 @@ make the second copy not be worth keeping:
|
||||||
In situations like these, you may want to avoid the overhead of the second
|
In situations like these, you may want to avoid the overhead of the second
|
||||||
local copy of unlocked files. There's a config setting for that.
|
local copy of unlocked files. There's a config setting for that.
|
||||||
|
|
||||||
|
[[!template id=note text="""
|
||||||
|
Note that setting annex.thin only has any effect on systems that support
|
||||||
|
hard links. It is supported on Windows, but not on FAT filesystems.
|
||||||
|
"""]]
|
||||||
|
|
||||||
git config annex.thin true
|
git config annex.thin true
|
||||||
|
|
||||||
After changing annex.thin, you'll want to fix up the work tree to
|
After changing annex.thin, you'll want to fix up the work tree to
|
||||||
|
@ -142,8 +147,12 @@ match the new setting:
|
||||||
|
|
||||||
git annex fix
|
git annex fix
|
||||||
|
|
||||||
Note that setting annex.thin only has any effect on systems that support
|
Unfortunately, git's smudge interface does not let git-annex honor
|
||||||
hard links. It is supported on Windows, but not on FAT filesystems.
|
the annex.thin configuration when git is checking out a file.
|
||||||
|
So, using `git checkout` to check out a different branch, or even
|
||||||
|
`git merge` can result in some non-thin files making their way into the
|
||||||
|
working tree, and using more disk space. A warning will be printed out in
|
||||||
|
this situation. You can always run `git annex fix` to re-thin such files.
|
||||||
|
|
||||||
## tradeoffs
|
## tradeoffs
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue