Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Using Rust to generate Mercurial short-hash collisions (jandemooij.nl)
32 points by jordigh on May 6, 2015 | hide | past | favorite | 3 comments


Heh, and he submitted a bug report about it:

http://bz.selenic.com/show_bug.cgi?id=4649

I'm not quite sure what to do about this, because it takes about 10 million commits before such collisions are likely to happen naturally, and it was a conscious computation from the early Mercurial days that, "12 displayed hash characters ought to be enough for everyone" (paraphrased).

It's not exactly a new revelation that this is a problem. It's even less of a problem when most of the time you use tags, bookmarks, or revsets to refer to commits, and like he says in the report, fixing this could incur a small performance penalty while hg computes what the shortest unique prefix is on a large repo.


Why is it noteworthy that it was done using rust?


Other than being a task that's inherently CPU-bound, not much. There's been a lot of Mozillians itching to have any excuse to play with Rust lately. :P




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: