Simplified getCommits code