public interface


implements MinimalCommit PropertySupport
Known Indirect Subclasses

Class Overview

Describes a single commit. A commit represents a snapshot of a repository at a given point in time, with additional metadata detailing who authored the commit and when, any message provided, and some number of parents (which may be zero). Parents represent a commit's direct ancestors. Commits generally have a single parent, but:

  • Commits which merge multiple streams of work may have multiple parents
    • For SCMs which support merge commits, the exact number of possible parents is SCM-specific
  • A repository will generally include a "root commit", the first commit to the repository, which will not have a parent
    • Whether or not a repository can have multiple root commits is SCM-specific


Public Methods
@Nonnull Person getAuthor()
@Nonnull Date getAuthorTimestamp()
@Nonnull Person getCommitter()
@Nonnull Date getCommitterTimestamp()
@Nullable String getMessage()
@Nonnull Collection<MinimalCommit> getParents()
@Nullable Repository getRepository()
Retrieves the repository this commit was loaded from, if it's available.
Inherited Methods
From interface com.atlassian.bitbucket.commit.MinimalCommit
From interface

Public Methods

@Nonnull public Person getAuthor ()

  • the person who authored the changes

@Nonnull public Date getAuthorTimestamp ()

  • the timestamp when the changes were authored

@Nonnull public Person getCommitter ()

  • the person who committed the changes

@Nonnull public Date getCommitterTimestamp ()

  • the timestamp when the changes were committed

@Nullable public String getMessage ()

  • the commit message

@Nonnull public Collection<MinimalCommit> getParents ()

  • the commit's parents, which may be empty for the initial commit to a repository but will never be null

@Nullable public Repository getRepository ()

Retrieves the repository this commit was loaded from, if it's available.

Note: For reasons of performance and conciseness this field may be null depending on the service used to construct this commit. If an explicit repository context has been provided by some other mechanism (for example, web-fragments on the commit page will have an explicit 'repository' object in their render context) it is preferable to use that instead of this.

  • the repository that this commit belongs to