git-walk-refs

1.0.0 • Public • Published

git-walk-refs

given a function to lookup hashes, a list of hashes to walk, and an optional hash to stop at, return a readable stream of git commits in (largely) reverse chronological order.

var load = require('git-fs-repo')
  , walk = require('git-walk-refs')
  , fs = require('fs')
 
load(fs, function(err, git) {
  var hashes = git.refs().map(function(ref) {
    return ref.hash
  })
 
  walk(git.find.bind(git), hashes)
    .on('data', console.log)
})
 

API

walk(find function(hash, ready), hash array[, untilhash]) -> walk-stream

create a readable/writable stream of git commits.

walk-stream.write(hash)

mark a hash as "seen" arbitrarily. this is useful for the git smart pack protocol.

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    2
  • 0.0.2
    0
  • 0.0.1
    1

Package Sidebar

Install

npm i git-walk-refs

Weekly Downloads

3

Version

1.0.0

License

MIT

Last publish

Collaborators

  • chrisdickinson