RFT: get commits with generator using yield instead of pop

Need to keep commits attribute