def load_commits(range)
      if range.first == ''
        base_commit = nil
        range = range.last
      else
        base_commit = @grit_repo.commit(range.first)
        range = '%s..%s' % [range.first, range.last]
      end

      options = { :pretty => 'raw', :timeout => false }
      output = @grit_repo.git.native :rev_list, options, range
      commits = ::Grit::Commit.list_from_string @grit_repo, output

      [base_commit, commits]
    end
def load_commits(range)
      if range.first == ''
        base_commit = nil
        range = range.last
      else
        base_commit = @grit_repo.commit(range.first)
        range = '%s..%s' % [range.first, range.last]
      end

      options = { :pretty => 'raw', :timeout => false }
      output = @grit_repo.git.native :rev_list, options, range
      commits = ::Grit::Commit.list_from_string @grit_repo, output

      [base_commit, commits]
    end
This method uses Grit to load all commits from the given commit range

 Because of some Grit internal limitations, the commits have to be loaded
 in batches of up to 300 commits.

 @note Grit will choke on huge repositories, like Homebrew or the Linux
       kernel. You will have to raise the timeout limit using
       `Grit.git_timeout=`.
 @param [String, Range] range The range of commits for which the commits
        should be loaded. This may be given as a string
        (`'master..development'`), a range (`'master'..'development'`)
        or as a single ref (`'master'`). A single ref name means all
        commits reachable from that ref.
 @return [Grit::Commit, nil] The base commit of the requested range or
         `nil` if the the range starts at the beginning of the history
 @return [Array<Grit::Commit>] All commits in the given commit range
 @see Grit::Repo#commits