Re: [PATCH v3 1/8] pack-objects: create new name-hash function version
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Jan 22, 2025, 22:08 UTC
- Message-ID
- <Z5FsZ7MK6YcmeYIV@nand.local>
- In-Reply-To
- <68b4127580e2d475bec0d7cd0f6a9ae5e626b3c9.1734715194.git.gitgitgadget@gmail.com>
On Fri, Dec 20, 2024 at 05:19:47PM +0000, Jonathan Tan via GitGitGadget wrote:
Show 6 quoted lines
> The first change is to be more careful about paths using non-ASCII > characters. With these characters in mind, reverse the bits in the byte > as the least-significant bits have the highest entropy and we want to > maximize their influence. This is done with some bit manipulation that > swaps the two halves, then the quarters within those halves, and then > the bits within those quarters.
Makes sense, and seems quite reasonable.
Show 7 quoted lines
> The second change is to perform hash composition operations at every > level of the path. This is done by storing a 'base' hash value that > contains the hash of the parent directory. When reaching a directory > boundary, we XOR the current level's name-hash value with a downshift of > the previous level's hash. This perturbation intends to create low-bit > distinctions for paths with the same final 16 bytes but distinct parent > directory structures.
Very clever, I love this idea.
Thanks, Taylor