Re: [PATCH v2 3/5] commit-graph: create new version flags
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Apr 25, 2019, 21:31 UTC
- Message-ID
- <87bm0tsrf0.fsf@evledraar.gmail.com>
- In-Reply-To
- <4ddb82916321f093d88282ef4bcab99993339fb5.1556135881.git.gitgitgadget@gmail.com>
On Wed, Apr 24 2019, Derrick Stolee via GitGitGadget wrote:
Show 18 quoted lines
> - hash_version = *(unsigned char*)(data + 5);
> - if (hash_version != oid_version()) {
> - error(_("commit-graph hash version %X does not match version %X"),
> - hash_version, oid_version());
> + graph_version, 1);
> return NULL;
> }
>
> graph = alloc_commit_graph();
>
> + switch (graph_version) {
> + case 1:
> + hash_version = *(unsigned char*)(data + 5);
> + if (hash_version != oid_version()) {
> + error(_("commit-graph hash version %X does not match version %X"),
> + hash_version, oid_version());
> + return NULL;
> + }This is just munging existing code, but one thing in my series that I didn't follow-up on was Duy's suggestion[1] of %X here being nonsensical.
It doesn't make sense to start saying "version A" here when we make it to version 10, however unlikely that is :)
So I think for the existing %X in this file it should be 0x%X as he suggests, except in cases like this where we should just use %d.
1. https://public-inbox.org/git/CACsJy8DgNzGK3g2P7ZyRmd7sbiSOXY07KqYEh-gSsPkEZ+D5Qw@mail.gmail.com/