Interface CompareService


public interface CompareService
Compares two commits. Commits can be specified by ID or by branch or tag name. For SCMs which have a concept of a short name, such as Git with its shortened SHA-1s and unqualified ref names, the fully-qualified version should be used wherever possible to avoid ambiguity.
  • Method Details

    • getDiffStatsSummary

      @Nonnull DiffStatsSummary getDiffStatsSummary(@Nonnull CompareDiffStatsSummaryRequest request)
      Retrieve the diff stats summary for changes specified by from ref, but not on the to ref.

      The stats summary include the total number of modified files, added lines, and deleted lines.

      Parameters:
      request - can include the repository, starting and terminating commits, paths to filter by and other properties describing the diff
      Returns:
      a DiffStatsSummary for the specified request
      Since:
      9.1
    • streamChanges

      void streamChanges(@Nonnull CompareRequest request, @Nonnull ChangeCallback callback)
      Streams changes contained on the from ref but not on the to ref.

      Note: Change information is not paged. Instead, it is bounded by a hard cap specified by the property page.max.changes. See the configuration documentation for more information.

      Parameters:
      request - describes the refs to compare
      callback - a callback for receiving the changes
    • streamCommits

      void streamCommits(@Nonnull CompareRequest request, @Nonnull CommitCallback callback)
      Streams commits reachable from the from ref but not reachable from the to ref.
      Parameters:
      request - describes the refs to compare
      callback - a callback for receiving the commits
    • streamDiff

      void streamDiff(@Nonnull CompareDiffRequest request, @Nonnull DiffContentCallback callback)
      Streams the diff of the changes contained on the from ref but not on the to ref.

      Note: Diff output is not paged. Instead, it is bounded by hard caps specified by the following properties:

      • page.max.diff.lines, specifying the max number of diff lines to output
      • page.max.source.length, specifying the max length of each diff line
      See the configuration documentation for more information.
      Parameters:
      request - describes the refs to compare
      callback - a callback for receiving the diff output