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.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final String | |
| private static final Pattern | |
| private static final Pattern | |
| private static final Pattern | |
| private static final Pattern | |
| private static final Pattern |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static String | |
| public static ObjectId | Returns: the change id SHA1 string (without the 'I') or null if the message is not complete enoughThe id of the tree that would be committed treeId, final ObjectId parent id of previous commit or null firstParentId, final PersonIdent the author, final PersonIdent org. for the presumed
author and timethe committer, final String org. for the presumed
committer and timeThe commit message message)Compute a Change-Id. |
| public static int | Returns: the index of the ChangeId footer in the message, or -1 if no ChangeId footer availablea message. message, String the line delimiter, like "\n" or "\r\n", needed to find the
footer delimiter)Return the index in the String |
| public static int | Returns: the index of the first line of the footer paragraph, or lines.length if no footer is availablethe commit message split into lines and the line delimiters
stripped off lines)Find the index of the first line of the footer paragraph in an array of the lines, or lines.length if no footer is available |
| public static String | |
| public static String | |
| private static boolean | |
| private static String |
| CHANGE_ID | back to summary |
|---|---|
| pack-priv static final String CHANGE_ID | |
| changeIdPattern | back to summary |
|---|---|
| private static final Pattern changeIdPattern | |
| footerPattern | back to summary |
|---|---|
| private static final Pattern footerPattern | |
| includeInFooterPattern | back to summary |
|---|---|
| private static final Pattern includeInFooterPattern | |
| signedOffByPattern | back to summary |
|---|---|
| private static final Pattern signedOffByPattern | |
| trailingWhitespace | back to summary |
|---|---|
| private static final Pattern trailingWhitespace | |
| ChangeIdUtil | back to summary |
|---|---|
| public ChangeIdUtil() | |
| clean | back to summary |
|---|---|
pack-priv static String clean(String msg)
| |
| computeChangeId | back to summary |
|---|---|
| public static ObjectId computeChangeId(final ObjectId treeId, final ObjectId firstParentId, final PersonIdent author, final PersonIdent committer, final String message) Compute a Change-Id.
| |
| indexOfChangeId | back to summary |
|---|---|
| public static int indexOfChangeId(String message, String delimiter) Return the index in the String | |
| indexOfFirstFooterLine | back to summary |
|---|---|
| public static int indexOfFirstFooterLine(String[] lines) Find the index of the first line of the footer paragraph in an array of the lines, or lines.length if no footer is available
| |
| insertId | back to summary |
|---|---|
| public static String insertId(String message, ObjectId changeId) Find the right place to insert a Change-Id and return it. The Change-Id is inserted before the first footer line but after a Bug line. | |
| insertId | back to summary |
|---|---|
| public static String insertId(String message, ObjectId changeId, boolean replaceExisting) Find the right place to insert a Change-Id and return it.
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 | |
| isEmptyLine | back to summary |
|---|---|
| private static boolean isEmptyLine(String line) | |
| trimRight | back to summary |
|---|---|
| private static String trimRight(String s) | |