git-graph icon indicating copy to clipboard operation
git-graph copied to clipboard

FR: SVG output to include text, commit hashes etc

Open positron96 opened this issue 1 year ago • 3 comments

I am looking for a tool to generate an image of a git graph. It looked like this program would do what I need as the screenshots show very good-looking graphs, but its SVG output is missing a lot of what it shown in terminal (i.e. only the graph is present, no commit messages, hashes, etc).

positron96 avatar Sep 18 '24 14:09 positron96

PR for this would be welcome. This require some knowledge of how to format and place text in SVG.

peso avatar Nov 20 '25 16:11 peso

Unfortunately, I don't speak Rust. However, SVG has been around for a long time, so I'd expect LLM to give decent information about the format (couple days ago I was able to create a simple SVG generator this way).

positron96 avatar Dec 10 '25 12:12 positron96

It might be not related to this issue, but maybe can use "data-xxx" attributes (See data-* - SVG | MDN) to add some metadata to svg nodes as a workround?

Something like:

<circle /* ... */ data-commit-hash="xxx" data-commit-title="xxx" data-authors="xxx, yyy"/>

I think the commit hash info will be very useful. Then we can do some post processing on the generated svg and make use of the metadata.

AzurIce avatar Dec 10 '25 17:12 AzurIce