Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2019-07-05 12:28:16 +0300
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2019-07-05 12:28:16 +0300
commitb9c9aec5cf53de4ea1a7fc3b067dd56d7828e080 (patch)
tree2693a49918682c12ea22e4085b8c569ac9e62497 /proto/diff.proto
parent873a408c49ef1b34fce0cd47a80aa192f426d7c0 (diff)
Start preparation for migrating .proto files
Diffstat (limited to 'proto/diff.proto')
-rw-r--r--proto/diff.proto145
1 files changed, 145 insertions, 0 deletions
diff --git a/proto/diff.proto b/proto/diff.proto
new file mode 100644
index 000000000..7548ad88f
--- /dev/null
+++ b/proto/diff.proto
@@ -0,0 +1,145 @@
+syntax = "proto3";
+
+package gitaly;
+
+option go_package = "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb";
+
+import "shared.proto";
+
+service DiffService {
+ // Returns stream of CommitDiffResponse with patches chunked over messages
+ rpc CommitDiff(CommitDiffRequest) returns (stream CommitDiffResponse) {
+ option (op_type).op = ACCESSOR;
+ }
+ // Return a stream so we can divide the response in chunks of deltas
+ rpc CommitDelta(CommitDeltaRequest) returns (stream CommitDeltaResponse) {
+ option (op_type).op = ACCESSOR;
+ }
+ rpc CommitPatch(CommitPatchRequest) returns (stream CommitPatchResponse) {
+ option (op_type).op = ACCESSOR;
+ }
+ rpc RawDiff(RawDiffRequest) returns (stream RawDiffResponse) {
+ option (op_type).op = ACCESSOR;
+ }
+ rpc RawPatch(RawPatchRequest) returns (stream RawPatchResponse) {
+ option (op_type).op = ACCESSOR;
+ }
+ rpc DiffStats(DiffStatsRequest) returns (stream DiffStatsResponse) {
+ option (op_type).op = ACCESSOR;
+ }
+}
+
+message CommitDiffRequest {
+ Repository repository = 1;
+ string left_commit_id = 2;
+ string right_commit_id = 3;
+ bool ignore_whitespace_change = 4;
+ repeated bytes paths = 5;
+ bool collapse_diffs = 6;
+ bool enforce_limits = 7;
+
+ // These limits are only enforced when enforce_limits == true.
+ int32 max_files = 8;
+ int32 max_lines = 9;
+ int32 max_bytes = 10;
+ // Limitation of a single diff patch,
+ // patches surpassing this limit are pruned by default.
+ // If this is 0 you will get back empty patches.
+ int32 max_patch_bytes = 14;
+
+ // These limits are only enforced if collapse_diffs == true.
+ int32 safe_max_files = 11;
+ int32 safe_max_lines = 12;
+ int32 safe_max_bytes = 13;
+}
+
+// A CommitDiffResponse corresponds to a single changed file in a commit.
+message CommitDiffResponse {
+ reserved 8;
+
+ bytes from_path = 1;
+ bytes to_path = 2;
+ // Blob ID as returned via `git diff --full-index`
+ string from_id = 3;
+ string to_id = 4;
+ int32 old_mode = 5;
+ int32 new_mode = 6;
+ bool binary = 7;
+ bytes raw_patch_data = 9;
+ bool end_of_patch = 10;
+ // Indicates the diff file at which we overflow according to the limitations sent,
+ // in which case only this attribute will be set.
+ bool overflow_marker = 11;
+ // Indicates the patch surpassed a "safe" limit and was therefore pruned, but
+ // the client may still request the full patch on a separate request.
+ bool collapsed = 12;
+ // Indicates the patch was pruned since it surpassed a hard limit, and can
+ // therefore not be expanded.
+ bool too_large = 13;
+}
+
+message CommitDeltaRequest {
+ Repository repository = 1;
+ string left_commit_id = 2;
+ string right_commit_id = 3;
+ repeated bytes paths = 4;
+}
+
+message CommitDelta {
+ bytes from_path = 1;
+ bytes to_path = 2;
+ // Blob ID as returned via `git diff --full-index`
+ string from_id = 3;
+ string to_id = 4;
+ int32 old_mode = 5;
+ int32 new_mode = 6;
+}
+
+message CommitDeltaResponse {
+ repeated CommitDelta deltas = 1;
+}
+
+message CommitPatchRequest {
+ Repository repository = 1;
+ bytes revision = 2;
+}
+
+message CommitPatchResponse {
+ bytes data = 1;
+}
+
+message RawDiffRequest {
+ Repository repository = 1;
+ string left_commit_id = 2;
+ string right_commit_id = 3;
+}
+
+message RawDiffResponse {
+ bytes data = 1;
+}
+
+message RawPatchRequest {
+ Repository repository = 1;
+ string left_commit_id = 2;
+ string right_commit_id = 3;
+}
+
+message RawPatchResponse {
+ bytes data = 1;
+}
+
+message DiffStatsRequest {
+ Repository repository = 1;
+ string left_commit_id = 2;
+ string right_commit_id = 3;
+}
+
+message DiffStats {
+ bytes path = 1;
+ int32 additions = 2;
+ int32 deletions = 3;
+}
+
+message DiffStatsResponse {
+ repeated DiffStats stats = 1;
+}