cjb / GitTorrent

A decentralization of GitHub using BitTorrent and Bitcoin
MIT License
4.75k stars 264 forks source link

make gittorrentd follow symlinks on first level? #24

Closed anarcat closed 9 years ago

anarcat commented 9 years ago

one of the issues i'm having deploying this is to try to put all the repos in the same directory, to work around #23. now that often means using symlinks, as my repositories are spread all over my filesystem...

it seems that gittorrentd doesn't follow symlinks, as it doesn't find the repos with symlinks here...

anarcat@marcos:~$ cd /tmp
anarcat@marcos:tmp$ mkdir test
anarcat@marcos:tmp$ cd test
anarcat@marcos:test$ git init test
Initialized empty Git repository in /tmp/test/test/.git/
anarcat@marcos:test$ touch test/.git/git-daemon-export-ok
anarcat@marcos:test$ touch readme
anarcat@marcos:test$ git add readme
anarcat@marcos:test$ git commit -m"test"
[master (root-commit) a549173] test
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 readme
anarcat@marcos:test$ cd ..
anarcat@marcos:test$ gittorrentd
in repo test/.git/git-daemon-export-ok
test/.git/
Announcing a5491738f6415acb996f98800b33421ea472d2d6 for ref refs/heads/master on repo test/.git/
{"repositories":{"test":{"master":"a5491738f6415acb996f98800b33421ea472d2d6"}}}
^Canarcat@marcos:test$ git init /tmp/test2
Reinitialized existing Git repository in /tmp/test2/.git/
anarcat@marcos:test$ ln -s /tmp/test2 test2
anarcat@marcos:test$ touch test2/git-daemon-export-ok
anarcat@marcos:test$ gittorrentd
in repo test/.git/git-daemon-export-ok
test/.git/
Announcing a5491738f6415acb996f98800b33421ea472d2d6 for ref refs/heads/master on repo test/.git/
{"repositories":{"test":{"master":"a5491738f6415acb996f98800b33421ea472d2d6"}}}
errors= []
hash= 30c2b6a80ec64021b58a592b8b1750433df4c185

notice, above, how test2 is not found.. is there a way to fix that?

anarcat commented 9 years ago

oh, it's not symlinks, it's bare git repos that are not handled... see #25

[pid  4141] lstat("/var/lib/ikiwiki-hosting-web/git/wiki.anarc.at.git/.git/git-daemon-export-ok", 0x7fff6d0291d8) = -1 ENOENT (No such file or directory)