I'm trying to do the equivalent of the following using libgit2:
git log -z --all --topo-order
I'm having trouble with 1) finding the easiest way to push all the refs into the revwalker and 2) getting the results in the same order. I keep seeing older branches come up near the top, though I've tried various combinations of topological and time sorting.
My latest attempt involved calling git_revwalk_push_glob(walk, "refs/*")
, but not all of the branches came out. One test repo has two local branches, and one (the current one) was missing.
I'm actually doing this in objective-git, but the GTEnumerator interface is a bit limited so I'm having to extend it.
Update: I went ahead with manually pushing refs/heads, refs/remotes, and refs/tags (as well as all stashes because I actually want more than just the top). The ordering problem remains.