Please describe the problem.
Executing git annex copy sometimes does not copy the necessary files.
What steps will reproduce the problem?
I do not know how to reproduce it, because it sometimes happens and sometimes not. This is the code I used:
$ git annex findkeys --not --in origin-storage
MD5E-s7265--9885654f68b8e72de9b681c8783b3bf8.yaml
$ git annex copy --not --in origin-storage --to origin-storage
### Note that there is no output
$ git annex findkeys --not --in origin-storage
MD5E-s7265--9885654f68b8e72de9b681c8783b3bf8.yaml
## Still there!
11:00 $ git annex findkeys --not --in origin-storage | git annex copy --batch-keys --to origin-storage
copy MD5E-s7265--9885654f68b8e72de9b681c8783b3bf8.yaml (to origin-storage...)
ok
$ git annex findkeys --not --in origin-storage
## Now the problem is resolved
My expectations are that the second and the fourth command do the same thing, but they don't.
What version of git-annex are you using? On what operating system?
Rocky OS 9 git-annex version: 10.20230926-g44a7b4c9734adfda5912dd82c1aa97c615689f57
Notice that
git annex findkeys --not --in origin-storage
will list all keys that are locally available, but not inorigin-storage
, whilegit annex copy --not --in origin-storage --to origin-storage
will copy over all locally available files not inorigin-storage
that are part of the currently checked out worktree. I.e. one works on keys, while the other works on paths.This means your
findkeys
intocopy
pipe is not equivalent to the plain copy command.Instead, what the copy command does copy is what
git annex find --not --in origin-storage
would return.More concretely, if no file in the current worktree points to
MD5E-s7265--9885654f68b8e72de9b681c8783b3bf8.yaml
then what you observe is expected. If such a file does exist, then this is indeed a bug, I think.