Re: [PATCH v3 4/5] builtin/hash-object: fix uninitialized hash function
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 14, 2024, 15:55 UTC
- Message-ID
- <xmqq8r0c5qwu.fsf@gitster.g>
- In-Reply-To
- <ZkLpVSVv1XPz-D8v@tanuki>
Patrick Steinhardt <ps@pks.im> writes:
Show 9 quoted lines
> I'd prefer the latter -- always use SHA-1. As you say, it's easier to > understand and doesn't create implicit mechanisms that we'll have to > maintain going forward. Also, users didn't have a desire yet to pick a > different algorithm than SHA-1, which probably also comes from the fact > that SHA-256 repositories are still scarce. > ... > Eventually, we should then add a new option `--object-hash=` to > git-hash-object(1) and other commands that may run outside of a Git > repository to let the user pick their desired hash.
If we were planning to allow using something other than SHA-1 in the future, then I do not think I agree with your argument. We can use the same GIT_DEFAULT_HASH mechanism to specify what hash to use without later adding an extra option just fine.