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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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+D5Qw@xxxxxxxxxxxxxx/



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux