Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gittorrentd: Check cwd for .git/, too. #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

splinterofchaos
Copy link
Collaborator

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.

@splinterofchaos
Copy link
Collaborator Author

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.

@splinterofchaos splinterofchaos deleted the glob-cwd branch May 31, 2015 22:13
@anarcat
Copy link

anarcat commented May 31, 2015

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...

@splinterofchaos splinterofchaos restored the glob-cwd branch May 31, 2015 22:27
@splinterofchaos
Copy link
Collaborator Author

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.

@anarcat
Copy link

anarcat commented May 31, 2015

maybe ?(*/)?(.git/)git-daemon-export-ok?

@anarcat
Copy link

anarcat commented May 31, 2015

?() doesn't seem to do what i think it does. try this instead: {,*/,*/.git/}git-daemon-export-ok.

@splinterofchaos
Copy link
Collaborator Author

That's perfect. How about you just add that to #29 or #26 and I'll close this.

@splinterofchaos
Copy link
Collaborator Author

Oh wait, doesn't work if the .git is in the current directory.

@splinterofchaos
Copy link
Collaborator Author

Use this:

glob.sync('{,.git/,*/.git/}git-daemon-export-ok')

@amirouche
Copy link

👍 but it's requires a reponame.

@anarcat
Copy link

anarcat commented Jun 1, 2015

@splinterofchaos #29 was merged, i suggest you reroll this PR...

@anarcat
Copy link

anarcat commented Jun 1, 2015

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.

.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.
@splinterofchaos
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants