{"action":"created","issue":{"url":"https://api.github.com/repos/cjb/GitTorrent/issues/50","labels_url":"https://api.github.com/repos/cjb/GitTorrent/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/cjb/GitTorrent/issues/50/comments","events_url":"https://api.github.com/repos/cjb/GitTorrent/issues/50/events","html_url":"https://github.com/cjb/GitTorrent/pull/50","id":85818466,"number":50,"title":"[RFC] Use `git-upload-pack` for smaller pack files on branches.","user":{"login":"splinterofchaos","id":38515,"avatar_url":"https://avatars.githubusercontent.com/u/38515?v=3","gravatar_id":"","url":"https://api.github.com/users/splinterofchaos","html_url":"https://github.com/splinterofchaos","followers_url":"https://api.github.com/users/splinterofchaos/followers","following_url":"https://api.github.com/users/splinterofchaos/following{/other_user}","gists_url":"https://api.github.com/users/splinterofchaos/gists{/gist_id}","starred_url":"https://api.github.com/users/splinterofchaos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/splinterofchaos/subscriptions","organizations_url":"https://api.github.com/users/splinterofchaos/orgs","repos_url":"https://api.github.com/users/splinterofchaos/repos","events_url":"https://api.github.com/users/splinterofchaos/events{/privacy}","received_events_url":"https://api.github.com/users/splinterofchaos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-06T22:40:50Z","updated_at":"2015-06-09T20:22:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cjb/GitTorrent/pulls/50","html_url":"https://github.com/cjb/GitTorrent/pull/50","diff_url":"https://github.com/cjb/GitTorrent/pull/50.diff","patch_url":"https://github.com/cjb/GitTorrent/pull/50.patch"},"body":"We did use `git-upload-pack` in `gittorrentd` for getting a listing of branches, but I switched that to `git ls-remote` because it's simpler and more to-the-point. Also, the `git-upload-pack` process never exited because we didn't communicate with it, but `git ls-remote` exits when it's printed all the refs. By calling `publish_public_key()` when the stream ends, it won't be called early (as noted in #34).\r\n\r\nI changed the invocation of `git pack-objects` to `git-upload-pack` so that we could generate pack files assuming that the client has `master` (unless that's what we're fetching). I believe this is in line with https://github.com/cjb/GitTorrent/pull/34#issuecomment-108606988, but not quite the solution for #10 (overly complex; clients can't communicate `have`s).\r\n\r\nI added a new module, `./git.js`, and am not sure if it complies with idiomatic js, so let me know if anything should be changed. In particular, I found reading from a stream synchronously very challenging,  considering the statefulness of `git-upload-pack`.\r\n\r\n**EDIT:** I forgot to note, one known problem: sometimes `git-upload-pack` spawns and quits with nothing happening. It seems to only happen when more than one try to run concurrently, but informally trying to run multiple instances at once didn't seem problematic, so I'm not sure why this might happen."},"comment":{"url":"https://api.github.com/repos/cjb/GitTorrent/issues/comments/110494050","html_url":"https://github.com/cjb/GitTorrent/pull/50#issuecomment-110494050","issue_url":"https://api.github.com/repos/cjb/GitTorrent/issues/50","id":110494050,"user":{"login":"splinterofchaos","id":38515,"avatar_url":"https://avatars.githubusercontent.com/u/38515?v=3","gravatar_id":"","url":"https://api.github.com/users/splinterofchaos","html_url":"https://github.com/splinterofchaos","followers_url":"https://api.github.com/users/splinterofchaos/followers","following_url":"https://api.github.com/users/splinterofchaos/following{/other_user}","gists_url":"https://api.github.com/users/splinterofchaos/gists{/gist_id}","starred_url":"https://api.github.com/users/splinterofchaos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/splinterofchaos/subscriptions","organizations_url":"https://api.github.com/users/splinterofchaos/orgs","repos_url":"https://api.github.com/users/splinterofchaos/repos","events_url":"https://api.github.com/users/splinterofchaos/events{/privacy}","received_events_url":"https://api.github.com/users/splinterofchaos/received_events","type":"User","site_admin":false},"created_at":"2015-06-09T20:22:53Z","updated_at":"2015-06-09T20:22:53Z","body":"@cjb Thanks for showing me that. I'll look more at using `git-fetch-pack` when I have time, but merge for now."}}