Git2graph: Generate a Git graph structure from linear Git history
github.com
github.com
I've had this in my ~/.gitconfig for a while for cases where I want to see how branches merged in my history:
[alias]
lg = log --graph --pretty=format:'%C(red)%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)[%an]%Creset'So if you want to use cairo to render the graph in your native app, you can use it. The renderer is really simple because the go library does all the computation of how to actually render the graph. It tries to be as close looking as possible as "sourcetree" algorithm.
Not sure if this is clear explanation or not !
"Generate a git graph structure from a flat list of git commits"
BTW, a more traditional approach to graph generation uses Graphviz graph language (sometimes called "dot file") to visualize commits. It does not look as neat though, but there are more tooling there [1] [2]
[0] https://docs.github.com/en/free-pro-team@latest/github/admin...