code: func NewCommitAllIter(repoStorer storage.Storer, commitIterFunc func(*Commit) CommitIter) (CommitIter, error) {
  	commitsPath := list.New()
  	commitsLookup := make(map[plumbing.Hash]*list.Element)
  	head, err := storer.ResolveReference(repoStorer, plumbing.HEAD)
  	if err == nil {
  		err = addReference(repoStorer, commitIterFunc, head, commitsPath, commitsLookup)
  	}
  
  	if err != nil && err != plumbing.ErrReferenceNotFound {
  		return nil, err
  	}
  
  	// add all references along with the HEAD
  	refIter, err := repoStorer.IterReferences()
  	if err != nil {
  		return nil, err
  	}
  	defer refIter.Close()
  
  	for {
  		ref, err := refIter.Next()
  		if err == io.EOF {
  			break
  		}
  
  		if err == plumbing.ErrReferenceNotFound {
  			continue
  		}
  
  		if err != nil {
  			return nil, err
  		}
  
  		if err = addReference(repoStorer, commitIterFunc, ref, commitsPath, commitsLookup); err != nil {
  			return nil, err
  		}
  	}
  
  	return &commitAllIterator{commitsPath.Front()}, nil
  }
docs: // NewCommitAllIter returns a new commit iterator for all refs.
  // repoStorer is a repo Storer used to get commits and references.
  // commitIterFunc is a commit iterator function, used to iterate through ref commits in chosen order