git ssb


0+

cel / ssb-git-repo



Branch:

cel committed 2.6.1Latest: c88af2a on 1/19/2017, 5:08:18 PM
📄README.md
📄index.js
📁lib
📄package.json
📁test

ssb-git-repo

Host git repos in secure-scuttlebutt

Example

var ssbGit = require('ssb-git-repo')
var repoId = '%CBeVWA9eYt6OhJDXFtqas6kWb5LwaJxYtfwDazKvh4U=.sha256'

// get a single repo:
ssbGit.getRepo(sbot, repoId, function (err, repo) {
  if (err) throw err
  // do something with the repo
})

API

ssbGit.createRepo(sbot[, options], cb(err, repo))

Create a repo. Publishes a message announcing the new repo.

ssbGit.getRepo(sbot, msgOrId[, options], cb(err, repo))

Get a repo.

ssbGit.repos(sbot, options): source(repo)

Get repos from the feed

ssbGit.Repo

An abstract-pull-git-repo-compliant git repo object. Additional methods and properties:

repo.private: boolean

Whether the repo is private (true), or public (false)

repo.recps: [feedId...]?

Feed ids that have access to the repo if it is private.

repo.close(cb(err))

Close the repo's update stream.

repo.getHead(cb(err, head))

Get the repo's HEAD, i.e. the "default branch" ref, e.g. `"refs/heads/master"

repo.hasObjectQuick(hash) : has

Check for the presence of a commit hash, with possible false negatives.

This will only show an object as present if it was pushed in ssb-git-repo

= v1.9.0.

repo.getLatestAvailableRev(ref, timeout, cb(err, rev, numSkipped))

Get the latest revision for a ref that can be rendered. Try to retrieve the latest revision for a ref, and after a timeout try to retrieve the next latest, etc.

Schema

type: git-repo

{ type: 'git-repo' }

Creates a git repo. Note that you can actually push git objects to any message in your feed, but the git-repo type is here to declare that a message will be for a git repo. It may have properties added later.

type: git-update

{
  type: 'git-update',
  repo: MsgId,
  repoBranch: [ MsgId ]?,
  refsBranch: [ MsgId ]?,
  refs: { <ref>: String|null }?,
  packs: [ BlobLink ]?,
  indexes: [ BlobLink ]?,
  head: string?,
  commits: [ {
    sha1: String,
    title: String,
    body: String?,
    parents: [ String ]?,
  } ]?,
  commits_more: Number?,
  num_objects: Number?,
  object_ids: [ String ]?,
}

Updates a repo. Published as a result of git push.

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.


Built with git-ssb-web