On Wed, Apr 24 2019, Derrick Stolee via GitGitGadget wrote:

> -     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+d...@mail.gmail.com/

Reply via email to