Improve branch color hashing
Created originally on Bitbucket by schlamar (Marc Schlaich)
The current branch coloring strategy is pretty bad for versioned branch names as it collides very often.
_hashcolor('V1_2') == _hashcolor('V2_1') == _hashcolor('V3_0').
Additionally, the color for these branch names is the default blue color. So everything is blue if you have these active 4 branches. This is really ugly!
- Do not reuse the "default" color. It's very likely that the default branch is always active and near top, so another branch shouldn't get this color.
- Use a proper hash function instead of
sum(ord(...to prevent collisions in versioned branches
Keywords: colour, colouring