org.eclipse.egit.github.core.service
Class CommitService

java.lang.Object
  extended by org.eclipse.egit.github.core.service.GitHubService
      extended by org.eclipse.egit.github.core.service.CommitService

public class CommitService
extends GitHubService

Service for interacting with repository commits

See Also:
GitHub commit API documentation

Field Summary
 
Fields inherited from class org.eclipse.egit.github.core.service.GitHubService
ACCEPT_FULL, ACCEPT_HTML, ACCEPT_TEXT, client
 
Constructor Summary
CommitService()
          Create commit service
CommitService(GitHubClient client)
          Create commit service
 
Method Summary
 CommitComment addComment(IRepositoryIdProvider repository, String sha, CommitComment comment)
          Add comment to given commit
 RepositoryCommitCompare compare(IRepositoryIdProvider repository, String base, String head)
          Compare base and head commits
 void deleteComment(IRepositoryIdProvider repository, long commentId)
          Delete commit comment with given id from given repository
 CommitComment editComment(IRepositoryIdProvider repository, CommitComment comment)
          Edit given comment
 CommitComment getComment(IRepositoryIdProvider repository, long commentId)
          Get commit comment with given id
 List<CommitComment> getComments(IRepositoryIdProvider repository, String sha)
          Get all comments on commit with given SHA-1
 RepositoryCommit getCommit(IRepositoryIdProvider repository, String sha)
          Get commit with given SHA-1 from given repository
 List<RepositoryCommit> getCommits(IRepositoryIdProvider repository)
          Get all commits in given repository
 List<RepositoryCommit> getCommits(IRepositoryIdProvider repository, String sha, String path)
          Get all commits in given repository beginning at an optional commit SHA-1 and affecting an optional path.
 PageIterator<CommitComment> pageComments(IRepositoryIdProvider repository, String sha)
          Page comments on commit with given SHA-1
 PageIterator<CommitComment> pageComments(IRepositoryIdProvider repository, String sha, int size)
          Page comments on commit with given SHA-1
 PageIterator<CommitComment> pageComments(IRepositoryIdProvider repository, String sha, int start, int size)
          Page comments on commit with given SHA-1
 PageIterator<RepositoryCommit> pageCommits(IRepositoryIdProvider repository)
          Page commits in given repository
 PageIterator<RepositoryCommit> pageCommits(IRepositoryIdProvider repository, int size)
          Page commits in given repository
 PageIterator<RepositoryCommit> pageCommits(IRepositoryIdProvider repository, String sha, String path)
          Page commits in given repository
 PageIterator<RepositoryCommit> pageCommits(IRepositoryIdProvider repository, String sha, String path, int size)
          Page commits in given repository
 
Methods inherited from class org.eclipse.egit.github.core.service.GitHubService
check, createPagedRequest, createPagedRequest, createPageIterator, createRequest, getAll, getAll, getClient, getId, verifyRepository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommitService

public CommitService()
Create commit service


CommitService

public CommitService(GitHubClient client)
Create commit service

Parameters:
client -
Method Detail

getCommits

public List<RepositoryCommit> getCommits(IRepositoryIdProvider repository)
                                  throws IOException
Get all commits in given repository

Parameters:
repository -
Returns:
non-null but possibly empty list of repository commits
Throws:
IOException

getCommits

public List<RepositoryCommit> getCommits(IRepositoryIdProvider repository,
                                         String sha,
                                         String path)
                                  throws IOException
Get all commits in given repository beginning at an optional commit SHA-1 and affecting an optional path.

Parameters:
repository -
sha -
path -
Returns:
non-null but possibly empty list of repository commits
Throws:
IOException

pageCommits

public PageIterator<RepositoryCommit> pageCommits(IRepositoryIdProvider repository)
Page commits in given repository

Parameters:
repository -
Returns:
page iterator

pageCommits

public PageIterator<RepositoryCommit> pageCommits(IRepositoryIdProvider repository,
                                                  int size)
Page commits in given repository

Parameters:
repository -
size -
Returns:
page iterator

pageCommits

public PageIterator<RepositoryCommit> pageCommits(IRepositoryIdProvider repository,
                                                  String sha,
                                                  String path)
Page commits in given repository

Parameters:
repository -
sha -
path -
Returns:
page iterator

pageCommits

public PageIterator<RepositoryCommit> pageCommits(IRepositoryIdProvider repository,
                                                  String sha,
                                                  String path,
                                                  int size)
Page commits in given repository

Parameters:
repository -
sha -
path -
size -
Returns:
page iterator

getCommit

public RepositoryCommit getCommit(IRepositoryIdProvider repository,
                                  String sha)
                           throws IOException
Get commit with given SHA-1 from given repository

Parameters:
repository -
sha -
Returns:
repository commit
Throws:
IOException

getComments

public List<CommitComment> getComments(IRepositoryIdProvider repository,
                                       String sha)
                                throws IOException
Get all comments on commit with given SHA-1

Parameters:
repository -
sha -
Returns:
non-null but possibly empty list of commits
Throws:
IOException

pageComments

public PageIterator<CommitComment> pageComments(IRepositoryIdProvider repository,
                                                String sha)
Page comments on commit with given SHA-1

Parameters:
repository -
sha -
Returns:
page iterator over comments

pageComments

public PageIterator<CommitComment> pageComments(IRepositoryIdProvider repository,
                                                String sha,
                                                int size)
Page comments on commit with given SHA-1

Parameters:
repository -
sha -
size -
Returns:
page iterator over comments

pageComments

public PageIterator<CommitComment> pageComments(IRepositoryIdProvider repository,
                                                String sha,
                                                int start,
                                                int size)
Page comments on commit with given SHA-1

Parameters:
repository -
sha -
start -
size -
Returns:
page iterator over comments

getComment

public CommitComment getComment(IRepositoryIdProvider repository,
                                long commentId)
                         throws IOException
Get commit comment with given id

Parameters:
repository -
commentId -
Returns:
commit comment
Throws:
IOException

addComment

public CommitComment addComment(IRepositoryIdProvider repository,
                                String sha,
                                CommitComment comment)
                         throws IOException
Add comment to given commit

Parameters:
repository -
sha -
comment -
Returns:
created comment
Throws:
IOException

editComment

public CommitComment editComment(IRepositoryIdProvider repository,
                                 CommitComment comment)
                          throws IOException
Edit given comment

Parameters:
repository -
comment -
Returns:
edited comment
Throws:
IOException

deleteComment

public void deleteComment(IRepositoryIdProvider repository,
                          long commentId)
                   throws IOException
Delete commit comment with given id from given repository

Parameters:
repository -
commentId -
Throws:
IOException

compare

public RepositoryCommitCompare compare(IRepositoryIdProvider repository,
                                       String base,
                                       String head)
                                throws IOException
Compare base and head commits

Parameters:
repository -
base -
head -
Returns:
commit compare
Throws:
IOException


Copyright © 2012. All Rights Reserved.