I need to draw a graph out of a Git repository using JGit.
I've been thinking about different ways to traverse the commits. I need to be able to draw a graph/graphs out of the branches/commits, and I also need to be able to do it within arbitrary ranges, like let's say from 200th commit to 250th commit (skipping the 200 most recently made commits).
How should I traverse the repository? Using RevWalk
? I'd like to keep it adequately performant, and I was wondering if there's a one definite way to do this well.
Update: Basically I'm looking into making something like git log --graph -n 50 --skip 200
which shows a graph of the repository between 200-250 commits in creation order. Now I just want to do this myself. :)
Update 2: It would be nice if I could also iterate over the ones that are dangling (have no references), and draw them in gray color.