Codebase list golang-gitaly-proto / upstream/1.14.0+dfsg commit.proto
upstream/1.14.0+dfsg

Tree @upstream/1.14.0+dfsg (Download .tar.gz)

commit.proto @upstream/1.14.0+dfsgraw · history · blame

syntax = "proto3";

package gitaly;

import "shared.proto";
import "google/protobuf/timestamp.proto";

service CommitService {
  rpc CommitIsAncestor(CommitIsAncestorRequest) returns (CommitIsAncestorResponse) {}
  rpc TreeEntry(TreeEntryRequest) returns (stream TreeEntryResponse) {}
  rpc CommitsBetween(CommitsBetweenRequest) returns (stream CommitsBetweenResponse) {}
  rpc CountCommits(CountCommitsRequest) returns (CountCommitsResponse) {}
  rpc CountDivergingCommits(CountDivergingCommitsRequest) returns (CountDivergingCommitsResponse) {}
  rpc GetTreeEntries(GetTreeEntriesRequest) returns (stream GetTreeEntriesResponse) {}
  rpc ListFiles(ListFilesRequest) returns (stream ListFilesResponse) {}
  rpc FindCommit(FindCommitRequest) returns (FindCommitResponse) {}
  rpc CommitStats(CommitStatsRequest) returns (CommitStatsResponse) {}
  // Use a stream to paginate the result set
  rpc FindAllCommits(FindAllCommitsRequest) returns (stream FindAllCommitsResponse) {}
  rpc FindCommits(FindCommitsRequest) returns (stream FindCommitsResponse) {}
  rpc CommitLanguages(CommitLanguagesRequest) returns (CommitLanguagesResponse) {}
  rpc RawBlame(RawBlameRequest) returns (stream RawBlameResponse) {}
  rpc LastCommitForPath(LastCommitForPathRequest) returns (LastCommitForPathResponse) {}
  rpc ListLastCommitsForTree(ListLastCommitsForTreeRequest) returns (stream ListLastCommitsForTreeResponse) {}
  rpc CommitsByMessage(CommitsByMessageRequest) returns (stream CommitsByMessageResponse) {}

  rpc ListCommitsByOid(ListCommitsByOidRequest) returns (stream ListCommitsByOidResponse) {}
  rpc FilterShasWithSignatures(stream FilterShasWithSignaturesRequest) returns (stream FilterShasWithSignaturesResponse) {}

  // ExtractCommitSignature returns a stream because the signed text may be
  // arbitrarily large and signature verification is impossible without the
  // full text.
  rpc ExtractCommitSignature(ExtractCommitSignatureRequest) returns (stream ExtractCommitSignatureResponse) {}
  rpc GetCommitSignatures(GetCommitSignaturesRequest) returns (stream GetCommitSignaturesResponse) {}

  rpc GetCommitMessages(GetCommitMessagesRequest) returns (stream GetCommitMessagesResponse) {}
}

message CommitStatsRequest {
  Repository repository = 1;
  bytes revision = 2;
}

message CommitStatsResponse {
  // OID is the commit. Empty means not found
  string oid = 1;
  int32 additions = 2;
  int32 deletions = 3;
}

message CommitIsAncestorRequest {
  Repository repository = 1;
  string ancestor_id = 2;
  string child_id = 3;
}

message CommitIsAncestorResponse {
  bool value = 1;
}

message TreeEntryRequest {
  Repository repository = 1;
  // commit ID or refname
  bytes revision = 2;
  // entry path relative to repository root
  bytes path = 3;
  int64 limit = 4;
}

message TreeEntryResponse {
  enum ObjectType {
    COMMIT = 0;
    BLOB = 1;
    TREE = 2;
    TAG = 3;
  }
  ObjectType type = 1;
  // SHA1 object ID
  string oid = 2;
  int64 size = 3;
  // file mode
  int32 mode = 4;
  // raw object contents
  bytes data = 5;
}

message CommitsBetweenRequest {
  Repository repository = 1;
  bytes from = 2;
  bytes to = 3;
}

message CommitsBetweenResponse {
  repeated GitCommit commits = 1;
}

message CountCommitsRequest {
  Repository repository = 1;
  bytes revision = 2;
  google.protobuf.Timestamp after = 3;
  google.protobuf.Timestamp before = 4;
  bytes path = 5;
  int32 max_count = 6;
  // all and revision are mutually exclusive
  bool all = 7;
}

message CountCommitsResponse {
  int32 count = 1;
}

message CountDivergingCommitsRequest {
  Repository repository = 1;
  bytes from = 2;
  bytes to = 3;
  reserved 4;
  reserved 5;
  reserved 6;
  int32 max_count = 7;
}

message CountDivergingCommitsResponse {
  int32 left_count = 1;
  int32 right_count = 2;
}

message TreeEntry {
  enum EntryType {
    BLOB = 0;
    TREE = 1;
    COMMIT = 3;
  }
  // OID of the object this tree entry points to
  string oid = 1;
  // OID of the tree attached to commit_oid
  string root_oid = 2;
  // Path relative to repository root
  bytes path = 3;
  EntryType type = 4;
  // File mode e.g. 0644
  int32 mode = 5;
  // The commit object via which this entry was retrieved
  string commit_oid = 6;
  // Relative path of the first subdir that doesn't have only one directory descendant
  bytes flat_path = 7;
}

message GetTreeEntriesRequest {
  Repository repository = 1;
  bytes revision = 2;
  bytes path = 3;
  bool recursive = 4;
}

message GetTreeEntriesResponse {
  repeated TreeEntry entries = 1;
}

message ListFilesRequest {
  Repository repository = 1;
  bytes revision = 2;
}

// A single 'page' of the paginated response
message ListFilesResponse {
  // Remember to force encoding utf-8 on the client side
  repeated bytes paths = 1;
}

message FindCommitRequest {
  Repository repository = 1;
  bytes revision = 2;
}

message FindCommitResponse {
  // commit is nil when the commit was not found
  GitCommit commit = 1;
}

message ListCommitsByOidRequest {
  Repository repository = 1;
  repeated string oid = 2;
}

message ListCommitsByOidResponse {
  repeated GitCommit commits = 1;
}

message FindAllCommitsRequest {
  Repository repository = 1;
  // When nil, return all commits reachable by any branch in the repo
  bytes revision = 2;
  int32 max_count = 3;
  int32 skip = 4;
  enum Order {
    NONE = 0;
    TOPO = 1;
    DATE = 2;
  }
  Order order = 5;
}

// A single 'page' of the result set
message FindAllCommitsResponse {
  repeated GitCommit commits = 1;
}

message FindCommitsRequest {
  Repository repository = 1;
  bytes revision = 2;
  int32 limit = 3;
  int32 offset = 4;
  repeated bytes paths = 5;
  bool follow = 6;
  bool skip_merges = 7;
  bool disable_walk = 8;
  google.protobuf.Timestamp after = 9;
  google.protobuf.Timestamp before = 10;
  // all and revision are mutually exclusive
  bool all = 11;
}

// A single 'page' of the result set
message FindCommitsResponse {
  repeated GitCommit commits = 1;
}

message CommitLanguagesRequest {
  Repository repository = 1;
  bytes revision = 2;
}

message CommitLanguagesResponse {
  message Language {
    string name = 1;
    float share = 2;
    string color = 3;
  }
  repeated Language languages = 1;
}

message RawBlameRequest {
  Repository repository = 1;
  bytes revision = 2;
  bytes path = 3;
}

message RawBlameResponse {
  bytes data = 1;
}

message LastCommitForPathRequest {
  Repository repository = 1;
  bytes revision = 2;
  bytes path = 3;
}

message LastCommitForPathResponse {
  // commit is nil when the commit was not found
  GitCommit commit = 1;
}

message ListLastCommitsForTreeRequest {
  Repository repository = 1;
  string revision = 2;
  bytes path = 3;

  // limit == -1 will get the last commit for all paths 
  int32 limit = 4;
  int32 offset = 5;
}

message ListLastCommitsForTreeResponse {
  message CommitForTree {
    reserved 1;

    GitCommit commit = 2;
    string path = 3;
  }
  repeated CommitForTree commits = 1;
}

message CommitsByMessageRequest {
  Repository repository = 1;
  bytes revision = 2;
  int32 offset = 3;
  int32 limit = 4;
  bytes path = 5;
  string query = 6;
}

// One 'page' of the paginated response of CommitsByMessage
message CommitsByMessageResponse {
  repeated GitCommit commits = 1;
}

message FilterShasWithSignaturesRequest {
  Repository repository = 1;
  repeated bytes shas = 2;
}

message FilterShasWithSignaturesResponse {
  repeated bytes shas = 1;
}

message ExtractCommitSignatureRequest {
  Repository repository = 1;
  string commit_id = 2;
}

// Either of the 'signature' and 'signed_text' fields may be present. It
// is up to the caller to stitch them together.
message ExtractCommitSignatureResponse {
  bytes signature = 1;
  bytes signed_text = 2;
}

message GetCommitSignaturesRequest {
  Repository repository = 1;
  repeated string commit_ids = 2;
}

message GetCommitSignaturesResponse {
  // Only present for a new commit signature data.
  string commit_id = 1;
  // See ExtractCommitSignatureResponse above for how these fields should be handled.
  bytes signature = 2;
  bytes signed_text = 3;
}

message GetCommitMessagesRequest {
  Repository repository = 1;
  repeated string commit_ids = 2;
}

message GetCommitMessagesResponse {
  // Only present for a new commit message
  string commit_id = 1;
  bytes message = 2;
}