sort commits by time before calculating time between commits