Merge branch 'master' of ssh://git-annex.branchable.com

This commit is contained in:
Joey Hess 2020-07-02 10:00:11 -04:00
commit fe1f4632a4
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 134 additions and 0 deletions

View file

@ -0,0 +1,8 @@
[[!comment format=mdwn
username="Ilya_Shlyakhter"
avatar="http://cdn.libravatar.org/avatar/1647044369aa7747829c38b9dcc84df0"
subject="annex.thin for importing from directory special remote"
date="2020-07-01T22:23:58Z"
content="""
As a special case, when importing from a directory special remote, could there be an option to hardlink the files into the repo instead of copying them?
"""]]

View file

@ -0,0 +1,12 @@
[[!comment format=mdwn
username="Lukey"
avatar="http://cdn.libravatar.org/avatar/c7c08e2efd29c692cc017c4a4ca3406b"
subject="comment 6"
date="2020-07-01T20:37:13Z"
content="""
The memory consumption is indeed problematic.
Digging further, I found a even better solution:
\"time (git ls-tree -r git-annex | awk '/SHA256.*.log$/{print $3\" \"$4}' | git cat-file --batch='%(objectname) %(objecttype) %(objectsize) %(rest)' --buffer > /dev/null)\" takes just 7 seconds in my repo.
Note the '%(rest)' in the batch format, awk feeds the objectname and the key (separated by space) to cat-file, which outputs the key in place of '%(rest)'. So a git-annex thread reading from cat-file has all the information (location log and key) readily available. This can be extended to also feed metadata at the same time by making the location log directly followed by metadata.
"""]]