Currently with annex.thin=true
, only one copy will be hardlinked so that duplicate copies do not get silently modified. It would be good to have an option such as annex.thinmode
for alternative ways of unlocking files, especially for cases when all files need to be kept unlocked.
annex.thinmode=forcehardlink
In some cases most of the files in the repository will never be modified, and if a file does need to be modified, the hardlink can be first broken by making a copy. This can save a lot of space if git-annex is also used for file level deduplication.
annex.thinmode=reflink
For some copy-on-write filesystems such as BTRFS, reflink copies can be made, such as with
cp --reflink
. This both saves space and also prevents files in .git/annex/objects from being modified.
git-annex-fix can be used to apply these settings to existing repositories.
If your filesystem supports reflinks, you should not need to enable annex.thin, just let git-annex make copies. It makes the copy using
cp --reflink=auto
, so when reflinks are supported, you'll get a nice cheap reflink.WRT annex.thinmode=forcehardlink, this would be something that aimed the gun right at the user's foot and then waits for the trigger to be pulled by any program that ever might write to a file.
I understand
annex.thinmode=forcehardlink
presents a greater risk. Personally that's something I can manage. In case anyone else is interested in doing the same, this patch will makegit annex fix
always create hardlinks withannex.thin=true
.