feat(api): extend commit and diff services with new functionality
- Add FindCommit, ListCommitsByOid, CommitIsAncestor RPCs to CommitService - Add CheckObjectsExist, CommitsByMessage, GetCommitStats RPCs to CommitService - Add LastCommitForPath, CountCommits, CountDivergingCommits RPCs to CommitService - Add RawDiff, RawPatch, FindChangedPaths RPCs to DiffService - Add FindMergeBase, WriteRef, SearchFilesByContent RPCs to RepositoryService - Add SearchFilesByName, ObjectsSize, RepositorySize RPCs to RepositoryService - Add FindLicense, OptimizeRepository, GetRawChanges RPCs to RepositoryService - Add FetchRemote, CreateRepositoryFromURL RPCs to RepositoryService - Implement server handlers for all new RPC methods - Add new modules for commit counting, finding, and querying features - Add new modules for diff changed paths and raw operations - Add new modules for refs and remote operations - Remove unnecessary comments from various source files - Update proto definitions with new message types and service methods
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package gitks;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
import "oid.proto";
|
||||
import "repository.proto";
|
||||
|
||||
|
||||
message FindDefaultBranchNameRequest {
|
||||
RepositoryHeader repository = 1;
|
||||
}
|
||||
|
||||
message FindDefaultBranchNameResponse {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message RefExistsRequest {
|
||||
RepositoryHeader repository = 1;
|
||||
string ref_name = 2;
|
||||
}
|
||||
|
||||
message RefExistsResponse {
|
||||
bool exists = 1;
|
||||
}
|
||||
|
||||
|
||||
message RefUpdateEntry {
|
||||
string ref_name = 1;
|
||||
string new_oid = 2;
|
||||
string old_oid = 3; // expected old OID (empty = no check)
|
||||
}
|
||||
|
||||
message UpdateReferencesRequest {
|
||||
RepositoryHeader repository = 1;
|
||||
repeated RefUpdateEntry updates = 2;
|
||||
}
|
||||
|
||||
message UpdateReferencesResponse {
|
||||
repeated string failed_refs = 1;
|
||||
string error = 2;
|
||||
}
|
||||
|
||||
message DeleteRefsRequest {
|
||||
RepositoryHeader repository = 1;
|
||||
repeated string ref_names = 2;
|
||||
}
|
||||
|
||||
message DeleteRefsResponse {
|
||||
repeated string failed_refs = 1;
|
||||
string error = 2;
|
||||
}
|
||||
|
||||
|
||||
message FindRefsByOIDRequest {
|
||||
RepositoryHeader repository = 1;
|
||||
string oid = 2;
|
||||
RefFilter filter = 3;
|
||||
}
|
||||
|
||||
message RefFilter {
|
||||
repeated string prefixes = 1; // e.g. ["refs/heads/", "refs/tags/"]
|
||||
uint32 limit = 2;
|
||||
}
|
||||
|
||||
message FoundRef {
|
||||
string ref_name = 1;
|
||||
string target_oid = 2;
|
||||
bool symbolic = 3;
|
||||
string symbolic_target = 4;
|
||||
}
|
||||
|
||||
message FindRefsByOIDResponse {
|
||||
repeated FoundRef refs = 1;
|
||||
}
|
||||
|
||||
|
||||
message ListRefsRequest {
|
||||
RepositoryHeader repository = 1;
|
||||
repeated string prefixes = 2;
|
||||
string pattern = 3; // glob pattern, e.g. "refs/heads/*"
|
||||
repeated string containing_oids = 4;
|
||||
SortDirection sort_direction = 5;
|
||||
Pagination pagination = 6;
|
||||
}
|
||||
|
||||
message ListRefsResponse {
|
||||
repeated FoundRef refs = 1;
|
||||
PageInfo page_info = 2;
|
||||
}
|
||||
|
||||
service RefService {
|
||||
rpc FindDefaultBranchName(FindDefaultBranchNameRequest) returns (FindDefaultBranchNameResponse);
|
||||
rpc RefExists(RefExistsRequest) returns (RefExistsResponse);
|
||||
rpc UpdateReferences(UpdateReferencesRequest) returns (UpdateReferencesResponse);
|
||||
rpc DeleteRefs(DeleteRefsRequest) returns (DeleteRefsResponse);
|
||||
rpc FindRefsByOID(FindRefsByOIDRequest) returns (FindRefsByOIDResponse);
|
||||
rpc ListRefs(ListRefsRequest) returns (ListRefsResponse);
|
||||
}
|
||||
Reference in New Issue
Block a user