Git-annex is able to create trees that are a perspective of the "real" tree via adjustment and metadata-driven views.
It would be useful if git-annex was also able to create trees that are the same as the main branch but only include a subset of the files; decided based on internal and external metadata.
Use-cases:
- Only check out subtitles in a specific language to reduce clutter
- Only check out movies in one format
- Only check out images with a certain metadata tag
- Only check out files that are present
Some of these are already possible but would require manual metadata tagging or would result in a totally different tree. This can be confusing to both users and software.
UX examples:
$ ls Movies/
movie.mkv movie.iso movie.mp4 movie.en_US.ass movie.de_DE.ass
$ git annex filterview include=*.mkv
$ ls Movies/
movie.mkv
$ git annex filterview include=*.mp4 or include=*.enUS.ass
$ ls Movies/
movie.mp4 movie.en_US.ass
$ git annex filterview reset
$ ls Movies/
movie.mkv movie.iso movie.mp4 movie.en_US.ass movie.de_DE.ass
$ git annex get Movies
$ git annex filterview in=here
$ ls Movies/
movie.mkv movie.iso movie.mp4 movie.en_US.ass movie.de_DE.ass
$ git annex drop Movies/*.ass
$ ls Movies/
movie.mkv movie.iso movie.mp4
$ ls Photos/Cats/
very_cute.jpg awwwww.jpg :3.jpg
$ git annex filterview year=2022
$ ls Photos/Cats/
very_cute.jpg :3.jpg
Discussion points:
- Should filters be additive or replace the old one?
- Should it be possible to apply a filter to just a subtree?
Another useful feature that is tangentially related would be something like this:
$ git annex filterview root=Movies/
$ ls
movie.mkv movie.iso movie.mp4 movie.en_US.ass movie.de_DE.ass
Most of this can be done with either
git-annex adjust --hide-missing
or views.The only thing that cannot is limiting files to those matching a glob, though views can limit files to the contents of directories.
Unfortunately, adjusted branches and views don't compose. There is a todo about that, unify adjust with view. I think that is what you're looking for, or very close.
Well, ajusted branches and views can be composed now.
Leaving this open for the glob patterns.