Class PullRequestEffectiveDiff

java.lang.Object
com.atlassian.bitbucket.scm.pull.PullRequestEffectiveDiff

public class PullRequestEffectiveDiff extends Object
Describes the commits selected for a pull request's effective diff.

When a pull request is created, the branches to merge from and to are chosen. This represents the pull request's actual diff. However, it is up to the underlying SCM to determine how the branch diff is constructed by choosing the commits that will be used to produce the effective diff, which is the diff that will be streamed by the command factory.

How the commits are selected is left entirely to the SCM. Some possibilities are:

  • A diff between the incoming branch and the common ancestor shared with the target branch
  • A diff between the incoming branch and a theoretical merge commit
The differences between these two theoretical diffs are likely to be subtle in most pull requests, but may be very obvious in others. command factory implementors are encouraged to provide documentation as to how the effective diff is chosen for that implementation to aid plugin developers in understanding the diff that will be generated.
  • Constructor Details

    • PullRequestEffectiveDiff

      public PullRequestEffectiveDiff(@Nonnull String untilId, @Nonnull String sinceId)
  • Method Details

    • equals

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

      @Nonnull public String getSinceId()
      Retrieves the commit which will serve as the ancestor revision when generating a pull request's diff. It is strongly encouraged that this be an actual ancestor of the "until" commit, as arbitrary diffs between unrelated commits may produce useless, noisy diffs.
      Returns:
      the ancestor commit in the diff
    • getUntilId

      @Nonnull public String getUntilId()
      Retrieves the commit which will serve as the tip revision when generating a pull request's diff. The diff will show the changes from the "since" commit up to and including this commit.
      Returns:
      the tip commit in the diff
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object