2 ms·
If you used a dictionary of 100 words, you would get a prefix collision every 100 commits, i.e., within days or weeks for even moderately busy projects. Using a
by tom_mellior 6y ago
If you used a dictionary of 100 words, you would get a prefix collision every 100 commits, i.e., within days or weeks for even moderately busy projects. Using a larger list would just shift the problem by a bit. You could use tuples of words (like https://en.wikipedia.org/wiki/What3words https://en.wikipedia.org/wiki/What3words for example) to avoid the problem. But then you'd be much longer than current Git hash prefixes.
And why? What would be the use? The two things I do with Git hashes: (a) copy and paste, for searching for something; (b) occasionally visually comparing hashes. Copy and paste works well, in fact in pretty much any terminal or other tool double click will select the whole hash, which wouldn't be as simple if the hash were multiple words with separators. Visual comparison might be marginally easier with familiar words, but for me it's a niche use case, so I don't think optimizing for it would be useful.
- m463 6y agomy last line addressed 100 words. I also was trying to augment the current system, not replace it. so the "92" and the word "new" were equivalent and you could use one, or the other or both. The basic idea I'm putting forward, is that I think it would be easier, on the command line, than copy-paste (which requires a mouse) I can type words pretty fast, and I can keep a word in memory easily. Remember it extends the current model without changing it.