summaryrefslogtreecommitdiff
path: root/doc/sync/comment_2_2f06268709880ce09148e6465bda3fea._comment
blob: 3a72108ad52649c0d88d60fbf1badb14eeba3f75 (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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
[[!comment format=mdwn
 username="https://www.google.com/accounts/o8/id?id=AItOawkS6aFVrEwOrDuQBTMXxtGHtueA69NS_jo"
 nickname="Hans"
 subject="error: unknown option `no-edit'"
 date="2012-08-20T14:27:47Z"
 content="""
This might be a bug, or just me not understanding how to operate git-annex

I'm on git-annex version: 3.20120629~bpo60+1


Two computers will be used in the following hans-vita and ij

At hans-vita

    mkdir test
    cd test
    git init
    git annex init \"my laptop\"
    echo \"some data\" > my.file
    git annex add my.file

At ij I now clone hans-vita

    git clone ssh://hans-vita/home/hans/test ~/test
    Cloning into /home/hans/test...
    remote: Counting objects: 10, done.
    remote: Compressing objects: 100% (7/7), done.
    remote: Total 10 (delta 1), reused 0 (delta 0)
    Receiving objects: 100% (10/10), done.
    Resolving deltas: 100% (1/1), done.
    warning: remote HEAD refers to nonexistent ref, unable to checkout.

Should I worry about that warning?

Continuing, inspite of the warning, at ij

    cd ~/test
    git annex init \"my desktop\"
    init my desktop ok
    (Recording state in git...)

The contents of .git/config at ij is now

    cat .git/config 
    [core]
            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
    [remote \"origin\"]
            fetch = +refs/heads/*:refs/remotes/origin/*
            url = ssh://hans-vita/home/hans/test
    [annex]
            uuid = 415c56ba-eac9-11e1-b0a2-27785ae2fd77
        version = 3

hans-vita needs to be informed about ij, so it has something to sync against

    git remote add ij ssh://ij/home/hans/test

Which makes .git/config at hans-vita look as:

    [core]
            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
    [annex]
            uuid = 76804bf4-eac8-11e1-8c9b-078f858a8817
            version = 3
    [remote \"ij\"]
            url = ssh://ij/home/hans/test
            fetch = +refs/heads/*:refs/remotes/ij/*

git-annex status on hans-vita says

    git-annex status
    supported backends: SHA256 SHA1 SHA512 SHA224 SHA384 SHA256E SHA1E SHA512E SHA224E SHA384E WORM URL
    supported remote types: git bup directory rsync web hook
    trusted repositories: (merging origin/git-annex into git-annex...)
    0
    semitrusted repositories: 3
            00000000-0000-0000-0000-000000000001 -- web
            415c56ba-eac9-11e1-b0a2-27785ae2fd77 -- here (my desktop)
            76804bf4-eac8-11e1-8c9b-078f858a8817 -- origin (my laptop)
    untrusted repositories: 0
    dead repositories: 0
    available local disk space: 369 gigabytes (+1 megabyte reserved)
    local annex keys: 0
    local annex size: 0 bytes
    known annex keys: 0
    known annex size: 0 bytes
    backend usage: 

And on ij, it says

    git-annex status
    supported backends: SHA256 SHA1 SHA512 SHA224 SHA384 SHA256E SHA1E SHA512E SHA224E SHA384E WORM URL
    supported remote types: git bup directory rsync web hook
    trusted repositories: (merging origin/git-annex into git-annex...)
    0
    semitrusted repositories: 3
            00000000-0000-0000-0000-000000000001 -- web
            415c56ba-eac9-11e1-b0a2-27785ae2fd77 -- here (my desktop)
            76804bf4-eac8-11e1-8c9b-078f858a8817 -- origin (my laptop)
    untrusted repositories: 0
    dead repositories: 0
    available local disk space: 369 gigabytes (+1 megabyte reserved)
    local annex keys: 0
    local annex size: 0 bytes
    known annex keys: 0
    known annex size: 0 bytes
    backend usage: 

OK, let's try to sync, start at hans-vita

    git-annex sync
    commit  
    fatal: No HEAD commit to compare with (yet)
    fatal: No HEAD commit to compare with (yet)
    [master (root-commit) 6fdc775] git-annex automatic sync
     1 files changed, 1 insertions(+), 0 deletions(-)
     create mode 120000 my.file
    ok
    pull ij 
    remote: Counting objects: 10, done.
    remote: Compressing objects: 100% (6/6), done.
    remote: Total 8 (delta 2), reused 1 (delta 0)
    Unpacking objects: 100% (8/8), done.
    From ssh://ij/home/hans/test
     * [new branch]      git-annex  -> ij/git-annex
    ok
    (merging ij/git-annex into git-annex...)
    push ij 
    Counting objects: 3, done.
    Delta compression using up to 2 threads.
    Compressing objects: 100% (2/2), done.
    Writing objects: 100% (3/3), 319 bytes, done.
    Total 3 (delta 0), reused 0 (delta 0)
    To ssh://ij/home/hans/test
     * [new branch]      master -> synced/master
    ok

Got two errors, but I guess that is because ij never have run git-annex sync, so there are missing branches.

Try, for the first time ever, git-annex sync from ij:

    git-annex sync
    commit  
    fatal: No HEAD commit to compare with (yet)
    fatal: No HEAD commit to compare with (yet)
    # On branch master
    #
    # Initial commit
    #
    nothing to commit (create/copy files and use \"git add\" to track)
    ok
    fatal: ambiguous argument 'refs/heads/master..refs/heads/synced/master': unknown revision or path not in the working tree.
    Use '--' to separate paths from revisions
    pull origin 
    From ssh://hans-vita/home/hans/test
       bd89f87..9c983a5  git-annex  -> origin/git-annex
     * [new branch]      master     -> origin/master
     * [new branch]      synced/master -> origin/synced/master
    fatal: ambiguous argument 'refs/heads/master..refs/remotes/origin/master': unknown revision or path not in the working tree.
    Use '--' to separate paths from revisions
    ok
    fatal: Not a valid object name: 'master'.
    git-annex: failed to update refs/heads/synced/master

No joy.

What is missing? Some branch? hans-vita has 

    git branch
     git-annex
     * master
     synced/master

    git branch
     git-annex
     synced/master

Does ij need a master of its own? The walkthrough was not enough here for me to understand the requirement, but <http://git-annex.branchable.com/forum/git_pull_remote_git-annex/#comment-e024054af990df6130f9f0a42a6de27a> made me believe that

I need to do this from ij:

    git fetch
    git merge/master

So I did that, and tried again with git-annex sync from ij

    git-annex sync
    commit  
    # On branch master
    nothing to commit (working directory clean)
    ok
    pull origin 
    ok

Great, now, what happens when hans-vita tries to sync?

    git-annex sync
    commit  
    # On branch master
    nothing to commit (working directory clean)
    ok
    pull ij 
    From ssh://ij/home/hans/test
     * [new branch]      master     -> ij/master
    ok

It picks up the new branch at ij, good.

But after I add a file at ij, hans-vita will not sync again. First, here is how I add the file from ij:

    cp ../qog.tex .
    git-annex add .
    add qog.tex (checksum...) ok
    (Recording state in git...)
    git-annex sync
    commit  
    [master 25e00c5] git-annex automatic sync
     Committer: Hans Ekbrand <hans@my.domain>
     1 files changed, 1 insertions(+), 0 deletions(-)
     create mode 120000 qog.tex
    ok
    pull origin 
    ok
    push origin 
    Counting objects: 10, done.
    Delta compression using up to 2 threads.
    Compressing objects: 100% (7/7), done.
    Writing objects: 100% (8/8), 868 bytes, done.
    Total 8 (delta 0), reused 0 (delta 0)
    To ssh://hans-vita/home/hans/test
       9c983a5..19b0a0c  git-annex -> git-annex
       6fdc775..25e00c5  master -> synced/master
    ok

Now, from hans-vita I try git-annex sync

    git-annex sync
    commit  
    # On branch master
    nothing to commit (working directory clean)
    ok
    merge synced/master 
    error: unknown option `no-edit'
    usage: git merge [options] <remote>...
       or: git merge [options] <msg> HEAD <remote>
    
        -n                    do not show a diffstat at the end of the merge
        --stat                show a diffstat at the end of the merge
        --summary             (synonym to --stat)
        --log                 add list of one-line log to merge commit message
        --squash              create a single commit instead of doing a merge
        --commit              perform a commit if the merge succeeds (default)
        --ff                  allow fast-forward (default)
        --ff-only             abort if fast-forward is not possible
        --rerere-autoupdate   update the index with reused conflict resolution if possible
        -s, --strategy <strategy>
                              merge strategy to use
        -X, --strategy-option <option=value>
                              option for selected merge strategy
        -m, --message <message>
                              message to be used for the merge commit (if any)
        -v, --verbose         be more verbose
        -q, --quiet           be more quiet
    
    # On branch master
    nothing to commit (working directory clean)
    ok
    pull ij 
    From ssh://ij/home/hans/test
       9c983a5..19b0a0c  git-annex  -> ij/git-annex
       6fdc775..25e00c5  master     -> ij/master
       6fdc775..25e00c5  synced/master -> ij/synced/master
    
    error: unknown option `no-edit'
    usage: git merge [options] <remote>...
       or: git merge [options] <msg> HEAD <remote>
    
        -n                    do not show a diffstat at the end of the merge
        --stat                show a diffstat at the end of the merge
        --summary             (synonym to --stat)
        --log                 add list of one-line log to merge commit message
        --squash              create a single commit instead of doing a merge
        --commit              perform a commit if the merge succeeds (default)
        --ff                  allow fast-forward (default)
        --ff-only             abort if fast-forward is not possible
        --rerere-autoupdate   update the index with reused conflict resolution if possible
        -s, --strategy <strategy>
                              merge strategy to use
        -X, --strategy-option <option=value>
                              option for selected merge strategy
        -m, --message <message>
                              message to be used for the merge commit (if any)
        -v, --verbose         be more verbose
        -q, --quiet           be more quiet
    
    # On branch master
    nothing to commit (working directory clean)
    ok

I can get the change with pure git, though:

    git fetch ij
    git merge ij/master
    Updating 6fdc775..25e00c5
    Fast-forward
     qog.tex |    1 +
     1 files changed, 1 insertions(+), 0 deletions(-)
     create mode 120000 qog.tex

but git-annex sync no longer works from hans-vita

    git-annex sync
    commit  
    # On branch master
    nothing to commit (working directory clean)
    ok
    pull ij 
    
    error: unknown option `no-edit'
    usage: git merge [options] <remote>...
       or: git merge [options] <msg> HEAD <remote>
    
        -n                    do not show a diffstat at the end of the merge
        --stat                show a diffstat at the end of the merge
        --summary             (synonym to --stat)
        --log                 add list of one-line log to merge commit message
        --squash              create a single commit instead of doing a merge
        --commit              perform a commit if the merge succeeds (default)
        --ff                  allow fast-forward (default)
        --ff-only             abort if fast-forward is not possible
        --rerere-autoupdate   update the index with reused conflict resolution if possible
        -s, --strategy <strategy>
                          merge strategy to use
    -X, --strategy-option <option=value>
                          option for selected merge strategy
    -m, --message <message>
                          message to be used for the merge commit (if any)
    -v, --verbose         be more verbose
    -q, --quiet           be more quiet

    # On branch master
    nothing to commit (working directory clean)
    ok

What did I do wrong?





"""]]