code: func (r *Rewriter) commitsToMigrate(opt *RewriteOptions) ([][]byte, error) {
  	waiter := r.l.Waiter("migrate: Sorting commits")
  	defer waiter.Complete()
  
  	scanner, err := git.NewRevListScanner(
  		opt.Include, opt.Exclude, r.scannerOpts())
  	if err != nil {
  		return nil, err
  	}
  
  	var commits [][]byte
  	for scanner.Scan() {
  		commits = append(commits, scanner.OID())
  	}
  
  	if err = scanner.Err(); err != nil {
  		return nil, err
  	}
  	if err = scanner.Close(); err != nil {
  		return nil, err
  	}
  	return commits, nil
  }
docs: // commitsToMigrate returns an in-memory copy of a list of commits according to
  // the output of git-rev-list(1) (given the *RewriteOptions), where each
  // outputted commit is 20 bytes of raw SHA1.
  //
  // If any error was encountered, it will be returned.