From 639efdf921c3f7998fe40f47c539465970e2a334 Mon Sep 17 00:00:00 2001 From: James Liu Date: Fri, 1 Dec 2023 16:05:07 +1100 Subject: git: Pass rev-list arguments via stdin Modifies the ObjectsSize RPC to pass arguments to the `rev-list` command via stdin instead of the command line. This is now possible after the upgrade to Git v2.42 as pseudo-options are now supported when the `--stdin` mode is used. The RPC logic is restructured such that we create the command and wait for execution in separate steps so revisions can directly be written to stdin, without the use of an intermediary buffer. Additionally, a test has been added to ensure that revisions containing newlines are rejected by existing logic, since we now rely on newlines to delimit successive revisions and options. --- proto/go/gitalypb/repository.pb.go | 4 ---- proto/repository.proto | 4 ---- 2 files changed, 8 deletions(-) (limited to 'proto') diff --git a/proto/go/gitalypb/repository.pb.go b/proto/go/gitalypb/repository.pb.go index 01e2dfe9e..ea006ee5f 100644 --- a/proto/go/gitalypb/repository.pb.go +++ b/proto/go/gitalypb/repository.pb.go @@ -530,10 +530,6 @@ type ObjectsSizeRequest struct { // revisions is the set of revisions that shall be used to compute the object size for. Supports normal revisions as // well as pseudo-revisions like `--not`, `--all`, `--branches[=pattern]`, `--tags[=pattern]` and `--glob=pattern`. // Please refer to the man pages gitrevisions(7) as well as git-rev-list(1) for more information. - // - // Note: due to a restriction in Git v2.41 and older all arguments need to be passed via command line parameters. So - // even though you can send multiple requests, the actual number of revisions that can be passed is limited by the - // maximum command line length. This limitation will be lifted once Gitaly has upgraded to Git v2.42 and later. Revisions [][]byte `protobuf:"bytes,2,rep,name=revisions,proto3" json:"revisions,omitempty"` } diff --git a/proto/repository.proto b/proto/repository.proto index 27c5ce666..f79d2da24 100644 --- a/proto/repository.proto +++ b/proto/repository.proto @@ -503,10 +503,6 @@ message ObjectsSizeRequest { // revisions is the set of revisions that shall be used to compute the object size for. Supports normal revisions as // well as pseudo-revisions like `--not`, `--all`, `--branches[=pattern]`, `--tags[=pattern]` and `--glob=pattern`. // Please refer to the man pages gitrevisions(7) as well as git-rev-list(1) for more information. - // - // Note: due to a restriction in Git v2.41 and older all arguments need to be passed via command line parameters. So - // even though you can send multiple requests, the actual number of revisions that can be passed is limited by the - // maximum command line length. This limitation will be lifted once Gitaly has upgraded to Git v2.42 and later. repeated bytes revisions = 2; } -- cgit v1.2.3