cat-file: add --batch-command remote-object-info command
Under some circumstances, it is useful to get information about an object without having to download it completely (steaming the data).
The server logic has already been implemented as "a2ba162cda (object-info: support for retrieving object info, 2021-04-20)".
This patch adds client functions to communicate with the server. Specifically, a new remote-object-ino
command is added to git cat-file --batch-command
.
Currently only size
info can be retrieved. A example is like this
- The client user starts command `git cat-file --batch-command"
- The client user type in
remote-object-info <remote> <a object SHA>
- The object size is returned without downloading the object on the client
This issue is a prerequisite of git-cat-file: Support for reading objects from a remote without fetching them
This issue is a continuing work effort based on Calvin Wan's v5 patch series
Edited by Eric Ju