f8bc208e89
I've long been asked for `git-annex find --all` or something like that, but pushed back on it because I feel that the command is analagous to find(1) and so it would be surprising for it to list keys rather than files. So instead, add a new findkeys subcommand. Note that the use of withKeyOptions is rather strange because usually that is used to fall back to --all rather than listing files, but here it's made to default to --all like behavior and never list files. A performance thing that could be improved is that withKeyOptions always reads and caches location logs. But findkeys with no options does not need them, so it could be made faster. That caching does speed up options like --in though. This is really just a subset of a more general performance thing that --all reads location logs sometimes unncessarily. Anyway, it needs to read the location log in order to checkDead, and it seems good that findkeys does skip dead keys. Also, cleaned up comments on git-annex-find man page asking for --all option. Sponsored-by: Dartmouth College's DANDI project
20 lines
827 B
Markdown
20 lines
827 B
Markdown
`git-annex findkeys` would be similar to `git-annex find`, but would find
|
|
all keys in the repository, or all known keys.
|
|
|
|
[[git-annex-find]] has a long comment section with users wanting some way
|
|
to do this, but I am strongly of the opinion that `git-annex find` should
|
|
list files, not keys, like `find(1)` does.
|
|
--[[Joey]]
|
|
|
|
findkeys could support --format like find, but without `${file}`, and
|
|
--print0 and the json options. --batch does not seem very likely to be
|
|
useful? The other options wouldn't apply to it, except for matching options
|
|
like --in that can operate on keys.
|
|
|
|
Like `git-annex find`, findkeys should default to listing only keys
|
|
whose content is present. But when an option like --in=remote
|
|
or --anything is used, it should, like find, not be limited to that.
|
|
|
|
[[!tag projects/dandi]]
|
|
|
|
> [[done]]! --[[Joey]]
|