MCPcopy Index your code
hub / github.com/go-git/go-git / NewCommitPostorderIter

Function NewCommitPostorderIter

plumbing/object/commit_walker.go:129–139  ·  view source on GitHub ↗

NewCommitPostorderIter returns a CommitIter that walks the commit history like WalkCommitHistory but in post-order. This means that after walking a merge commit, the merged commit will be walked before the base it was merged on. This can be useful if you wish to see the history in chronological orde

(c *Commit, ignore []plumbing.Hash)

Source from the content-addressed store, hash-verified

127// it was merged on. This can be useful if you wish to see the history in
128// chronological order. Ignore allows to skip some commits from being iterated.
129func NewCommitPostorderIter(c *Commit, ignore []plumbing.Hash) CommitIter {
130 seen := make(map[plumbing.Hash]bool)
131 for _, h := range ignore {
132 seen[h] = true
133 }
134
135 return &commitPostIterator{
136 stack: []*Commit{c},
137 seen: seen,
138 }
139}
140
141func (w *commitPostIterator) Next() (*Commit, error) {
142 for {

Callers 3

commitIterFuncFunction · 0.92

Calls

no outgoing calls

Tested by 2

Used in the wild real call sites across dependent graphs

searching dependent graphs…