Re: pushing for a new hash, was Re: [PATCH 2/3] rebase: Add tests for console output
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 3, 2017, 00:36 UTC
- Message-ID
- <xmqqr2z1x5zh.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170602175455.GA30988@aiede.mtv.corp.google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 8 quoted lines
> 2. Hard-coded object ids in tests: As Stefan hinted, many tests beyond > t00* make assumptions about the exact values of object ids. That's > bad for maintainability for other reasons beyond the hash function > transition, too. > > It should be possible to suss them out by patching git's sha1 > routine to use the ones-complement of sha1 (~sha1) instead and > seeing which tests fail.
One particularly nasty one is t1512-rev-parse-disambiguation that ensures that the abbreviation and disambiguation works correctly. It uses a set of objects (tags, commits, trees and blobs) whose object names all begin with number of "0"; which will of course become useless once we change the hash function.
No matter what new hash function is chosen, we'd need a similar test to ensure that disambiguation works correctly, so one of the tasks for hash migration is to port (not drop) this test.