Re: [GSoC PATCH 2/2] repo: add the field objects.format
- From
Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
- Date
- Aug 26, 2025, 14:51 UTC
- Message-ID
- <261E9FC0-EE4A-4B4B-BA21-69B93EBA6933@gmail.com>
- In-Reply-To
- <xmqqh5y01mv3.fsf@gitster.g>
> Yes, and extensions.objectFormat specifies the hash algorithm used > in the repository, extensions.compatObjectFormat specifies a > compatibility algorithm to use. So objectFormat is a good name to > call this new "repository metadata".
I was discussing with Patrick some weeks ago about the compatibility formats. By now, the "storage", "input", and "output" formats are the same. For example, rev-parse already has those options, even though they return the same value (2eabd38313 (rev-parse: add a --show-object-format option, 2019-10-28)).
Repo info is easy to handle this situation in the future by just adding a new field. By now, objects.format returns the storage format. If/when we have those formats implemented, I think a good approach would be add two more values to `objects`:
objects.input-format=... objects.output-format=...
> Perhaps drop "s" from "objects.format" before it becomes too late?
Ok!
> We may also want to reconsider references.format as that is not in > line with either extensions.refStorage or --ref-format (taken by > 'git init' and 'git clone').
What would be a better name? reference.format or ref.format?
> Do these keys always have to be two words separated by dots?
The idea is to group everything into categories, than it will be easier. I have a future feature planned for that one could call, for example, `git repo layout` and then it will return both layout.bare and layout.shallow.
> I am asking if there are other keys that would plausibly fit next to this > object.format thing. object.count to report how many objects there > are in the repository, or things like that, perhaps?
Given that it would survey how many objects exist in the repository, this would be better placed in the planned `git repo survey` that Justin is working on (we discussed a little more about that in https://lore.kernel.org/git/vygdkwopfzrbdpxpxebnq3xdlg3ow4i3w5y5evduae2zuelqcn@la2dikht2qrf/ ). I'm cc'ing Justin here for more info about it.
In the `info` side, by now I don't remember any other key to be placed under `object` aside from the aforementioned input and output format. Perhaps an idea is whether we're using packfiles or only loose objects, but I don't know if it would be useful.
Thanks!