On BTRFS it is possible to use reflinks / clones. This is the equivalent of hardlinks except that when the file is modified, a copy is performed (copy on write). Perhaps git-annex could detect the availability of this feature and use it in case it is available (and the repository and the file are in the same filesystem).
git-annex has always used cp --reflink=auto, including when it cp's the file in
git annex unlock
.You can verify this with --debug.
I'm trying to share videos across my (many) presentations using annex. My idea was to have a local annex directory remote that is used by all the presentation gits.
However, it seems that copying from a directory special remote does not use reflink. Is that right ?
Thanks for git-annex !
Sylvain
It's true; the directory special remote copies the files in and out. The main reason this is done is to get a useful progress display, which using
cp
wouldn't provide. Of course, if cp were using reflinks, it'd be so fast that a progress display would not be necessary! But often, reflinks cannot be used.It might be a good enhancement for the directory special remote to be configurable to use cp --reflink, or even autodetect if reflinks can be used (although I don't know how it would detect that).
OTOH, you might be better off using
git clone --shared
. Recent versions of git-annex can hard-link objects between shared clones.