Re: [PATCH v7] read-cache: force_verify_index_checksum
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 26, 2017, 03:25 UTC
- Message-ID
- <xmqq60hru9xg.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <alpine.DEB.2.20.1704252225450.3480@virtualbox>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 5 quoted lines
> 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.