On 2011-04-07 at 22:12:54, Joey Hess wrote:
> Well, surely there must be a way to reproduce this by running
> *something* at the command line.
> 
> fatal: 
> '/pub/music/cds/.git-annex/SHA1:305f0714d940ddc9dc1922c5d41b0fef0d48511e.log' 
> is outside repository

Alright, I've made some progress on this.

I have just added a file to my laptop's git-annex and I copied it to my
desktop:

  git annex copy --to egilsstadir Autechre/Oversteps/01-r_ess.mp3

The rsync worked but the git-add failed with the usual message:

  copy Autechre/Oversteps/01-r_ess.mp3 (checking egilsstadir...) (to 
egilsstadir...) 
  SHA1:895c73987dc2d5d1c8ff52c1a63528e19b136d36
      12603602 100%  153.36kB/s    0:01:20 (xfer#1, to-check=0/1)
  fatal: 
'/pub/music/cds/.git-annex/SHA1:895c73987dc2d5d1c8ff52c1a63528e19b136d36.log' 
is outside repository
  Command xargs 
["-0","git","--git-dir=/pub/music/cds/.git","--work-tree=/pub/music/cds","add","--"]
 failed; exit code 123
    git-annex: user error (Command xargs 
["-0","git","--git-dir=/pub/music/cds/.git","--work-tree=/pub/music/cds","add","--"]
 failed; exit code 123)
  git-annex-shell: 1 failed
  
  sent 12605248 bytes  received 31 bytes  130624.65 bytes/sec
  total size is 12603602  speedup is 1.00
  rsync error: syntax or usage error (code 1) at main.c(1070) [sender=3.0.8]
  
    rsync failed -- run git annex again to resume file transfer
  failed
  git-annex: 1 failed

If I log into the box, I can see that it created the file holding the actual 
MP3:

  
/pub/music/cds/.git/annex/objects/SHA1\:895c73987dc2d5d1c8ff52c1a63528e19b136d36/SHA1\:895c73987dc2d5d1c8ff52c1a63528e19b136d36

as well as the log file:

  francois@egilsstadir:/pub/music/cds$ git status
  # On branch master
  # Untracked files:
  #   (use "git add <file>..." to include in what will be committed)
  #
  #     .git-annex/SHA1:895c73987dc2d5d1c8ff52c1a63528e19b136d36.log
  nothing added to commit but untracked files present (use "git add" to track)

If I switch to that directory, I can add the file without problems:

  $ cd /pub/music/cds/
  $ git add -- .git-annex/SHA1:895c73987dc2d5d1c8ff52c1a63528e19b136d36.log

  $ git status
  # On branch master
  # Changes to be committed:
  #   (use "git reset HEAD <file>..." to unstage)
  #
  #     new file:   .git-annex/SHA1:895c73987dc2d5d1c8ff52c1a63528e19b136d36.log
  #

On the other hand, if I do it from another directory, say my homedir:

  $ cd /home/francois/
  $ git --git-dir=/pub/music/cds/.git --work-tree=/pub/music/cds add -- 
/pub/music/cds/.git-annex/SHA1:895c73987dc2d5d1c8ff52c1a63528e19b136d36.log
  fatal: 
'/pub/music/cds/.git-annex/SHA1:895c73987dc2d5d1c8ff52c1a63528e19b136d36.log' 
is outside repository

Note that using a path relative to the working tree does work:

  $ cd /home/francois/
  $ git --git-dir=/pub/music/cds/.git --work-tree=/pub/music/cds add -- 
.git-annex/SHA1:895c73987dc2d5d1c8ff52c1a63528e19b136d36.log

I thought I might be able to replicate this manually by creating a new repo:

  mkdir /tmp/foo
  cd /tmp/foo/
  git init
  echo ".git-annex/*.log merge=union" > .gitattributes
  mkdir .git-annex
  touch .git-annex/notempty
  git add .
  git commit -a -m initial

adding a file with a similar name:

  touch .git-annex/bar.log

and adding it from elsewhere:

  cd /home/francois/
  git --git-dir=/tmp/foo/.git --work-tree=/tmp/foo add -- 
/tmp/foo/.git-annex/bar.log

However that did work. I can't think of anything else might be different between
my simple repo and the git-annex one I've got in /pub/music/cds/.

Cheers,
Francois



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to