I can see the text based graph running the command : git log --graph --source.
Is there a way to format the output so that I would be able to parse the color of the branch at any particular line? I played around with –pretty-format, but can’t get anywhere with it.
So for example, if the current branch line is red, it would have some sort of an identifier along with it to tell me it’s a red line.
Edit: I’m also using Node.js. It is not capable of displaying multiple ANSI color codes in a single line.
Edit: The purpose of this task is to be able to reconstruct the console output in my own application and render it through HTML. I have found an alternative solution for this task in my answer.
I found a small script that job for the task that I asked about.
gitgraph.js: http://bluef.github.com/gitgraph.js/
convert git log –graph to image by using HTML5 canvas