Module Gitlab::Client::Commits
In: lib/gitlab/client/commits.rb

Defines methods related to repository commits. @see github.com/gitlabhq/gitlabhq/blob/master/doc/api/commits.md

Methods

Public Instance methods

Gets a specific commit identified by the commit hash or name of a branch or tag.

@example

  Gitlab.commit(42, '6104942438c14ec7bd21c6cd5bd995272b3faff6')
  Gitlab.repo_commit(3, 'ed899a2f4b50b4370feeea94676502b42383c746')

@param [Integer] project The ID of a project. @param [String] sha The commit hash or name of a repository branch or tag @return [Gitlab::ObjectifiedHash]

Gets a list of comments for a commit.

@example

  Gitlab.commit_comments(5, 'c9f9662a9b1116c838b523ed64c6abdb4aae4b8b')

@param [Integer] project The ID of a project. @param [String] sha The commit hash or name of a repository branch or tag. @option options [Integer] :page The page number. @option options [Integer] :per_page The number of results per page. @return [Array<Gitlab::ObjectifiedHash>]

Get the diff of a commit in a project.

@example

  Gitlab.commit_diff(42, '6104942438c14ec7bd21c6cd5bd995272b3faff6')
  Gitlab.repo_commit_diff(3, 'ed899a2f4b50b4370feeea94676502b42383c746')

@param [Integer] project The ID of a project. @param [String] sha The name of a repository branch or tag or if not given the default branch. @return [Gitlab::ObjectifiedHash]

Get the status of a commit

@example

  Gitlab.commit_status(42, '6104942438c14ec7bd21c6cd5bd995272b3faff6')
  Gitlab.commit_status(42, '6104942438c14ec7bd21c6cd5bd995272b3faff6', { name: 'jenkins' })
  Gitlab.commit_status(42, '6104942438c14ec7bd21c6cd5bd995272b3faff6', { name: 'jenkins', all: true })

@param [Integer] project The ID of a project. @param [String] sha The commit hash @param [Hash] options A customizable set of options. @option options [String] :ref Filter by ref name, it can be branch or tag @option options [String] :stage Filter by stage @option options [String] :name Filer by status name, eg. jenkins @option options [Boolean] :all The flag to return all statuses, not only latest ones

Gets a list of project commits.

@example

  Gitlab.commits('viking')
  Gitlab.repo_commits('gitlab', { ref_name: 'api' })

@param [Integer] project The ID of a project. @param [Hash] options A customizable set of options. @option options [String] :ref_name The branch or tag name of a project repository. @option options [Integer] :page The page number. @option options [Integer] :per_page The number of results per page. @return [Array<Gitlab::ObjectifiedHash>]

Creates a new comment for a commit.

@example

  Gitlab.create_commit_comment(5, 'c9f9662a9b1116c838b523ed64c6abdb4aae4b8b', 'Nice work on this commit!')

@param [Integer] project The ID of a project. @param [String] sha The commit hash or name of a repository branch or tag. @param [String] note The text of a comment. @param [Hash] options A customizable set of options. @option options [String] :path The file path. @option options [Integer] :line The line number. @option options [String] :line_type The line type (new or old). @return [Gitlab::ObjectifiedHash] Information about created comment.

repo_commit(project, sha)

Alias for commit

repo_commit_comments(project, commit, options={})

Alias for commit_comments

repo_commit_diff(project, sha)

Alias for commit_diff

repo_commit_status(id, sha, options={})

Alias for commit_status

repo_commits(project, options={})

Alias for commits

repo_create_commit_comment(project, commit, note, options={})
repo_update_commit_status(id, sha, state, options={})

Adds or updates a status of a commit.

@example

  Gitlab.update_commit_status(42, '6104942438c14ec7bd21c6cd5bd995272b3faff6', 'success')
  Gitlab.update_commit_status(42, '6104942438c14ec7bd21c6cd5bd995272b3faff6', 'failed', { name: 'jenkins' })
  Gitlab.update_commit_status(42, '6104942438c14ec7bd21c6cd5bd995272b3faff6', 'canceled', { name: 'jenkins', target_url: 'http://example.com/builds/1' })

@param [Integer] project The ID of a project. @param [String] sha The commit hash @param [String] state of the status. Can be: pending, running, success, failed, canceled @param [Hash] options A customizable set of options. @option options [String] :ref The ref (branch or tag) to which the status refers @option options [String] :name Filer by status name, eg. jenkins @option options [String] :target_url The target URL to associate with this status

[Validate]