Method: projects.locations.connections.gitRepositoryLinks.fetchFileBlame

Fetches blame information for a file or line range in a file.

HTTP request

GET https://developerconnect.googleapis.com/v1/{name=projects/*/locations/*/connections/*/gitRepositoryLinks/*}:fetchFileBlame

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. The resource name of the GitRepositoryLink in the format projects/*/locations/*/connections/*/gitRepositoryLinks/*.

Query parameters

Parameters
ref

string

Required. The SCM commit SHA, or symbolic revision (for example, branch name, tag) from which to fetch the blame.

path

string

Required. The file path within the repository.

firstLine

integer

Optional. The 1-indexed starting line number of the range to blame (inclusive). If not specified, blame begins at line 1.

lastLine

integer

Optional. The 1-indexed ending line number of the range to blame (inclusive). If not specified, blame extends to the end of the file.

Request body

The request body must be empty.

Response body

Response message for gitRepositoryLinks.fetchFileBlame.

If successful, the response body contains data with the following structure:

JSON representation
{
  "ranges": [
    {
      object (BlameRange)
    }
  ]
}
Fields
ranges[]

object (BlameRange)

The list of blame ranges for the file.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the name resource:

  • developerconnect.gitRepositoryLinks.fetchFileBlame

For more information, see the IAM documentation.

BlameRange

BlameRange represents blame information for a range of lines.

JSON representation
{
  "firstLine": integer,
  "lastLine": integer,
  "commit": {
    object (SCMCommit)
  }
}
Fields
firstLine

integer

The 1-indexed starting line number of the range (inclusive).

lastLine

integer

The 1-indexed ending line number of the range (inclusive).

commit

object (SCMCommit)

The commit metadata for this line range.