I am trying to make the equivalent of the following using libgit2:
git log -z --all --topo-order
I am having problems with 1) finding the easiest way to pop all refs in revwalker and 2) getting the results in the same order. I can see the old branches go up, although I tried various combinations of topological and temporal sorting.
My last attempt included calling git_revwalk_push_glob(walk, "refs/*") , but not all branches came out. In one test repo there are two local branches, and one (current) one is missing.
I actually do this in a git lens, but the GTEnumerator interface is a bit limited, so I need to extend it.
Update: I continued to manually drag and drop refs / heads, refs / remotes and refs / tags (as well as all stashes, because I really want more than just the top). The problem of ordering remains.
source share