Take `gitaly-git2go` parameters as Gobs through standard input
Most of the current gitaly-git2go
commands use JSON for serializing the call parameters to the subprocess. This makes the implementation more involved as mapping the JSON objects to Go native types requires manual work. Go's encoding/gob package can streamline this work by allowing serialization and deserialization directly to native types. Serializing to native types makes also error handling easier as one can pass a typed error's between the processes.
While changing the serialization, we should standardize on taking the call parameters in via standard input. Most of the commands are currently taking the call parameters in via a flag which requires buffering the whole request first. Taking the request in via stdin allows for streaming. While not all of the calls need to stream in the request, we should standardize on stdin to support streaming and minimize the number of different calling conventions.
As of writing, the following commands exist and should be migrated:
-
conflicts
!4036 (merged) -
submodule
!4163 (merged) -
merge
!3805 (merged) -
revert
!2768 (merged) -
resolveConflicts
-
remove JSON encoding and all backward compatibility code !4212 (merged)