summaryrefslogtreecommitdiff
path: root/doc/forum/Preserving_Directories_in_Metadata_Views.mdwn
blob: dfc45cb4b6800185a56b835cdb9d89a6e929b7ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
I want to use metadata views to sort files into top-level directories based on a tag, but then preserve the directory structure underneath that. I'm having trouble with this.

Say I have an annex at `~/annex` with a structure like this:

    $ tree
    .
    ├── foo
    │   └── bar
    │       ├── one.txt
    │       ├── three.txt
    │       └── two.txt
    └── waldo
        └── fred
            ├── a.txt
            ├── b.txt
            └── c.txt

I tag some of the files with `blah`:

    $ git annex metadata -t blah foo/bar/*

Now I want to change my view to only see those files with a certain tag, but I want to maintain their directory structure, ie I want to end up with something like this:

    $ tree
    .
    ├── blah
    │   └── foo
    │       └── bar
    │           ├── one.txt
    │           ├── three.txt
    │           └── two.txt

If I do `git annex view blah` I see the files `one.txt`, `two.txt` and `three.txt` but they are in the top level of `~/annex`. The `foo` and `bar` directories are not present.

If I do `git annex view blah "/=*"` then the files I present under the `foo` directory, but the `bar` subdirectory is not there.

It would also be fine if I could just hide the files that did not have the `blah` tag, so that I ended up with this:

    $ tree
    .
    ├── foo
    │   └── bar
    │       ├── one.txt
    │       ├── three.txt
    │       └── two.txt

Is something like this possible?