class Github::Repos::Commits
def compare(user_name, repo_name, base, head, params={})
'master'
'v0.4.8',
'repo-name',
'user-name',
github.repos.commits.compare
github = Github.new
= Examples
Compares two commits
def compare(user_name, repo_name, base, head, params={}) set :user => user_name, :repo => repo_name assert_presence_of base, head normalize! params get_request("/repos/#{user_name}/#{repo_name}/compare/#{base}...#{head}", params) end
def get(user_name, repo_name, sha, params={})
github.repos.commits.get 'user-name', 'repo-name', '6dcb09b5b57875f334f61aebed6')
github = Github.new
= Examples
Gets a single commit
def get(user_name, repo_name, sha, params={}) set :user => user_name, :repo => repo_name assert_presence_of user, repo, sha normalize! params get_request("/repos/#{user}/#{repo}/commits/#{sha}", params) end
def list(user_name, repo_name, params={})
github.repos.commits.list 'user-name', 'repo-name', :sha => '...' { |commit| ... }
github.repos.commits.list 'user-name', 'repo-name', :sha => '...'
github = Github.new
= Examples
* :author GitHub login, name, or email by which to filter by commit author.
* :path Optional string. Only commits containing this file path will be returned.
* :sha Optional string. Sha or branch to start listing commits from.
= Parameters
List commits on a repository
def list(user_name, repo_name, params={}) set :user => user_name, :repo => repo_name assert_presence_of user, repo normalize! params filter! VALID_COMMITS_OPTIONS, params response = get_request("/repos/#{user}/#{repo}/commits", params) return response unless block_given? response.each { |el| yield el } end