rev-list/log: factor out revision mark generation