From: Junio C Hamano Date: Fri, 14 Aug 2020 20:22:29 GMT Subject: Re: [PATCH 2/3] commit-graph: use the hash version byte Message-ID: In-Reply-To: <20200814201153.GK8085@camp.crustytoothpaste.net> "brian m. carlson" writes: > 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.