Method: projects.locations.connections.gitRepositoryLinks.fetchFileBlame

提取文件或文件中行范围的 blame 信息。

HTTP 请求

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

网址采用 gRPC 转码语法。

路径参数

参数
name

string

必需。GitRepositoryLink 的资源名称,格式为 projects/*/locations/*/connections/*/gitRepositoryLinks/*。

查询参数

参数
ref

string

必需。SCM 提交 SHA 或符号修订版本(例如分支名称、标记),用于提取 blame。

path

string

必需。代码库中的文件路径。

firstLine

integer

可选。要追溯的范围的起始行号(从 1 开始,含边界值)。如果未指定,则从第 1 行开始追溯。

lastLine

integer

可选。要追责的范围的结束行号(从 1 开始,包含该行)。如果未指定,则追溯范围会延伸到文件末尾。

请求正文

请求正文必须为空。

响应正文

gitRepositoryLinks.fetchFileBlame 的响应消息。

如果成功,响应正文将包含结构如下的数据:

JSON 表示法
{
  "ranges": [
    {
      object (BlameRange)
    }
  ]
}
字段
ranges[]

object (BlameRange)

文件的 blame 范围列表。

授权范围

需要以下 OAuth 范围:

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

如需了解详情,请参阅 Authentication Overview。

IAM 权限

需要拥有 name 资源的以下 IAM 权限:

  • developerconnect.gitRepositoryLinks.fetchFileBlame

如需了解详情,请参阅 IAM 文档。

BlameRange

BlameRange 表示一系列行的 blame 信息。

JSON 表示法
{
  "firstLine": integer,
  "lastLine": integer,
  "commit": {
    object (SCMCommit)
  }
}
字段
firstLine

integer

范围的起始行号(从 1 开始,含边界值)。

lastLine

integer

范围的结束行号(从 1 开始,包含该行)。

commit

object (SCMCommit)

此行范围的提交元数据。