On Mon, Jan 13, 2020 at 6:17 PM brian m. carlson <sandals@xxxxxxxxxxxxxxxxxxxx> wrote: > On 2020-01-13 at 13:41:44, Eric Sunshine wrote: > > The test itself is fine, but it is one of those unfortunate cases of > > checking for absence of something (which is a wide net). As explained > > by the commit message[1] of the patch which added the test, the > > collision occurred only between short OID's. The patch[2] which fixed > > the problem did so by avoiding short OID's in the scripted > > implementation of `git rebase -i` (and also flipped the test from > > `text_expect_failure` to `test_expect_success`). > > > > The test, as currently implemented, is very much specific to SHA-1 > > since the FAKE_COMMIT_MESSAGE="collide2 ac4f2ee" it uses only produces > > a collision with short OID's when SHA-1 is the hashing function, so > > the prerequisite is correct and serves as documentation (even if it > > doesn't affect the outcome of the test). Removing that prerequisite > > should only be done if the test is updated with a different > > FAKE_COMMIT_MESSAGE which causes a short OID collision when SHA-256 is > > used. > > I'll take another look. When I looked at the output, it looked like > they didn't collide anymore even under SHA-1, but perhaps I instrumented > the test wrong and therefore got the wrong result. Thanks for double > checking. They might not collide anymore if the length of a short OID has increased since the test was written[1] (even with the "fix" patch[2] reverted) since, to fail, the test only needed the common prefix of the OID's to collide, where the common prefix was the length of the short OID. So, it's possible that the test doesn't do anything anymore if the short OID length is now longer. (This might suggest that dropping the test would be a path forward.) [1]: 66ae9a57b8 (t3404: rebase -i: demonstrate short SHA-1 collision, 2013-08-23) [2]: 75c6976655 (rebase -i: fix short SHA-1 collision, 2013-08-23)