Package hudson.plugins.git
Class GitChangeSet
- java.lang.Object
-
- hudson.scm.ChangeLogSet.Entry
-
- hudson.plugins.git.GitChangeSet
-
public class GitChangeSet extends ChangeLogSet.Entry
Represents a change set.- Author:
- Nigel Magnay
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GitChangeSet.Path
-
Constructor Summary
Constructors Constructor Description GitChangeSet(List<String> lines, boolean authorOrCommitter)
Create Git change set using information in given lines.GitChangeSet(List<String> lines, boolean authorOrCommitter, boolean retainFullCommitSummary)
Create Git change set using information in given lines.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(Object o)
User
findOrCreateUser(String csAuthor, String csAuthorEmail, boolean createAccountBasedOnEmail)
Deprecated.User
findOrCreateUser(String csAuthor, String csAuthorEmail, boolean createAccountBasedOnEmail, boolean useExistingAccountWithSameEmail)
Returns user of the change set.Collection<GitChangeSet.Path>
getAffectedFiles()
Collection<String>
getAffectedPaths()
User
getAuthor()
String
getAuthorEmail()
String
getAuthorName()
Gets the author name for this changeset - note that this is mainly here so that we can test authorOrCommitter without needing a fully instantiated Jenkins (which is needed for User.get in getAuthor()).String
getBranch()
String
getComment()
String
getCommentAnnotated()
Gets the comment fully marked up byChangeLogAnnotator
.String
getCommitId()
String
getDate()
String
getId()
String
getMsg()
String
getParentCommit()
Collection<GitChangeSet.Path>
getPaths()
Gets the files that are changed in this commit.String
getRevision()
long
getTimestamp()
int
hashCode()
void
setParent(ChangeLogSet parent)
-
Methods inherited from class hudson.scm.ChangeLogSet.Entry
getMsgAnnotated, getMsgEscaped, getParent
-
-
-
-
Field Detail
-
LOGGER
public static final Logger LOGGER
-
-
Constructor Detail
-
GitChangeSet
public GitChangeSet(List<String> lines, boolean authorOrCommitter)
Create Git change set using information in given lines.- Parameters:
lines
- change set lines read to construct change setauthorOrCommitter
- if true, use author information (name, time), otherwise use committer information
-
GitChangeSet
public GitChangeSet(List<String> lines, boolean authorOrCommitter, boolean retainFullCommitSummary)
Create Git change set using information in given lines.- Parameters:
lines
- change set lines read to construct change setauthorOrCommitter
- if true, use author information (name, time), otherwise use committer informationretainFullCommitSummary
- if true, do not truncate commit summary in the 'Changes' page
-
-
Method Detail
-
getDate
@Exported public String getDate()
-
getAuthorEmail
@Exported public String getAuthorEmail()
-
getTimestamp
public long getTimestamp()
- Overrides:
getTimestamp
in classChangeLogSet.Entry
-
getCommitId
public String getCommitId()
- Overrides:
getCommitId
in classChangeLogSet.Entry
-
setParent
public void setParent(ChangeLogSet parent)
- Overrides:
setParent
in classChangeLogSet.Entry
-
getParentCommit
@CheckForNull public String getParentCommit()
-
getAffectedPaths
public Collection<String> getAffectedPaths()
- Specified by:
getAffectedPaths
in classChangeLogSet.Entry
-
getPaths
@Exported public Collection<GitChangeSet.Path> getPaths()
Gets the files that are changed in this commit.- Returns:
- can be empty but never null.
-
getAffectedFiles
public Collection<GitChangeSet.Path> getAffectedFiles()
- Overrides:
getAffectedFiles
in classChangeLogSet.Entry
-
findOrCreateUser
@Deprecated public User findOrCreateUser(String csAuthor, String csAuthorEmail, boolean createAccountBasedOnEmail)
Deprecated.Returns user of the change set.- Parameters:
csAuthor
- user name.csAuthorEmail
- user email.createAccountBasedOnEmail
- true if create new user based on committer's email.- Returns:
User
-
findOrCreateUser
public User findOrCreateUser(String csAuthor, String csAuthorEmail, boolean createAccountBasedOnEmail, boolean useExistingAccountWithSameEmail)
Returns user of the change set.- Parameters:
csAuthor
- user name.csAuthorEmail
- user email.createAccountBasedOnEmail
- true if create new user based on committer's email.useExistingAccountWithSameEmail
- true if users should be searched for their email attribute- Returns:
User
-
getAuthor
@Exported public User getAuthor()
- Specified by:
getAuthor
in classChangeLogSet.Entry
-
getAuthorName
public String getAuthorName()
Gets the author name for this changeset - note that this is mainly here so that we can test authorOrCommitter without needing a fully instantiated Jenkins (which is needed for User.get in getAuthor()).- Returns:
- author name
-
getMsg
@Exported public String getMsg()
- Specified by:
getMsg
in classChangeLogSet.Entry
-
getId
@Exported public String getId()
-
getRevision
public String getRevision()
-
getComment
@Exported public String getComment()
-
getCommentAnnotated
public String getCommentAnnotated()
Gets the comment fully marked up byChangeLogAnnotator
.- Returns:
- annotated comment
-
getBranch
public String getBranch()
-
-