Is there any way to list all of the existing tag and metadata field types? What I mean is, I have files tagged with several different tags, files with several metadata fields; is there any way to list all the tag and field names being used (not all the files WITH those tags)?
For example, something like:
git annex metadata --listfields
lastchanged
month
month-lastchanged
year
year-lastchanged
git annex metadata --listtags
Public
Personal
Work
git-annex doesn't currently have a way to generate those lists itself, but you could use
git annex metadata --json
to get the metadata of all files, and pipe that json into a parser to get the data you want.The output could also be parsed in non-json mode. For example, this will list the tags:
Although it's possible for metadata to contain newlines, and so parsing the json is a more reliable approach.
Another nice way to see all the tags is to switch to a view of all tags: