Rewrite git prompt building, hoping it is faster