Why have humans evolved the ability to grow the hair on their heads long?

In most mammals the ability to grow long hair is an adaption for the cold and mammals that come from warmer climates tend to have hair (or fur) that grows to a standard length (as it were) and then not get any longer.  Human head hair seems to violate this rule and I have been trying to think of the reason why this is in evolutionary terms.

It is likely that a mutation(s) occured during the course of evolution that gave a selective advantage to growing long hair.  We lose up to 80% of heat from the head (the scalp is particularly vascular) and so it would be advantageous to have it well insulated.  Probably other species either did not develop the mutation(s), or if they did, it did not offer enough of a selective advantage to survive through evolution.

There are also other theories discussed briefly here:

I would add that human hair does not grow indefinitely. It has a shedding rate that combined with the growth rate determines how long any particular hair can get. Older hairs tend to get damaged and so we cut them off quite regularly (before they're shed), but uncut hair would eventually only reach a particular length anyway.

That said, human hair does get very long in comparison to most other mammals. This may in part be related to human social behaviour, particularly grooming. Long hair may be an indicator of fitness, since it requires a lot of maintenance to keep it in good condition. Possibly longer hair would indicate that individuals had a high position in a society, so they could command more grooming time - which may have made long hair beneficial in attracting high quality mates. Males have clearly different hair patterns to females, suggesting that facial hair also plays a role in sexual selection (maybe as an indicator of maturity).

There are other more practical aspect of long hair, such as insulation agains the cold and protection from the sun. Maybe we have long hair just to keep the sun off our neck and shoulders?