public class ChangeIdUtil
extends java.lang.Object
A Change-Id is a SHA-1 computed from the content of a commit, in a similar fashion to how the commit id is computed. Unlike the commit id a Change-Id is retained in the commit and subsequent revised commits in the footer of the commit text.
Constructor and Description |
---|
ChangeIdUtil() |
Modifier and Type | Method and Description |
---|---|
static ObjectId |
computeChangeId(ObjectId treeId,
ObjectId firstParentId,
PersonIdent author,
PersonIdent committer,
java.lang.String message)
Compute a Change-Id.
|
static java.lang.String |
insertId(java.lang.String message,
ObjectId changeId)
Find the right place to insert a Change-Id and return it.
|
static java.lang.String |
insertId(java.lang.String message,
ObjectId changeId,
boolean replaceExisting)
Find the right place to insert a Change-Id and return it.
|
public static ObjectId computeChangeId(ObjectId treeId, ObjectId firstParentId, PersonIdent author, PersonIdent committer, java.lang.String message) throws java.io.IOException
treeId
- The id of the tree that would be committedfirstParentId
- parent id of previous commit or nullauthor
- the PersonIdent
for the presumed author and timecommitter
- the PersonIdent
for the presumed committer and timemessage
- The commit messagejava.io.IOException
public static java.lang.String insertId(java.lang.String message, ObjectId changeId)
The Change-Id is inserted before the first footer line but after a Bug line.
message
- changeId
- public static java.lang.String insertId(java.lang.String message, ObjectId changeId, boolean replaceExisting)
If no Change-Id is found the Change-Id is inserted before
the first footer line but after a Bug line.
If Change-Id is found and replaceExisting is set to false,
the message is unchanged.
If Change-Id is found and replaceExisting is set to true,
the Change-Id is replaced with changeId
.
message
- changeId
- replaceExisting
- Copyright © 2012. All Rights Reserved.