summaryrefslogtreecommitdiff
path: root/doc/bugs/clean-duplicates_causes_data_loss/comment_3_ed3f40b5798d9e770657e9c6b8e28039._comment
blob: f4c367d9cc2be4a5aa107fe980a46534c4bf4ce3 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
[[!comment format=mdwn
 username="CandyAngel"
 subject="comment 3"
 date="2015-04-29T18:42:38Z"
 content="""
Well, yeah, it is quite surprising as you don't like git-annex messing about with files outside the annex, but one of the commands that does so will cause wanton destruction with barely any checks against data loss.

Oddly, if the origin is marked as dead instead of untrusted, --clean-duplicates doesn't remove anything from /tmp/ga-icd/importme, even though 'import' still knows about the files and has enough information to delete them. Weird.

    + mkdir /tmp/ga-icd
    + cd /tmp/ga-icd
    + git init origin
    Initialized empty Git repository in /tmp/ga-icd/origin/.git/
    + cd origin
    + git commit -m create --allow-empty
    [master (root-commit) 6cfdbc1] create
    + git annex init origin
    init origin ok
    (recording state in git...)
    + echo a
    + echo b
    + git annex add .
    add a ok
    add b ok
    (recording state in git...)
    + git commit -m files
    [master 2c2ed64] files
     2 files changed, 2 insertions(+)
     create mode 120000 a
     create mode 120000 b
    + mkdir /tmp/ga-icd/importme
    + cd /tmp/ga-icd/importme
    + echo a
    + echo b
    + echo c
    + cd /tmp/ga-icd
    + git clone origin import
    Cloning into 'import'...
    done.
    + cd import
    + git annex init import
    init import (merging origin/git-annex into git-annex...)
    ok
    (recording state in git...)
    + cd /tmp/ga-icd/origin
    + git annex drop b --force
    drop b ok
    (recording state in git...)
    + cd /tmp/ga-icd/import
    + git annex dead origin
    dead origin ok
    (recording state in git...)
    + git annex import --clean-duplicates /tmp/ga-icd/importme
    + ls /tmp/ga-icd/import
    a  b
    + ls /tmp/ga-icd/importme/
    a  b  c

I'm think I'm just going to steer clear of it completely (and roll my own) until it is as fussy about preserving data as the rest of git-annex.

(Also, apologies for the original name, I didn't realise it would cause any problems.)
"""]]