| Class | Gitlab::Git::Commit |
| In: |
lib/gitlab_git/commit.rb
|
| Parent: | Object |
| SERIALIZE_KEYS | = | [ :id, :message, :parent_ids, :authored_date, :author_name, :author_email, :committed_date, :committer_name, :committer_email |
| head | [RW] | |
| raw_commit | [RW] | |
| refs | [RW] |
Get commits between two revspecs See also repository.commits_between
Ex.
Commit.between(repo, '29eda46b', 'master')
Returns a diff object for the changes introduced by rugged_commit. If rugged_commit doesn‘t have a parent, then the diff is between this commit and an empty repo. See Repository#diff for the keys allowed in the options hash.
Get last commit for specified path and ref
Ex.
Commit.last_for_path(repo, '29eda46b', 'app/models') Commit.last_for_path(repo, 'master', 'Gemfile')
Get commits collection
Ex.
Commit.where(
repo: repo,
ref: 'master',
path: 'app/models',
limit: 10,
offset: 5,
)
Returns a diff object for the changes from this commit‘s first parent. If there is no parent, then the diff is between this commit and an empty repo. See Repository#diff for keys allowed in the options hash.