Re: [PATCH v7] read-cache: force_verify_index_checksum

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes:

> Just in case that certain reviewers favor length over readability, let me
> offer this snippet:
>
> 	size=$(perl -e "print -s \".git/index\"") &&
> 	dd if=/dev/zero of=.git/index bs=1 seek=$(($size-20) count=20

Yup, this does sound like a good direction to go (I think you have
some unbalanced parens but it is sufficient to convey the idea).

> Since whatever hash will be used in the future is most likely larger than
> 20 bytes, this should still work fine (and even if somebody sane replaces
> the SHA-1 of the index with a CRC-32 for the same benefit we have now, the
> test will fail quickly and it is easy to replace the 20 by 4).

True that, too.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]