unify fields and tags

This commit is contained in:
Joey Hess 2014-02-11 16:27:27 -04:00
parent faed5d3cc2
commit b7ffe599e8
Failed to extract signature

View file

@ -2,16 +2,14 @@
# metadata # metadata
Attach an arbitrary set of metadata to a key. Attach an arbitrary set of metadata to a key. This consists of any number
of fields. Each field has an unordered set of values. The special field
"tag" has as its values any tags that are set for the key.
Store in git-annex branch, next to location log files. Store in git-annex branch, next to location log files.
Metadata can be tags, but it can also be fields with values (ie, date=xxx, Storage needs to support union merging, including removing an old value
conference=yyy). Fields can have multiple values, for example of a field, and adding a new value of a field.
multiple authors.
Storage needs to support union merging, including removing tags, and
changing values.
## automatically added metadata ## automatically added metadata
@ -33,9 +31,6 @@ metadata is derived, at least year=yyyy and probably also month, etc.
This is probably not stored anywhere. It's computed on demand by a pure This is probably not stored anywhere. It's computed on demand by a pure
function from the other metadata. function from the other metadata.
From the set of tags a file has, a "tag" field is derived, which has the
value of each tag. See example below.
Should be a general mechanism for this. (It probably generalizes to Should be a general mechanism for this. (It probably generalizes to
sql queries if we want to go that far.) sql queries if we want to go that far.)
@ -65,10 +60,8 @@ filtered/year=2012,2013,2014/talk/conference=fosdem,icfp. Now there
are nested subdirectories. They follow the format of the branch, are nested subdirectories. They follow the format of the branch,
so 2013/icfp, 2014/fosdem, etc. so 2013/icfp, 2014/fosdem, etc.
`git annex filter tag=haskell,debian` uses the "tag" field that is `git annex filter tag=haskell,debian` yields a branch with haskell
automatically derived from the set of tags. So this yields a branch and debian subdirectories.
with haskell and debian subdirectories, containing the files tagged with
either.
To see all tags, `git annex filter tag=*` ! To see all tags, `git annex filter tag=*` !