{"_id":"git-fetch-pack","_rev":"372949","name":"git-fetch-pack","description":"git's smart fetch-pack protocol","dist-tags":{"latest":"0.1.1"},"maintainers":[{"name":"chrisdickinson","email":""}],"time":{"modified":"2021-07-27T06:08:16.000Z","created":"2013-03-24T07:57:15.841Z","0.1.1":"2014-05-14T07:16:40.645Z","0.1.0":"2014-05-14T07:14:05.078Z","0.0.3":"2013-05-06T00:14:55.875Z","0.0.2":"2013-05-04T23:46:05.324Z","0.0.1":"2013-03-24T07:57:15.841Z"},"users":{},"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/git-fetch-pack.git"},"versions":{"0.1.1":{"name":"git-fetch-pack","version":"0.1.1","description":"git's smart fetch-pack protocol","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/git-fetch-pack.git"},"keywords":["git","smart","clone","fetch","protocol"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","gitHead":"7f039633bab60bf9b5fa994ab3bb8529da53c1fe","dependencies":{"emit-function":"0.0.2","through":"~2.2.7","git-packed-ref-parse":"0.0.0","bops":"0.0.3"},"devDependencies":{"git-fs-repo":"0.0.1","git-transport-protocol":"0.1.0","git-walk-refs":"0.0.1"},"bugs":{"url":"https://github.com/chrisdickinson/git-fetch-pack/issues"},"homepage":"https://github.com/chrisdickinson/git-fetch-pack","_id":"git-fetch-pack@0.1.1","dist":{"shasum":"7703a32cf0db80f060d2766a34ac00d02cebcdf5","size":3447,"noattachment":false,"key":"/git-fetch-pack/-/git-fetch-pack-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/git-fetch-pack/download/git-fetch-pack-0.1.1.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":""}],"directories":{},"publish_time":1400051800645,"_cnpm_publish_time":1400051800645,"_hasShrinkwrap":false},"0.1.0":{"name":"git-fetch-pack","version":"0.1.0","description":"git's smart fetch-pack protocol","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/git-fetch-pack.git"},"keywords":["git","smart","clone","fetch","protocol"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","gitHead":"7f039633bab60bf9b5fa994ab3bb8529da53c1fe","dependencies":{"emit-function":"0.0.2","through":"~2.2.7","git-packed-ref-parse":"0.0.0","bops":"0.0.3"},"devDependencies":{"git-fs-repo":"0.0.1","git-transport-protocol":"0.1.0","git-walk-refs":"0.0.1"},"bugs":{"url":"https://github.com/chrisdickinson/git-fetch-pack/issues"},"homepage":"https://github.com/chrisdickinson/git-fetch-pack","_id":"git-fetch-pack@0.1.0","dist":{"shasum":"1adc4c959eacd558b5ce22121d11f9c7fce9ed66","size":3266,"noattachment":false,"key":"/git-fetch-pack/-/git-fetch-pack-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/git-fetch-pack/download/git-fetch-pack-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":""}],"directories":{},"publish_time":1400051645078,"_cnpm_publish_time":1400051645078,"_hasShrinkwrap":false},"0.0.3":{"name":"git-fetch-pack","version":"0.0.3","description":"git's smart fetch-pack protocol","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/git-fetch-pack.git"},"keywords":["git","smart","clone","fetch","protocol"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","gitHead":"7f039633bab60bf9b5fa994ab3bb8529da53c1fe","dependencies":{"emit-function":"0.0.2","through":"~2.2.7","git-packed-ref-parse":"0.0.0","bops":"0.0.3"},"devDependencies":{"git-fs-repo":"0.0.1","git-transport-protocol":"0.0.5","git-walk-refs":"0.0.1"},"readmeFilename":"README.md","_id":"git-fetch-pack@0.0.3","dist":{"shasum":"550db5b694db605942254ce5dedf17ef8b1e3364","size":3269,"noattachment":false,"key":"/git-fetch-pack/-/git-fetch-pack-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/git-fetch-pack/download/git-fetch-pack-0.0.3.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":""}],"directories":{},"publish_time":1367799295875,"_cnpm_publish_time":1367799295875,"_hasShrinkwrap":false},"0.0.2":{"name":"git-fetch-pack","version":"0.0.2","description":"git's smart fetch-pack protocol","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/git-fetch-pack.git"},"keywords":["git","smart","clone","fetch","protocol"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","gitHead":"7f039633bab60bf9b5fa994ab3bb8529da53c1fe","dependencies":{"emit-function":"0.0.2","through":"~2.2.7","git-packed-ref-parse":"0.0.0","bops":"0.0.2"},"devDependencies":{"git-fs-repo":"0.0.1","git-transport-protocol":"0.0.4","git-walk-refs":"0.0.1"},"readmeFilename":"README.md","_id":"git-fetch-pack@0.0.2","dist":{"shasum":"3d43b67110c848f4f974f34274ecbacfefd689b6","size":3266,"noattachment":false,"key":"/git-fetch-pack/-/git-fetch-pack-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/git-fetch-pack/download/git-fetch-pack-0.0.2.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":""}],"directories":{},"publish_time":1367711165324,"_cnpm_publish_time":1367711165324,"_hasShrinkwrap":false},"0.0.1":{"name":"git-fetch-pack","version":"0.0.1","description":"git's smart fetch-pack protocol","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/chrisdickinson/git-fetch-pack.git"},"keywords":["git","smart","clone","fetch","protocol"],"author":{"name":"Chris Dickinson","email":"chris@neversaw.us"},"license":"MIT","gitHead":"7f039633bab60bf9b5fa994ab3bb8529da53c1fe","dependencies":{"emit-function":"0.0.2","through":"~2.2.7","git-packed-ref-parse":"0.0.0"},"devDependencies":{"git-fs-repo":"0.0.1","git-transport-protocol":"0.0.1","git-walk-refs":"0.0.1"},"readmeFilename":"README.md","_id":"git-fetch-pack@0.0.1","dist":{"shasum":"a6dc8e4c559857a985c1f731b78589efb9560aa7","size":3222,"noattachment":false,"key":"/git-fetch-pack/-/git-fetch-pack-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/git-fetch-pack/download/git-fetch-pack-0.0.1.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"chrisdickinson","email":"chris@neversaw.us"},"maintainers":[{"name":"chrisdickinson","email":""}],"directories":{},"publish_time":1364111835841,"_cnpm_publish_time":1364111835841,"_hasShrinkwrap":false}},"readme":"# git-fetch-pack\n\ngit's smart fetch pack protocol (the one that\ncalls `upload-pack` on the server).\n\ncan be used to download packfiles (fetch or clone!) or to list remote branches.\n\n```javascript\nvar net = require('net')\n  , fs = require('fs')\n\nvar gitclient = require('git-fetch-pack')()\n  , transport = require('git-transport-protocol')\n  , load = require('git-fs-repo')\n  , walk = require('git-walk-refs')\n\nload('/path/to/repo/.git', function(err, git) {\n  var refs = git.refs()\n    , hashes = refs.map(function(x) { return x.hash })\n    , tcp = net.connect({host: 'github.com', port: 9418})\n    , client\n\n  // given a want(ref, ready) function and a stream\n  // of all of the commits the repo has in reverse\n  // chronological order, we can negotiate a sweet\n  // packfile from the remote!\n  function want(ref, ready) {\n    if(ref.name === 'refs/heads/master') {\n      return ready(true)\n    }\n    return ready(false)\n  }\n  client = gitclient(\n      'git://github.com/chrisdickinson/plate.git'\n    , want\n    , walk(git.find, hashes)\n  )\n \n  // output ref data from the remote server! `refs`\n  // is a readable stream. \n  client.refs.on('data', console.log)\n\n  // pipe client to the transport and back to client.\n  client\n    .pipe(transport(tcp))\n    .pipe(client)\n\n  // when we get packfile data, it'll come out of this\n  // readable stream.\n  client.pack.pipe(fs.createWriteStream('client-output'))\n})\n```\n\n## API\n\n#### client(hostinfo[, want_function][, have_stream][, capabilities]) -> client duplex stream\n\ncreate a client for communicating with `hostinfo` that uses `want_function`\nto determine which branches to ask for, and can provide a list of already-present\ncommits using `have_stream`.\n\nby providing the `want_function` argument (which takes a `ref` object and a `ready` callback) but no others, you may emulate a `git clone`.\n\nby additionally providing a `have_stream` (usually using [git-walk-refs](http://npm.im/git-walk-refs)), you can emulate a `git fetch`.\n\nby providing `capabilities`, you enable the ability to blow your foot off, mostly; since by default this module does not support either side-band protocol.\n\n\n#### Ref objects\n\n```javascript\n{ \"hash\": \"git hash\"\n, \"name\": \"refs/heads/master\" // for example\n, \"commit\": null | \"hash\" }   // for annotated tags\n```\n\n#### `want_function`\n\n```javascript\nfunction want(ref, ready) {\n  // do you want this ref object?\n  ready(true) // sure do\n  ready() || ready(false) || ready('') // sure don't.\n}\n```\n\n#### stream.pack\n\nA readable stream of packfile data.\n\n#### stream.refs\n\nA readable stream of remote references.\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/chrisdickinson/git-fetch-pack","bugs":{"url":"https://github.com/chrisdickinson/git-fetch-pack/issues"},"license":"MIT"}