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
  • Field Details

    • LOGGER

      public static final Logger LOGGER
  • Constructor Details

    • 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 set
      authorOrCommitter - 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 set
      authorOrCommitter - if true, use author information (name, time), otherwise use committer information
      retainFullCommitSummary - if true, do not truncate commit summary in the 'Changes' page
  • Method Details

    • getDate

      @Exported public String getDate()
    • getAuthorEmail

      @Exported public String getAuthorEmail()
    • getTimestamp

      public long getTimestamp()
      Overrides:
      getTimestamp in class ChangeLogSet.Entry
    • getCommitId

      public String getCommitId()
      Overrides:
      getCommitId in class ChangeLogSet.Entry
    • setParent

      public void setParent(ChangeLogSet parent)
      Overrides:
      setParent in class ChangeLogSet.Entry
    • getParentCommit

      @CheckForNull public String getParentCommit()
    • getAffectedPaths

      public Collection<String> getAffectedPaths()
      Specified by:
      getAffectedPaths in class ChangeLogSet.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 class ChangeLogSet.Entry
    • findOrCreateUser

      @Deprecated public User findOrCreateUser(String csAuthor, String csAuthorEmail, boolean createAccountBasedOnEmail)
      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 class ChangeLogSet.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 class ChangeLogSet.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 by ChangeLogAnnotator.
      Returns:
      annotated comment
    • getBranch

      public String getBranch()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object