From: Junio C Hamano Date: Wed, 16 Aug 2017 19:32:19 GMT Subject: Re: [PATCH 2/5] sha1_file: fix hardcoded size in null_sha1 Message-ID: In-Reply-To: Patryk Obara writes: > Junio C Hamano wrote: > >> I said this is OK for "null" because we assume we will use ^\0{len}$ >> for any hash function we choose as the "impossible" value, and for >> that particular use pattern, we do not need such a union. Just >> letting the caller peek at an appropriate number of bytes at the >> beginning of that NUL buffer for hash the caller wants to use is >> sufficient. > > Do you think I should record this explanation as either commit message > or comment in sha1_file.c? > >> MAX is inevitable only if we envision that we have to handle objects >> named using two or more hashing schemes at the same time, with the >> same binary and during the same run inside a single process. > > I think this will be the case if "transition one local repository at > a time" from Jonathan Nieder's transition plan will be followed. > This plan assumes object_id translation happening e.g. during fetch > operation. It would be good if that assumption is made explicit. Thanks.