Subject: Re: [PATCH 0/7] pack-objects: Create an alternative name hash algorithm (recreated)

From: Junio C Hamano <[email-masked]>
Date: Mon, 25 Nov 2024 08:57:57 +0900

Derrick Stolee <[email-masked]> writes:

>>   (1) it hashes each path component separetely and rotates the whole
>>       thing only at a directory boundary.  I'd imagine that this
>>       would make a big difference for languages that force overly
>>       long filenames at each level.
>
> I was confused by the "rotates the whole thing only at a directory
> boundary" statement.

Yeah, I guess it was confusing.  What I meant was that the entire
result is shifted down with new material from left to right, but
unlike the original, the outer thing (i.e. what is given to the
caller as the result) is shifted only at the directory boundary, so
we are not as aggressive to lose early bits by shifting them down to
the right, as we are not shifting as fast as before.

> I think one way to say what you mean is
>
>   Each path component is hashed similarly to the standard name-hash,
>   and parent path component hashes are contributed via XOR after a
>   down-shift of 6 bits per level.

Yes.