calculate commit as last different msg when none specified