aboutsummaryrefslogtreecommitdiff
path: root/doc/forum/How_to_hide_broken_symlinks.mdwn
blob: 7c92f325143aae601c987f1e5e39d82edb2023a9 (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
This is a method for hiding broken links using git-annex views.

Each annex will need it's own name for this system to work. For this example I'll use "localdrive." After getting file content, run:

    git-annex metadata --not --in=here --metadata in=localdrive . -s in-=localdrive
    git-annex metadata --in=here --not --metadata in=localdrive . -s in+=localdrive
    git-annex view /=*
    git-annex vfilter in=localdrive

Unused links will be hidden. Folder structures will remain the same.

To switch back use:

    git-annex vpop 2

Because this is a lot to type, I've placed these in a bash script in the base folder (ignored with .gitignore so it isn't sent to other repos). The local repo name can be changed by editing THISREPO:

    #!/bin/bash
    
    THISREPO='localdrive'
    
    git-annex metadata --not --in=here --metadata in=$THISREPO . -s in-=$THISREPO
    git-annex metadata --in=here --not --metadata in=$THISREPO . -s in+=$THISREPO
    git-annex view /=*
    git-annex vfilter in=$THISREPO
    
    exit 0

## Hiding Broken Links in Preferred Content Repos

If you have a repo with preferred content settings, this can be shortened to a single script which can be run to "refresh" the view:

    #!/bin/bash
    
    THISREPO='pcrepo'
    
    git-annex vpop 2
    git-annex sync
    git-annex get --auto
    git-annex metadata --not --in=here --metadata in=$THISREPO . -s in-=$THISREPO
    git-annex metadata --in=here --not --metadata in=$THISREPO . -s in+=$THISREPO
    git-annex view /=*
    git-annex vfilter in=$THISREPO
    
    exit 0