开发者社区> 镜像站> NPM> ssb-git
ssb-git
logic for working with git-ssb repos
Last updated 4 years ago by cel .
Fair · Original npm · Tarball · package.json
$ cnpm install ssb-git 
SYNC missed versions from official npm registry.

ssb-git

Functions for working with git-ssb messages.

API

var ssbGit = require('ssb-git')

mergeUpdates

var mergeUpdates = ssbGit.merge
var KVGraph = require('kvgraph')

mergeUpdates is a reduce function, for use with kvgraph's reduceRight function. The state reduced is as follows:

{
  refs: [{name: ref, hash: string, link: Msg, title: string},
  refUpdates: {<ref>: integer},
}
  • refs: list of current refs and their values
  • refUpdates: index in refs of which refs are updated. index is -1 if the ref is deleted.
  • head: ref name for symbolic ref HEAD (the repo's default branch)

linearize

var linearize = ssbGit.linearize

Use this with kvgraph's reduceLeft function to get an array of the updates to a repo.

License

Copyright (c) 2016 Charles Lehner

Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument.

DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.

Current Tags

  • 0.5.0                                ...           latest (4 years ago)

6 Versions

  • 0.5.0                                ...           4 years ago
  • 0.4.1                                ...           4 years ago
  • 0.4.0                                ...           4 years ago
  • 0.2.1                                ...           4 years ago
  • 0.2.0                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (0)
None
Dev Dependencies (2)