It is desired to be able to get keys which correspond for some commit which would otherwise be not easy/undesired to checkout (too big tree, tree used actively etc) . But it seems it is impossible to do so ATM:
yoh@typhon:/mnt/DATA/data/yoh/1076_spacetop$ git annex get --branch e6888f70ed97099f83a77d5bcf3372a9a75a2b5e^ '**/*.nii.gz'
git-annex: Can only specify one of file names, --all, --branch, --unused, --failed, --key, or --incomplete
Note that
git-annex
intentionally does not operate on pathspecs, which is being discussed in https://git-annex.branchable.com/bugs/get__47__metadata__47____63____63____63____58___does_not_handle_pathspec_correct/It is possible to use eg
git-annex get --branch foo:subdir/
to operate on a subdirectory, which is enough in many situations. But what you're looking for is pathspec style filtering. I do see the benefit.git ls-tree
also doesn't have a way to filter by pathspec, and that's what--branch
uses. So it would require git-annex reimplement git's pathspecs, which seem complicated and not very well documented. Or there would need to be a way to pass the paths through some other git command to handle the pathspec. I don't know what git command might be able to be used to do that.Aha, --include and --exclude options work with --branch. So:
No need for git's pagespecs when we have git-annex-matching-options!