Files
appks/proto/git/commit.proto
T
2026-06-07 11:30:56 +08:00

166 lines
3.8 KiB
Protocol Buffer

syntax = "proto3";
package gitks;
import "google/protobuf/timestamp.proto";
import "oid.proto";
import "repository.proto";
import "tagger.proto";
message PayloadCommit {
PayloadTagger author = 1;
PayloadTagger committer = 2;
Oid oid = 3;
string message = 4;
repeated Oid parents = 5;
Oid tree = 6;
google.protobuf.Timestamp timestamp = 7;
}
message CommitTrailer {
string key = 1;
string value = 2;
bool separator_present = 3;
}
message CommitStats {
uint32 additions = 1;
uint32 deletions = 2;
uint32 changed_files = 3;
}
message Commit {
Oid oid = 1;
string abbreviated_oid = 2;
repeated Oid parent_oids = 3;
Oid tree_oid = 4;
Signature author = 5;
Signature committer = 6;
string subject = 7;
string body = 8;
string message = 9;
repeated CommitTrailer trailers = 10;
VerifiedSignature signature = 11;
CommitStats stats = 12;
google.protobuf.Timestamp authored_at = 13;
google.protobuf.Timestamp committed_at = 14;
bytes raw = 15;
}
message ListCommitsRequest {
RepositoryHeader repository = 1;
ObjectSelector revision = 2;
string path = 3;
google.protobuf.Timestamp since = 4;
google.protobuf.Timestamp until = 5;
bool first_parent = 6;
bool all = 7;
bool reverse = 8;
uint32 max_parents = 9;
uint32 min_parents = 10;
Pagination pagination = 11;
}
message ListCommitsResponse {
repeated Commit commits = 1;
PageInfo page_info = 2;
}
message GetCommitRequest {
RepositoryHeader repository = 1;
ObjectSelector revision = 2;
bool include_stats = 3;
bool include_raw = 4;
}
message GetCommitAncestorsRequest {
RepositoryHeader repository = 1;
ObjectSelector revision = 2;
bool first_parent = 3;
Pagination pagination = 4;
}
message GetCommitAncestorsResponse {
repeated Commit commits = 1;
PageInfo page_info = 2;
}
message CreateCommitAction {
enum Action {
CREATE_COMMIT_ACTION_UNSPECIFIED = 0;
CREATE_COMMIT_ACTION_CREATE = 1;
CREATE_COMMIT_ACTION_UPDATE = 2;
CREATE_COMMIT_ACTION_DELETE = 3;
CREATE_COMMIT_ACTION_MOVE = 4;
CREATE_COMMIT_ACTION_CHMOD = 5;
}
Action action = 1;
string file_path = 2;
string previous_path = 3;
bytes content = 4;
string encoding = 5;
bool executable = 6;
Oid last_commit_oid = 7;
}
message CreateCommitRequest {
RepositoryHeader repository = 1;
string branch = 2;
string message = 3;
Signature author = 4;
Signature committer = 5;
repeated CreateCommitAction actions = 6;
ObjectSelector start_revision = 7;
bool force = 8;
repeated CommitTrailer trailers = 9;
}
message CreateCommitResponse {
Commit commit = 1;
string branch = 2;
}
message RevertCommitRequest {
RepositoryHeader repository = 1;
ObjectSelector commit = 2;
string branch = 3;
Signature committer = 4;
string message = 5;
}
message CherryPickCommitRequest {
RepositoryHeader repository = 1;
ObjectSelector commit = 2;
string branch = 3;
Signature committer = 4;
string message = 5;
uint32 mainline = 6;
}
message CompareCommitsRequest {
RepositoryHeader repository = 1;
ObjectSelector base = 2;
ObjectSelector head = 3;
bool straight = 4;
bool first_parent = 5;
Pagination pagination = 6;
}
message CompareCommitsResponse {
repeated Commit commits = 1;
CommitStats stats = 2;
PageInfo page_info = 3;
Oid merge_base = 4;
}
service CommitService {
rpc ListCommits(ListCommitsRequest) returns (ListCommitsResponse);
rpc GetCommit(GetCommitRequest) returns (Commit);
rpc GetCommitAncestors(GetCommitAncestorsRequest) returns (GetCommitAncestorsResponse);
rpc CreateCommit(CreateCommitRequest) returns (CreateCommitResponse);
rpc RevertCommit(RevertCommitRequest) returns (CreateCommitResponse);
rpc CherryPickCommit(CherryPickCommitRequest) returns (CreateCommitResponse);
rpc CompareCommits(CompareCommitsRequest) returns (CompareCommitsResponse);
}