-
Notifications
You must be signed in to change notification settings - Fork 265
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
explain how to find the hash #28
base: master
Are you sure you want to change the base?
Conversation
@anarcat Mind making this something that gets logged to gittorrentd stdout, rather than in README? That way people will definitely see it. |
You then can use that hash in URLs to clone that repo elsewhere: | ||
|
||
``` | ||
git clone gittorrent://a5491738f6415acb996f98800b33421ea472d2d6/somerepo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hash is the hash of master
Here did another patch. Here is the output:
diff --git a/gittorrentd b/gittorrentd
index 2383bfd..38aa23b 100755
--- a/gittorrentd
+++ b/gittorrentd
@@ -79,13 +79,12 @@ dht.on('ready', function () {
var repos = glob.sync('*/.git/git-daemon-export-ok')
var count = repos.length
repos.forEach(function (repo) {
- console.log('in repo ' + repo)
+ console.log('I will publish the repository found @ ./' + repo)
repo = repo.replace(/git-daemon-export-ok$/, '')
- console.log(repo)
var upload = spawn('git-upload-pack', ['--strict', repo])
upload.stdout.on('data', function (line) {
var lines = line.toString().split('\n')
- lines.forEach(function (line) {
+ lines.forEach(function (line) {
var arr = line.toString().split(' ')
if (arr.length === 2) {
var sha = arr[0].toString()
@@ -143,8 +142,14 @@ dht.on('ready', function () {
])}
console.log(json)
dht.put(opts, function (errors, hash) {
- console.error('errors=', errors)
- console.log('hash=', hash.toString('hex'))
+ if(errors.length > 0) {
+ console.error('errors=', errors)
+ }
+ console.log('You and your friends can now do:');
+ for(reponame in userProfile.repositories) {
+ console.log('git clone gittorrent://' + hash.toString('hex') + '/' + reponame);
+ }
+
})
} |
For smoother on boarding the README must notify that git-remote-gittorrent must in the path for instance: amirouche@gittorrent > PATH=`pwd`:$PATH git clone gittorrent://0178778c22c5a515413be7ab82dc518beaacc53b/f1n2c1t4t10ns |
ping? |
closes #22