Re: [PATCH v5 0/6] cat-file: add --batch-command remote-object-info command
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jul 31, 2022, 08:41 UTC
- Message-ID
- <8a1ff659-2086-f3cf-469a-76f5e2bc60e3@gmail.com>
- In-Reply-To
- <20220728230210.2952731-1-calvinwan@google.com>
Hi Calvin
On 29/07/2022 00:02, Calvin Wan wrote:
Show 6 quoted lines
> Sometimes it is useful to get information about an object without having > to download it completely. The server logic has already been implemented > as “a2ba162cda (object-info: support for retrieving object info, > 2021-04-20)”. This patch implements the client option for it. > > Add `--object-info` option to `cat-file --batch-command`.
This part of the cover letter seems to have been left over from a previous iteration. I noticed that in patch 6 there is a reference to '--object-info' in an error message as well.
This might be a daft question but could we teach cat-file to check if an object is available locally and if it is not retrieve just the metadata from the remote rather than adding a new command to --batch-command? That way it would be transparent to the user and they would not have to worry about whether they might be querying a remote object or not.
Best Wishes
Phillip
Show 42 quoted lines
> This option > allows the client to make an object-info command request to a server > that supports protocol v2. If the server is v2, but does not allow for > the object-info command request, the entire object is fetched and the > relevant object info is returned. > > === Changes since v4 === > - Instead of making 2 rounds trips to determine whether the server can > handle the client object-info request, the server now advertises the > features it can send back so the client can immediately fallback to > fetch if any feature is not supported > - Fixed nits and clarified some documentation/commit messages > > Signed-off-by: Calvin Wan <calvinwan@google.com> > Helped-by: Jonathan Tan <jonathantanmy@google.com> > > Calvin Wan (6): > fetch-pack: refactor packet writing > fetch-pack: move fetch initialization > protocol-caps: initialization bug fix > serve: advertise object-info feature > transport: add client support for object-info > cat-file: add remote-object-info to batch-command > > Documentation/git-cat-file.txt | 16 +- > builtin/cat-file.c | 225 ++++++++++++++++----- > fetch-pack.c | 52 +++-- > fetch-pack.h | 10 + > object-file.c | 11 ++ > object-store.h | 3 + > protocol-caps.c | 2 +- > serve.c | 10 +- > t/t1006-cat-file.sh | 348 +++++++++++++++++++++++++++++++++ > t/t5555-http-smart-common.sh | 2 +- > t/t5701-git-serve.sh | 2 +- > transport-helper.c | 7 +- > transport.c | 110 ++++++++++- > transport.h | 11 ++ > 14 files changed, 734 insertions(+), 75 deletions(-) > > > base-commit: 9dd64cb4d310986dd7b8ca7fff92f9b61e0bd21a