initial report on hardlink in thin mode

This commit is contained in:
yarikoptic 2020-08-25 15:07:21 +00:00 committed by admin
parent b60723184d
commit 9ae3c552ed

View file

@ -0,0 +1,110 @@
### Please describe the problem.
the goal was to have files unlocked (no symlinks) and gain "efficient" clone which would not consume more space through hardlinks.
But if mode is thin in the clone - we get a copy within the clone
### What steps will reproduce the problem?
[[!format sh """
#!/bin/bash
export PS4='> '
set -x
set -eu
cd "$(mktemp -d ${TMPDIR:-/tmp}/dl-XXXXXXX)"
git annex version | head -n 1
(
mkdir src
cd src
git init
git annex init
git commit --allow-empty -m empty
git annex adjust --unlock
git config annex.thin true
touch 123
git annex add 123
git commit -m 123 123
)
git clone --shared src dest
(
cd dest
# without it it would stall in "get" call
# https://git-annex.branchable.com/bugs/get_is_stuck_unless_a_clone_was_previously_explicitly___34__annex_init__34__ed/
git annex init
git config annex.thin true
git annex get 123
)
: are inodes the same?
ls -lLi {dest,src}/{123,.git/annex/objects/*/*/*/*}
"""]]
### Please provide any additional information below.
[[!format sh """
$> bash check-annex-thin-hardlink.sh
> set -eu
>> mktemp -d /home/yoh/.tmp/dl-XXXXXXX
> cd /home/yoh/.tmp/dl-je8JzWt
> git annex version
> head -n 1
git-annex version: 8.20200810+git47-g27329f0bb-1~ndall+1
> mkdir src
> cd src
> git init
Initialized empty Git repository in /home/yoh/.tmp/dl-je8JzWt/src/.git/
> git annex init
init (scanning for unlocked files...)
ok
(recording state in git...)
> git commit --allow-empty -m empty
[master (root-commit) be447d9] empty
> git annex adjust --unlock
adjust
Switched to branch 'adjusted/master(unlocked)'
ok
> git config annex.thin true
> touch 123
> git annex add 123
add 123
ok
(recording state in git...)
> git commit -m 123 123
[adjusted/master(unlocked) c5db915] 123
1 file changed, 1 insertion(+)
create mode 100644 123
> git clone --shared src dest
Cloning into 'dest'...
done.
> cd dest
> git annex init
init (merging origin/git-annex into git-annex...)
(recording state in git...)
(scanning for unlocked files...)
Repository was cloned with --shared; setting annex.hardlink=true and making repository untrusted.
ok
(recording state in git...)
> git config annex.thin true
> git annex get 123
get 123 (from origin...)
(checksum...) ok
(recording state in git...)
> : are inodes the 'same?'
> ls -lLi dest/123 dest/.git/annex/objects/pX/ZJ/SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 src/123 src/.git/annex/objects/pX/ZJ/SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
49711952 -rw------- 2 yoh yoh 0 Aug 25 11:04 dest/123
49711952 -rw------- 2 yoh yoh 0 Aug 25 11:04 dest/.git/annex/objects/pX/ZJ/SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
49711742 -rw------- 2 yoh yoh 0 Aug 25 11:04 src/123
49711742 -rw------- 2 yoh yoh 0 Aug 25 11:04 src/.git/annex/objects/pX/ZJ/SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
"""]]
[[!meta author=yoh]]
[[!tag projects/datalad]]