From: karthik nayak Date: Mon, 18 Nov 2024 13:54:18 GMT Subject: Re: [PATCH v2 3/7] reftable/system: stop depending on "hash.h" Message-ID: In-Reply-To: <745c1a070ddd7180f0ee89c6a1d057a256894599.1731047193.git.ps@pks.im> Patrick Steinhardt writes: > We include "hash.h" in "reftable/system.h" such that we can use hash > format IDs as well as the raw size of SHA1 and SHA256. As we are in the > process of converting the reftable library to become standalone we of > course cannot rely on those constants anymore. > > Introduce a new `enum reftable_hash` to replace internal uses of the > hash format IDs and new constants that replace internal uses of the hash > size. Adapt the reftable backend to set up the correct hash function. > So with this patch, we now have: - `REFTABLE_FORMAT_ID_SHA1` & `REFTABLE_FORMAT_ID_SHA256` which is what is stored on disk and used while reading/writing. - `enum reftable_hash` which is used to identify the hash function internally in the reftable code. Both of which are separated. Nice! - Karthik