Subject: Re: [PATCH v2 3/5] commit-graph: create new version flags

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Thu, 25 Apr 2019 23:31:31 +0200

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/[email-masked]/