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:
- commit.js, line 12
Methods
-
author(callback)
-
Retrieve the commit's author signature.
Parameters:
Name Type Description callback
Commit~authorCallback - Source:
- commit.js, line 149
-
committer(callback)
-
Retrieve the commit's committer.
Parameters:
Name Type Description callback
Commit~committerCalback - Source:
- commit.js, line 167
-
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:
- commit.js, line 206
-
history() → {EventEmitter}
-
Walk the history of this commit.
- Source:
- commit.js, line 232
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:
- commit.js, line 32
-
message(callback)
-
Retrieve the message
Parameters:
Name Type Description callback
Commit~messageCallback - Source:
- commit.js, line 95
-
offset(callback)
-
Retrieve the commit's positive or negative timezone offset, in minutes from UTC.
Parameters:
Name Type Description callback
Commit~offsetCallback - Source:
- commit.js, line 131
-
oid(callback)
-
Retrieve the commit's OID.
Parameters:
Name Type Description callback
Commit~oidCallback - Source:
- commit.js, line 57
-
parents(callback)
-
Retrieve the commit's parents.
Parameters:
Name Type Description callback
Function - Source:
- commit.js, line 279
-
parentsDiffTrees(callback)
-
Get a diff tree showing changes between this commit and its parent(s).
Parameters:
Name Type Description callback
Function - Source:
- commit.js, line 297
-
sha(callback)
-
Retrieve the SHA.
Parameters:
Name Type Description callback
Commit~shaCallback - Source:
- commit.js, line 71
-
time(callback)
-
Retrieve the commit time as a unix timestamp in seconds.
Parameters:
Name Type Description callback
Commit~timeCallback - Source:
- commit.js, line 113
-
tree(callback)
-
Retrieve the tree for this commit.
Parameters:
Name Type Description callback
Commit~treeCallback - Source:
- commit.js, line 185
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:
- commit.js, line 150
-
committerCallback(error, committer)
-
Parameters:
Name Type Description error
GitError | null An Error or null if successful. committer
Signature | null Retrieved committer signature. - Source:
- commit.js, line 168
-
fileCallback(error, file)
-
Parameters:
Name Type Description error
GitError | null An Error or null if successful. file
Entry | null Retrieved file entry. - Source:
- commit.js, line 207
-
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:
- commit.js, line 33
-
messageCallback(error, message)
-
Parameters:
Name Type Description error
GitError | null An Error or null if successful. message
String | null Retrieved message. - Source:
- commit.js, line 96
-
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:
- commit.js, line 132
-
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:
- commit.js, line 58
-
shaCallback(error, sha)
-
Parameters:
Name Type Description error
GitError | null An Error or null if successful. sha
String | null Retrieved SHA. - Source:
- commit.js, line 72
-
timeCallback(error, time)
-
Parameters:
Name Type Description error
GitError | null An Error or null if successful. time
Integer | null Retrieved time in seconds. - Source:
- commit.js, line 114
-
treeCallback(error, tree)
-
Parameters:
Name Type Description error
GitError | null An Error or null if successful. tree
Tree | null Retrieved tree. - Source:
- commit.js, line 186
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:
- commit.js, line 257
-
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:
- commit.js, line 246