summaryrefslogtreecommitdiff
path: root/doc/bugs/__96__git_annex_import__96___does_not_work_on_other_git_annex_repositories.mdwn
blob: 1580cee812a89a744b84f847a51283509aa9e434 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
### Please describe the problem.

`git annex import otherrepo` does not work.


### What steps will reproduce the problem?

    richih@eudyptes  ~ % mcd killme/git-annex-source
    richih@eudyptes  ~/killme/git-annex-source % git init; git annex init
    Initialized empty Git repository in /home/richih/killme/git-annex-source/.git/
    init  ok
    (Recording state in git...)
    richih@eudyptes (git)-[master] ~/killme/git-annex-source % dd if=/dev/urandom of=foo bs=1M count=1
    1+0 records in
    1+0 records out
    1048576 bytes (1.0 MB) copied, 0.281043 s, 3.7 MB/s
    richih@eudyptes (git)-[master] ~/killme/git-annex-source % git annex add .
    add foo (checksum...) ok
    (Recording state in git...)
    richih@eudyptes (git)-[master] ~/killme/git-annex-source % git commit -m files
    [master (root-commit) 8054eeb] files
     1 file changed, 1 insertion(+)
     create mode 120000 foo
    richih@eudyptes (git)-[master] ~/killme/git-annex-source % mcd ../git-annex-import
    richih@eudyptes  ~/killme/git-annex-import % git init; git annex init
    Initialized empty Git repository in /home/richih/killme/git-annex-import/.git/
    init  ok
    (Recording state in git...)
    richih@eudyptes (git)-[master] ~/killme/git-annex-import % git annex import ../git-annex-source/foo
    richih@eudyptes (git)-[master] ~/killme/git-annex-import % ls

### What version of git-annex are you using? On what operating system?

4.20130920 on Debian Sid


### PS:

To add insult to injury, this does "work":

    ih@eudyptes (git)-[master] ~/killme/git-annex-import % mcd bar
    richih@eudyptes (git)-[master] ~/killme/git-annex-import/bar % git annex import ../../git-annex-source/
    import .git/description (checksum...) ok
    import .git/HEAD (checksum...) ok
    import .git/config (checksum...) ok
    import .git/index (checksum...) ok
    import .git/COMMIT_EDITMSG (checksum...) ok
    import .git/refs/heads/git-annex (checksum...) ok
    import .git/refs/heads/master (checksum...) ok
    import .git/hooks/update.sample (checksum...) ok
    import .git/hooks/applypatch-msg.sample (checksum...) ok
    import .git/hooks/pre-rebase.sample (checksum...) ok
    import .git/hooks/pre-commit.sample (checksum...) ok
    import .git/hooks/pre-applypatch.sample (checksum...) ok
    import .git/hooks/prepare-commit-msg.sample (checksum...) ok
    import .git/hooks/commit-msg.sample (checksum...) ok
    import .git/hooks/post-update.sample (checksum...) ok
    import .git/hooks/pre-push.sample (checksum...) ok
    import .git/hooks/pre-commit (checksum...) ok
    import .git/info/exclude (checksum...) ok
    import .git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 (checksum...) ok
    import .git/objects/a2/6f9bdbe47ada699d537eaa8b6fbfc1e53ef214 (checksum...) ok
    import .git/objects/30/4b790d132863d54313e2380bed17e557944f08 (checksum...) ok
    import .git/objects/ab/09feaa1b55080f42ccfad8c8bb5612f2397c5a (checksum...) ok
    import .git/objects/95/b73ee41ebe8abbd5d8c0c368d1148b5256d4f2 (checksum...) ok
    import .git/objects/2e/96f9962c1baf83c563aa59dcc67e19f21d4b1f (checksum...) ok
    import .git/objects/74/6306e594874907246b2300b3af22f2805dde3e (checksum...) ok
    import .git/objects/5b/11e29d0ef96be4ee73f8dae9b2f525cb808ef1 (checksum...) ok
    import .git/objects/fc/0c0dc4d0579a15c20be29186a27feb2ee77304 (checksum...) ok
    import .git/objects/73/c38d817e0a9f1ef4699551ae83130edd166364 (checksum...) ok
    import .git/objects/c9/80716b5b506515410ca3ad1d88ceae13d8f6f9 (checksum...) ok
    import .git/objects/e2/6cb10dbce11f4065c249183bb085d0afc1b55d (checksum...) ok
    import .git/objects/80/54eeb150b094b0d8483c43ccf2ddf182c71bd3 (checksum...) ok
    import .git/annex/sentinal (checksum...) ok
    import .git/annex/sentinal.cache (checksum...) ok
    import .git/annex/index (checksum...) ok
    import .git/annex/index.lck (checksum...) ok
    import .git/annex/journal.lck (checksum...) ok
    import .git/annex/objects/F7/zw/SHA256E-s1048576--74f3a1a65df608d1c8ae575f83c6ee21a5aeb1a914ca73f202a881f8c3ba8f59/SHA256E-s1048576--74f3a1a65df608d1c8ae575f83c6ee21a5aeb1a914ca73f202a881f8c3ba8f59 
    git-annex: ../../git-annex-source/.git/annex/objects/F7/zw/SHA256E-s1048576--74f3a1a65df608d1c8ae575f83c6ee21a5aeb1a914ca73f202a881f8c3ba8f59/SHA256E-s1048576--74f3a1a65df608d1c8ae575f83c6ee21a5aeb1a914ca73f202a881f8c3ba8f59: rename: permission denied (Permission denied)
    failed
    import .git/logs/HEAD (checksum...) ok
    import .git/logs/refs/heads/git-annex (checksum...) ok
    import .git/logs/refs/heads/master (checksum...) ok
    (Recording state in git...)
    error: Invalid path 'bar/.git/COMMIT_EDITMSG'
    error: unable to add bar/.git/COMMIT_EDITMSG to index
    fatal: adding files failed
    
    git-annex: user error (xargs ["-0","git","--git-dir=/home/richih/killme/git-annex-import/.git","--work-tree=/home/richih/killme/git-annex-import","add","--"] exited 123)
    failed
    git-annex: import: 2 failed
    richih@eudyptes (git)-[master] ~/killme/git-annex-import/bar % ls -la
    total 0
    drwxr-xr-x 3 richih richih  17 Sep 24 01:45 .
    drwxr-xr-x 4 richih richih  38 Sep 24 01:45 ..
    drwxr-xr-x 8 richih richih 152 Sep 24 01:45 .git
    richih@eudyptes (git)-[master] ~/killme/git-annex-import/bar % 

> I have made git-annex import skip .git directories. Of course,
> running it on *any* directory without the --duplicate option
> will result in it moving data to git-annex, so is not advisable
> to do that if you want to keep the data in the directory where it was.
> 
> I am doubtful about special-casing git-annex import to do something
> else when told to import a git-annex repository. It seems a bit of a
> slippery slope to it getting very complicated, which we seem to already be
> further down than I would like. If people are this pissed off about
> git-annex import's behavior,
> I would be inclined to *remove* it. Then you can use `mv` and `git annex
> add`. I originally wrote git-annex import just to avoid needing to run
> those 2 commands myself, and I can make my own local shell script 
> to do that... --[[Joey]]