1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
|
syntax = "proto3";
package gitaly;
import "google/protobuf/timestamp.proto";
import "lint.proto";
import "shared.proto";
option go_package = "gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb";
// CommitService is a service which provides RPCs that interact with Git
// commits.
service CommitService {
// ListCommits lists all commits reachable via a set of references by doing a
// graph walk. This deprecates FindAllCommits and FindCommits (except Follow
// is not yet supported). Any unknown revisions will cause the RPC to fail.
rpc ListCommits(ListCommitsRequest) returns (stream ListCommitsResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// ListAllCommits lists all commits present in the repository, including
// those not reachable by any reference.
rpc ListAllCommits(ListAllCommitsRequest) returns (stream ListAllCommitsResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc CommitIsAncestor(CommitIsAncestorRequest) returns (CommitIsAncestorResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc TreeEntry(TreeEntryRequest) returns (stream TreeEntryResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc CountCommits(CountCommitsRequest) returns (CountCommitsResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc CountDivergingCommits(CountDivergingCommitsRequest) returns (CountDivergingCommitsResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc GetTreeEntries(GetTreeEntriesRequest) returns (stream GetTreeEntriesResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc ListFiles(ListFilesRequest) returns (stream ListFilesResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc FindCommit(FindCommitRequest) returns (FindCommitResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc CommitStats(CommitStatsRequest) returns (CommitStatsResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// Use a stream to paginate the result set
rpc FindAllCommits(FindAllCommitsRequest) returns (stream FindAllCommitsResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc FindCommits(FindCommitsRequest) returns (stream FindCommitsResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc CommitLanguages(CommitLanguagesRequest) returns (CommitLanguagesResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc RawBlame(RawBlameRequest) returns (stream RawBlameResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc LastCommitForPath(LastCommitForPathRequest) returns (LastCommitForPathResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc ListLastCommitsForTree(ListLastCommitsForTreeRequest) returns (stream ListLastCommitsForTreeResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc CommitsByMessage(CommitsByMessageRequest) returns (stream CommitsByMessageResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc ListCommitsByOid(ListCommitsByOidRequest) returns (stream ListCommitsByOidResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc ListCommitsByRefName(ListCommitsByRefNameRequest) returns (stream ListCommitsByRefNameResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc FilterShasWithSignatures(stream FilterShasWithSignaturesRequest) returns (stream FilterShasWithSignaturesResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc GetCommitSignatures(GetCommitSignaturesRequest) returns (stream GetCommitSignaturesResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// This comment is left unintentionally blank.
rpc GetCommitMessages(GetCommitMessagesRequest) returns (stream GetCommitMessagesResponse) {
option (op_type) = {
op: ACCESSOR
};
}
// CheckObjectsExist will check for the existence of revisions against a
// repository. It returns two sets of data. An array containing the revisions
// fromm the input that it found on the repository, and an array that contains all
// revisions from the input it did not find on the repository.
rpc CheckObjectsExist(stream CheckObjectsExistRequest) returns (stream CheckObjectsExistResponse) {
option (op_type) = {
op: ACCESSOR
};
}
}
// ListCommitsRequest is a request for the ListCommits RPC.
message ListCommitsRequest {
// Order is the order in which commits shoud be traversed.
enum Order {
// NONE defaults to reverse chronological order.
NONE = 0;
// TOPO order will cause no parents to be shown before all of its children
// are shown. Furthermore, multiple lines of history will not be
// intermixed.
TOPO = 1;
// DATE order will cause no parents to be shown before all of its children
// are shown. Otherwise, commits are shown in commit timestamp order. This
// can cause history to be shown intermixed.
DATE = 2;
};
// Repository is the repository in which commits should be searched for.
Repository repository = 1 [(target_repository)=true];
// Revisions is the set of revisions which should be walked to enumerate
// commits. Accepts all notation as documented in gitrevisions(7) as well as
// the pseudo-revisions `--not` and `--all` as documented in git-rev-list(1).
// Must not be empty.
repeated string revisions = 2;
// PaginationParams allows implementation of pagination. The page token is
// the last commit OID that was sent. It's expected to be the full object ID
// to guard against ambigious OIDs.
PaginationParameter pagination_params = 3;
// Order is the order in which commits should be traversed. Please refer to
// the enum's documentation for further information.
Order order = 4;
// Reverse will cause all commits to be listed in reverse.
bool reverse = 11;
// MaxParents will skip all commits which have more than the specified number
// of parents. If set to `0`, no filtering by parents will happen. If set to
// `1`, all merge commits will be omitted.
uint32 max_parents = 5;
// DisableWalk will disable walking the graph. As a result, only commits
// which are immediately referenced by Revisions will be returned.
bool disable_walk = 6;
// FirstParent will cause the graph walk to only go down the first-parent
// chain of commits. Merge commits will thus only cause the mainline to be
// enumerated.
bool first_parent = 7;
// After will only list commits which are more recent than the specified date.
google.protobuf.Timestamp after = 8;
// After will only list commits which are older than the specified date.
google.protobuf.Timestamp before = 9;
// Author will only list commits whose author matches the given pattern,
// which is a regular expression.
bytes author = 10;
}
// ListCommitsResponse is a response for the ListCommits RPC.
message ListCommitsResponse {
// Commits is the list of commits found.
repeated GitCommit commits = 1;
}
// ListAllCommitsRequest is a request for the ListAllCommits RPC.
message ListAllCommitsRequest {
// Repository is the repository in which commits should be searched for.
Repository repository = 1 [(target_repository)=true];
// PaginationParams allows implementation of pagination. The page token is
// the last commit OID that was sent. It's expected to be the full object ID
// to guard against ambigious OIDs.
PaginationParameter pagination_params = 2;
}
// ListAllCommitsResponse is a response for the ListAllCommits RPC.
message ListAllCommitsResponse {
// Commits is the list of commits found.
repeated GitCommit commits = 1;
}
// This comment is left unintentionally blank.
message CommitStatsRequest {
Repository repository = 1 [(target_repository)=true];
bytes revision = 2;
}
// This comment is left unintentionally blank.
message CommitStatsResponse {
// OID is the commit. Empty means not found
string oid = 1;
int32 additions = 2;
int32 deletions = 3;
}
// This comment is left unintentionally blank.
message CommitIsAncestorRequest {
Repository repository = 1 [(target_repository)=true];
string ancestor_id = 2;
string child_id = 3;
}
// This comment is left unintentionally blank.
message CommitIsAncestorResponse {
bool value = 1;
}
// This comment is left unintentionally blank.
message TreeEntryRequest {
Repository repository = 1 [(target_repository)=true];
// commit ID or refname
bytes revision = 2;
// entry path relative to repository root
bytes path = 3;
// Limit is the maximum number of bytes to fetch. If object is bigger, remaining bytes are not sent
// 0 means there is no limit.
int64 limit = 4;
// MaxSize is the maximum allowed object size. If bigger, a FailedPrecondition error is returned
// 0 means there is no maximum size.
int64 max_size = 5;
}
// This comment is left unintentionally blank.
message TreeEntryResponse {
// TODO: Replace this enum with ObjectType in shared.proto
enum ObjectType {
// This comment is left unintentionally blank.
COMMIT = 0;
// This comment is left unintentionally blank.
BLOB = 1;
// This comment is left unintentionally blank.
TREE = 2;
// This comment is left unintentionally blank.
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;
}
// This comment is left unintentionally blank.
message CountCommitsRequest {
Repository repository = 1 [(target_repository)=true];
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;
bool first_parent = 8;
GlobalOptions global_options = 9;
}
// This comment is left unintentionally blank.
message CountCommitsResponse {
int32 count = 1;
}
// This comment is left unintentionally blank.
message CountDivergingCommitsRequest {
Repository repository = 1 [(target_repository)=true];
bytes from = 2;
bytes to = 3;
reserved 4;
reserved 5;
reserved 6;
int32 max_count = 7;
}
// This comment is left unintentionally blank.
message CountDivergingCommitsResponse {
int32 left_count = 1;
int32 right_count = 2;
}
// This comment is left unintentionally blank.
message TreeEntry {
// TODO: Replace this enum with ObjectType in shared.proto
enum EntryType {
// This comment is left unintentionally blank.
BLOB = 0;
// This comment is left unintentionally blank.
TREE = 1;
// This comment is left unintentionally blank.
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;
}
// This comment is left unintentionally blank.
message GetTreeEntriesRequest {
// This comment is left unintentionally blank.
enum SortBy {
// This comment is left unintentionally blank.
DEFAULT = 0; // Preserve order of git ls-tree
// This comment is left unintentionally blank.
TREES_FIRST = 1; // trees, blobs, submodules
}
Repository repository = 1 [(target_repository)=true];
bytes revision = 2;
bytes path = 3;
bool recursive = 4;
SortBy sort = 5;
// The page token is the last commit OID that was sent. It's expected to be the
// full object ID to guard against ambigious OIDs.
PaginationParameter pagination_params = 6;
}
// This comment is left unintentionally blank.
message GetTreeEntriesResponse {
repeated TreeEntry entries = 1;
PaginationCursor pagination_cursor = 2;
}
// This comment is left unintentionally blank.
message ListFilesRequest {
Repository repository = 1 [(target_repository)=true];
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;
}
// This comment is left unintentionally blank.
message FindCommitRequest {
Repository repository = 1 [(target_repository)=true];
bytes revision = 2;
bool trailers = 3;
}
// This comment is left unintentionally blank.
message FindCommitResponse {
// commit is nil when the commit was not found
GitCommit commit = 1;
}
// This comment is left unintentionally blank.
message ListCommitsByOidRequest {
Repository repository = 1 [(target_repository)=true];
repeated string oid = 2; // protolint:disable:this REPEATED_FIELD_NAMES_PLURALIZED
}
// This comment is left unintentionally blank.
message ListCommitsByOidResponse {
repeated GitCommit commits = 1;
}
// This comment is left unintentionally blank.
message ListCommitsByRefNameRequest {
Repository repository = 1 [(target_repository)=true];
repeated bytes ref_names = 2;
}
// This comment is left unintentionally blank.
message ListCommitsByRefNameResponse {
reserved 1;
// This comment is left unintentionally blank.
message CommitForRef {
GitCommit commit = 1;
bytes ref_name = 2;
}
repeated CommitForRef commit_refs = 2;
}
// This comment is left unintentionally blank.
message FindAllCommitsRequest {
// This comment is left unintentionally blank.
enum Order {
// This comment is left unintentionally blank.
NONE = 0;
// This comment is left unintentionally blank.
TOPO = 1;
// This comment is left unintentionally blank.
DATE = 2;
}
Repository repository = 1 [(target_repository)=true];
// When nil, return all commits reachable by any branch in the repo
bytes revision = 2;
int32 max_count = 3;
int32 skip = 4;
Order order = 5;
}
// A single 'page' of the result set
message FindAllCommitsResponse {
repeated GitCommit commits = 1;
}
// This comment is left unintentionally blank.
message FindCommitsRequest {
// This comment is left unintentionally blank.
enum Order {
// This comment is left unintentionally blank.
NONE = 0;
// This comment is left unintentionally blank.
TOPO = 1;
}
Repository repository = 1 [(target_repository)=true];
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;
bool first_parent = 12;
bytes author = 13;
Order order = 14;
GlobalOptions global_options = 15;
bool trailers = 16;
}
// A single 'page' of the result set
message FindCommitsResponse {
repeated GitCommit commits = 1;
}
// This comment is left unintentionally blank.
message CommitLanguagesRequest {
Repository repository = 1 [(target_repository)=true];
bytes revision = 2;
}
// This comment is left unintentionally blank.
message CommitLanguagesResponse {
// This comment is left unintentionally blank.
message Language {
string name = 1;
float share = 2;
string color = 3;
uint32 file_count = 4;
uint64 bytes = 5;
}
repeated Language languages = 1;
}
// This comment is left unintentionally blank.
message RawBlameRequest {
Repository repository = 1 [(target_repository)=true];
bytes revision = 2;
bytes path = 3;
// Comma-separated range of line numbers to perform the blame on: "1,1000".
// Optional - if no range is provided, the whole file will be blamed.
bytes range = 4;
}
// This comment is left unintentionally blank.
message RawBlameResponse {
bytes data = 1;
}
// This comment is left unintentionally blank.
message LastCommitForPathRequest {
Repository repository = 1 [(target_repository)=true];
bytes revision = 2;
bytes path = 3;
bool literal_pathspec = 4; // Deprecate after Rails stops using this
GlobalOptions global_options = 5;
}
// This comment is left unintentionally blank.
message LastCommitForPathResponse {
// commit is nil when the commit was not found
GitCommit commit = 1;
}
// This comment is left unintentionally blank.
message ListLastCommitsForTreeRequest {
Repository repository = 1 [(target_repository)=true];
string revision = 2;
bytes path = 3;
int32 limit = 4;
int32 offset = 5;
bool literal_pathspec = 6 [deprecated = true];
GlobalOptions global_options = 7;
}
// This comment is left unintentionally blank.
message ListLastCommitsForTreeResponse {
// This comment is left unintentionally blank.
message CommitForTree {
reserved 1;
GitCommit commit = 2;
reserved 3;
bytes path_bytes = 4;
}
repeated CommitForTree commits = 1;
}
// This comment is left unintentionally blank.
message CommitsByMessageRequest {
Repository repository = 1 [(target_repository)=true];
bytes revision = 2;
int32 offset = 3;
int32 limit = 4;
bytes path = 5;
string query = 6;
GlobalOptions global_options = 7;
}
// One 'page' of the paginated response of CommitsByMessage
message CommitsByMessageResponse {
repeated GitCommit commits = 1;
}
// This comment is left unintentionally blank.
message FilterShasWithSignaturesRequest {
Repository repository = 1 [(target_repository)=true];
repeated bytes shas = 2;
}
// This comment is left unintentionally blank.
message FilterShasWithSignaturesResponse {
repeated bytes shas = 1;
}
// This comment is left unintentionally blank.
message ExtractCommitSignatureRequest {
Repository repository = 1 [(target_repository)=true];
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;
}
// This comment is left unintentionally blank.
message GetCommitSignaturesRequest {
Repository repository = 1 [(target_repository)=true];
repeated string commit_ids = 2;
}
// This comment is left unintentionally blank.
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;
}
// This comment is left unintentionally blank.
message GetCommitMessagesRequest {
Repository repository = 1 [(target_repository)=true];
repeated string commit_ids = 2;
}
// This comment is left unintentionally blank.
message GetCommitMessagesResponse {
// Only present for a new commit message
string commit_id = 1;
bytes message = 2;
}
// CheckObjectsExistRequest is a request for the CheckObjectsExist RPC. Only
// the initial request must contain a repository, the repository of all
// subsequent requests will be ignored.
message CheckObjectsExistRequest {
// Repository is the repository in which existence of objects and refs
// are checked.
Repository repository = 1 [(target_repository)=true];
// Revisions contains the revisions that shall be checked for existence. This accepts all revisions
// as documented in gitrevisions(7)
repeated bytes revisions = 2;
}
// This comment is left unintentionally blank.
message CheckObjectsExistResponse {
// This comment is left unintentionally blank.
message RevisionExistence {
bytes name = 1;
bool exists = 2;
};
repeated RevisionExistence revisions = 1;
}
|