GitTorrent
GitTorrent copied to clipboard
gittorrentd: Check cwd for .git/, too.
From the commit message:
.git/git-daemon-export-ok may exist relative to the current directory, and the user may not want to supply all repositories from its parent.
Also, if you have a slow computer like I do and have hundreds of cloned repositories, glob('*/...')
can take a very long time, making it seem like nothing's happening.
Will this file ever contain useful information, because it also might conversely be nice to allow users to pass a flag, like --export-all
, to supply all repositories whether or not it has a .git/git-daemon-export-ok
file.
lol, looks like @anarcat made a PR for the same issue right when I did. (#26)
I like that solution more. Still curious about the --export-all
flag, too, though.
well, my thing is different: you seem to be wanting to torrent the git repository in the current directory. my PR adds bare repository support.
i think your PR is still relevant because of POLA...
Oh, I misread your PR (and misunderstood what "bare" meant). I had looked for a way to express the subdirectory being option, without using **
, in glob(...)
, but couldn't find one.
maybe ?(*/)?(.git/)git-daemon-export-ok
?
?()
doesn't seem to do what i think it does. try this instead: {,*/,*/.git/}git-daemon-export-ok
.
That's perfect. How about you just add that to #29 or #26 and I'll close this.
Oh wait, doesn't work if the .git
is in the current directory.
Use this:
glob.sync('{,.git/,*/.git/}git-daemon-export-ok')
:+1: but it's requires a reponame
.
@splinterofchaos #29 was merged, i suggest you reroll this PR...
the reason why i didn't do it was that i wasn't sure it would work with no subdirs... and i couldn't test it easily.
Rebased.
but it's requires a reponame.
Thanks, fixed.
EDIT: Actually, fixed is not the word I'd use: better. Do we use the information of the repository's name to inform peers that our branches/sha's beling to it? I think we need a better way of identifying them as directory names might not correspond one-to-one with repositories.