git-object-commit

parse and create git commit objects

git-object-commit

git commit objects as javascript objects.

commit objects are immutable once created.

var Buffer = require('buffer').Buffer
  , commit = require('git-object-commit')
 
var b = commit.create(new Buffer(...))
 
= commit.read(<some git buffer>)
 

read a commit from some git buffer data.

create a commit from some source data.

all fields (save for message) may be arrays.

  • author() -> string | undefined
  • authors() -> [string, ...] | []
  • committer() -> string | undefined
  • committers() -> [string, ...] | []
  • parent() -> string | undefined
  • parents() -> [string, ...] | []
  • tree() -> string | undefined
  • trees() -> [string, ...] | []
  • message() -> string
  • attr(attribute) -> [string, ...] | []

MIT