Re: [PATCH 2/3] commit-graph: use the hash version byte
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 14, 2020, 20:22 UTC
- Message-ID
- <xmqqy2mhuge2.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200814201153.GK8085@camp.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 13 quoted lines
> Can we maybe say something like this?
>
> switch (hash_algo_by_ptr(the_hash_algo)) {
> case GIT_HASH_SHA1:
> return 1;
> case GIT_HASH_SHA256:
> return 2;
> default:
> die(_("invalid hash version"));
> }
>
> That way if SHA-256 gets broken and we switch to another 256-bit hash
> (SHA-3-256?), we'll be forced to update this properly.Excellent.