org.eclipse.jgit.api.CommitCommand .
To read a commit object, construct a org.eclipse.jgit.revwalk.RevWalk
and obtain a org.eclipse.jgit.revwalk.RevCommit instance by calling
org.eclipse.jgit.revwalk.RevWalk#parseCommit(AnyObjectId) .
| Modifier and Type | Field and Description |
|---|---|
| private PersonIdent | |
| private static final ObjectId[] | |
| private static final byte[] | |
| private static final byte[] | |
| private static final byte[] | |
| private static final byte[] | |
| private static final byte[] | |
| private ObjectId[] | |
| private ObjectId |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addParentId(AnyObjectId
new parent to add onto the end of the current parent list. additionalParent)Add a parent onto the end of the parent list. |
| public byte[] | build()
Implements abstract org. Format this builder's state as a git object. |
| public PersonIdent | Returns: the author of this commit (who wrote it).Overrides org. Get the author of this commit (who wrote it). |
| public PersonIdent | Returns: the committer and commit time for this object.Get the committer and commit time for this object. |
| public ObjectId[] | |
| public ObjectId | Returns: id of the root tree listing this commit's snapshot.Get id of the root tree listing this commit's snapshot. |
| public void | setAuthor(PersonIdent
the new author. Should not be null. newAuthor)Overrides org. Set the author (name, email address, and date) of who wrote the commit. |
| public void | setCommitter(PersonIdent
the committer information. Should not be null. newCommitter)Set the committer and commit time for this object. |
| public void | |
| public void | setParentIds(AnyObjectId
the first parent of this commit. Typically this is the current
value of the parent1, AnyObjectId HEAD reference and is thus the current
branch's position in history.the second parent of this merge commit. Usually this is the
branch being merged into the current branch. parent2)Set the parents of this commit. |
| public void | setParentIds(ObjectId...
the entire list of parents for this commit. newParents)Set the parents of this commit. |
| public void | setParentIds(List<? extends AnyObjectId>
the entire list of parents for this commit. newParents)Set the parents of this commit. |
| public void | |
| public byte[] | Returns: this object in the canonical commit format, suitable for storage in a repository.Format this builder's state as a commit object. |
| public String |
| committer | back to summary |
|---|---|
| private PersonIdent committer | |
| EMPTY_OBJECTID_LIST | back to summary |
|---|---|
| private static final ObjectId[] EMPTY_OBJECTID_LIST | |
| hauthor | back to summary |
|---|---|
| private static final byte[] hauthor | |
| hcommitter | back to summary |
|---|---|
| private static final byte[] hcommitter | |
| hgpgsig | back to summary |
|---|---|
| private static final byte[] hgpgsig | |
| hparent | back to summary |
|---|---|
| private static final byte[] hparent | |
| htree | back to summary |
|---|---|
| private static final byte[] htree | |
| parentIds | back to summary |
|---|---|
| private ObjectId[] parentIds | |
| treeId | back to summary |
|---|---|
| private ObjectId treeId | |
| CommitBuilder | back to summary |
|---|---|
| public CommitBuilder() Initialize an empty commit. | |
| addParentId | back to summary |
|---|---|
| public void addParentId(AnyObjectId additionalParent) Add a parent onto the end of the parent list.
| |
| build | back to summary |
|---|---|
| public byte[] build() throws UnsupportedEncodingException Implements abstract org. Doc from org. Format this builder's state as a git object.
| |
| getAuthor | back to summary |
|---|---|
| public PersonIdent getAuthor() Overrides org. Get the author of this commit (who wrote it).
| |
| getCommitter | back to summary |
|---|---|
| public PersonIdent getCommitter() Get the committer and commit time for this object.
| |
| getParentIds | back to summary |
|---|---|
| public ObjectId[] getParentIds() Get the ancestors of this commit.
| |
| getTreeId | back to summary |
|---|---|
| public ObjectId getTreeId() Get id of the root tree listing this commit's snapshot.
| |
| setAuthor | back to summary |
|---|---|
| public void setAuthor(PersonIdent newAuthor) Overrides org. Set the author (name, email address, and date) of who wrote the commit.
| |
| setCommitter | back to summary |
|---|---|
| public void setCommitter(PersonIdent newCommitter) Set the committer and commit time for this object.
| |
| setParentId | back to summary |
|---|---|
| public void setParentId(AnyObjectId newParent) Set the parent of this commit.
| |
| setParentIds | back to summary |
|---|---|
| public void setParentIds(AnyObjectId parent1, AnyObjectId parent2) Set the parents of this commit.
| |
| setParentIds | back to summary |
|---|---|
| public void setParentIds(ObjectId... newParents) Set the parents of this commit.
| |
| setParentIds | back to summary |
|---|---|
| public void setParentIds(List<? extends AnyObjectId> newParents) Set the parents of this commit.
| |
| setTreeId | back to summary |
|---|---|
| public void setTreeId(AnyObjectId id) Set the tree id for this commit object.
| |
| toByteArray | back to summary |
|---|---|
| public byte[] toByteArray() throws UnsupportedEncodingException Format this builder's state as a commit object.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |