Fork me on GitHub
nodegit by tbranyen & faceleg

Commit

new Commit(rawRepo, rawCommit)

Convenience commit constructor.
Parameters:
Name Type Argument Default Description
rawRepo git.raw.Repo Raw repository object.
rawCommit git.raw.Commit <optional>
new git.raw.Commit(rawRepo) Raw commit object.
Source:

Methods

author(callback)

Retrieve the commit's author signature.
Parameters:
Name Type Description
callback Commit~authorCallback
Source:

committer(callback)

Retrieve the commit's committer.
Parameters:
Name Type Description
callback Commit~committerCalback
Source:

file(path, callback)

Retrieve the file represented by path for this commit. Path must be relative to repository root.
Parameters:
Name Type Description
path String
callback Commit~fileCallback
Source:

history() → {EventEmitter}

Walk the history of this commit.
Source:
Fires:
Returns:
Event
Type
EventEmitter

lookup(oid, callback)

Look up the commit referenced by oid, replace this.commit with the result.
Parameters:
Name Type Description
oid Oid | git.raw.Oid | String A representation of an OID used to lookup the commit.
callback Commit~lookupCallback
Source:

message(callback)

Retrieve the message
Parameters:
Name Type Description
callback Commit~messageCallback
Source:

offset(callback)

Retrieve the commit's positive or negative timezone offset, in minutes from UTC.
Parameters:
Name Type Description
callback Commit~offsetCallback
Source:

oid(callback)

Retrieve the commit's OID.
Parameters:
Name Type Description
callback Commit~oidCallback
Source:

parents(callback)

Retrieve the commit's parents.
Parameters:
Name Type Description
callback Function
Source:

parentsDiffTrees(callback)

Get a diff tree showing changes between this commit and its parent(s).
Parameters:
Name Type Description
callback Function
Source:

sha(callback)

Retrieve the SHA.
Parameters:
Name Type Description
callback Commit~shaCallback
Source:

time(callback)

Retrieve the commit time as a unix timestamp in seconds.
Parameters:
Name Type Description
callback Commit~timeCallback
Source:

tree(callback)

Retrieve the tree for this commit.
Parameters:
Name Type Description
callback Commit~treeCallback
Source:

Type Definitions

authorCallback(error, author)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
author Signature | null Retrieved author signature.
Source:

committerCallback(error, committer)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
committer Signature | null Retrieved committer signature.
Source:

fileCallback(error, file)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
file Entry | null Retrieved file entry.
Source:

lookupCallback(error, commit)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
commit Commit | null Retrieved commit object or null.
Source:

messageCallback(error, message)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
message String | null Retrieved message.
Source:

offsetCallback(error, offset)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
offset Integer | null Retrieved offset in in minutes from UTC.
Source:

oidCallback(error, commit)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
commit Oid | null Retrieved OID object or null.
Source:

shaCallback(error, sha)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
sha String | null Retrieved SHA.
Source:

timeCallback(error, time)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
time Integer | null Retrieved time in seconds.
Source:

treeCallback(error, tree)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
tree Tree | null Retrieved tree.
Source:

Events

commit

Commit event.
Parameters:
Name Type Description
error GitError | null An error object if there was an issue, null otherwise.
commit Commit The commit.
Source:

end

End event.
Parameters:
Name Type Description
error GitError | null An error object if there was an issue, null otherwise.
commits Commit[] The commits.
Source: