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 classGitChangeSet.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 booleanequals(Object o)UserfindOrCreateUser(String csAuthor, String csAuthorEmail, boolean createAccountBasedOnEmail)Deprecated.UserfindOrCreateUser(String csAuthor, String csAuthorEmail, boolean createAccountBasedOnEmail, boolean useExistingAccountWithSameEmail)Returns user of the change set.Collection<GitChangeSet.Path>getAffectedFiles()Collection<String>getAffectedPaths()UsergetAuthor()StringgetAuthorEmail()StringgetAuthorName()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()).StringgetBranch()StringgetComment()StringgetCommentAnnotated()Gets the comment fully marked up byChangeLogAnnotator.StringgetCommitId()StringgetDate()StringgetId()StringgetMsg()StringgetParentCommit()Collection<GitChangeSet.Path>getPaths()Gets the files that are changed in this commit.StringgetRevision()longgetTimestamp()inthashCode()voidsetParent(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:
getTimestampin classChangeLogSet.Entry
-
getCommitId
public String getCommitId()
- Overrides:
getCommitIdin classChangeLogSet.Entry
-
setParent
public void setParent(ChangeLogSet parent)
- Overrides:
setParentin classChangeLogSet.Entry
-
getParentCommit
@CheckForNull public String getParentCommit()
-
getAffectedPaths
public Collection<String> getAffectedPaths()
- Specified by:
getAffectedPathsin 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:
getAffectedFilesin 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:
getAuthorin 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:
getMsgin 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()
-
-