Codebase list golang-gitaly-proto / debian/0.99.0+dfsg-3 operations.proto
debian/0.99.0+dfsg-3

Tree @debian/0.99.0+dfsg-3 (Download .tar.gz)

operations.proto @debian/0.99.0+dfsg-3raw · history · blame

syntax = "proto3";

package gitaly;

import "shared.proto";

service OperationService {
  rpc UserCreateBranch(UserCreateBranchRequest) returns (UserCreateBranchResponse) {}
  rpc UserDeleteBranch(UserDeleteBranchRequest) returns (UserDeleteBranchResponse) {}
  rpc UserCreateTag(UserCreateTagRequest) returns (UserCreateTagResponse) {}
  rpc UserDeleteTag(UserDeleteTagRequest) returns (UserDeleteTagResponse) {}
  rpc UserMergeBranch(stream UserMergeBranchRequest) returns (stream UserMergeBranchResponse) {}
  rpc UserFFBranch(UserFFBranchRequest) returns (UserFFBranchResponse) {}
  rpc UserCherryPick(UserCherryPickRequest) returns (UserCherryPickResponse) {}
  rpc UserRevert(UserRevertRequest) returns (UserRevertResponse) {}
  rpc UserCommitFiles(stream UserCommitFilesRequest) returns (UserCommitFilesResponse) {}
  rpc UserRebase(UserRebaseRequest) returns (UserRebaseResponse) {}
  rpc UserSquash(UserSquashRequest) returns (UserSquashResponse) {}
}

message UserCreateBranchRequest {
  Repository repository = 1;
  bytes branch_name = 2;
  User user = 3;
  bytes start_point = 4;
}

message UserCreateBranchResponse {
  Branch branch = 1;
  // Error returned by the pre-receive hook. If no error was thrown,
  // it's the empty string ("")
  string pre_receive_error = 2;
}

message UserDeleteBranchRequest {
  Repository repository = 1;
  bytes branch_name = 2;
  User user = 3;
}

message UserDeleteBranchResponse {
  string pre_receive_error = 1;
}

message UserDeleteTagRequest {
  Repository repository = 1;
  bytes tag_name = 2;
  User user = 3;
}

message UserDeleteTagResponse {
  string pre_receive_error = 1;
}

message UserCreateTagRequest {
  Repository repository = 1;
  bytes tag_name = 2;
  User user = 3;
  bytes target_revision = 4;
  bytes message = 5;
}

message UserCreateTagResponse {
  Tag tag = 1;
  bool exists = 2;
  string pre_receive_error = 3;
}

message UserMergeBranchRequest {
  // First message
  Repository repository = 1;
  User user = 2;
  string commit_id = 3;
  bytes branch = 4;
  bytes message = 5;

  // Second message
  // Tell the server to apply the merge to the branch
  bool apply = 6;
}

message UserMergeBranchResponse {
  // First message
  // The merge commit the branch will be updated to. The caller can still abort the merge.
  string commit_id = 1;

  reserved 2;
  // Second message
  // If set, the merge has been applied to the branch.
  OperationBranchUpdate branch_update = 3;
  string pre_receive_error = 4;
}

message OperationBranchUpdate {
  // If this string is non-empty the branch has been updated.
  string commit_id = 1;
  // Used for cache invalidation in GitLab
  bool repo_created = 2;
  // Used for cache invalidation in GitLab
  bool branch_created = 3;
}

message UserFFBranchRequest {
  Repository repository = 1;
  User user = 2;
  string commit_id = 3;
  bytes branch = 4;
}

message UserFFBranchResponse {
  OperationBranchUpdate branch_update = 1;
  string pre_receive_error = 2;
}

message UserCherryPickRequest {
  Repository repository = 1;
  User user = 2;
  GitCommit commit = 3;
  bytes branch_name = 4;
  bytes message = 5;
  bytes start_branch_name = 6;
  Repository start_repository = 7;
}

message UserCherryPickResponse {
  OperationBranchUpdate branch_update = 1;
  string create_tree_error = 2;
  string commit_error = 3;
  string pre_receive_error = 4;
}

message UserRevertRequest {
  Repository repository = 1;
  User user = 2;
  GitCommit commit = 3;
  bytes branch_name = 4;
  bytes message = 5;
  bytes start_branch_name = 6;
  Repository start_repository = 7;
}

message UserRevertResponse {
  OperationBranchUpdate branch_update = 1;
  string create_tree_error = 2;
  string commit_error = 3;
  string pre_receive_error = 4;
}

message UserCommitFilesActionHeader {
  enum ActionType {
    CREATE = 0;
    CREATE_DIR = 1;
    UPDATE = 2;
    MOVE = 3;
    DELETE = 4;
  }
  ActionType action = 1;
  bytes file_path = 2;
  bytes previous_path = 3;
  bool base64_content = 4;
}

message UserCommitFilesAction {
  oneof user_commit_files_action_payload {
    UserCommitFilesActionHeader header = 1;
    bytes content = 2;
  }
}

message UserCommitFilesRequestHeader {
  Repository repository = 1;
  User user = 2;
  bytes branch_name = 3;
  bytes commit_message = 4;
  bytes commit_author_name = 5;
  bytes commit_author_email = 6;
  bytes start_branch_name = 7;
  Repository start_repository = 8;
}

message UserCommitFilesRequest {
  oneof user_commit_files_request_payload {
    // For each request stream there should be first a request with a header and
    // then n requests with actions
    UserCommitFilesRequestHeader header = 1;
    UserCommitFilesAction action = 2;
  }
}

message UserCommitFilesResponse {
  OperationBranchUpdate branch_update = 1;
  string index_error = 2;
  string pre_receive_error = 3;
}

message UserRebaseRequest {
  Repository repository = 1;
  User user = 2;
  string rebase_id = 3;
  bytes branch = 4;
  string branch_sha = 5;
  Repository remote_repository = 6;
  bytes remote_branch = 7;
}

message UserRebaseResponse {
  string rebase_sha = 1;
  string pre_receive_error = 2;
  string git_error = 3;
}

message UserSquashRequest {
  Repository repository = 1;
  User user = 2;
  string squash_id = 3;
  bytes branch = 4;
  string start_sha = 5;
  string end_sha = 6;
  User author = 7;
  bytes commit_message = 8;
}

message UserSquashResponse {
  string squash_sha = 1;
  // DEPRECATED: https://gitlab.com/gitlab-org/gitaly-proto/merge_requests/161
  reserved 2;
  reserved "pre_receive_error";
  string git_error = 3;
}