Complete and extend the remote-object-info command for git cat-file
Git's partial clone allows cloning repositories without downloading all objects (blobs, trees, ...). These objects are fetched on demand from the remote when needed. However, when a user needs metadata about these remote objects (size, type, hash, ...), Git has no efficient way of doing this without downloading all the object content. The server side support for `object-info` protocol was implemented by Calvin Wan in 2021. Eric Ju built the client-side `remote-object-info` for `cat-file --batch-command`. This project finishes Eric Ju's work on `remote-object-info` for `git cat-file --batch-command`, resolves the pending feedback from Junio Hamano and Jeff King, and extends support for `%(objecttype)`. The main technical fix is to replace the insufficient `strstr()` format validation with an `allow_list` to prevent crashes on unsupported placeholders, and extending the v2 protocol server and client to handle `%(objecttype)`. After the project, Git will have a working `remote-object-info` for `cat-file --batch-command` supporting `%(objectsize)`, and a v2 protocol extension adding `%(objecttype)` support on both server and client, with tests and documentation.
Project details
Technologies
Not listed in the archive