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

Add an option for Rendering breaks when commits have history outside scope

Open Menencia opened this issue 1 month ago • 6 comments

Unpopular opinion : the graph was clearer to read before this change (https://github.com/mlange-42/git-graph/issues/67) :

Image

Now with rendering everything, it has become very messy if we have a lot of branches.

Is it possible to make rendering everything as an option ?

Menencia avatar Dec 02 '25 09:12 Menencia

This is related to issue #55 - to draw only a subset of the full graph. In this case to reduce number of branches.

Can you provide a screenshot of your repository, explaining which parts you would like to get rid of? The image provided is a copy of the one provided in issue 55, but it does not show a lot of branches and therefore not the messyness you refer to.

peso avatar Dec 02 '25 22:12 peso

Image (v0.7) Image (v0.6)

As you can see, v0.6 is cleaner to read.

Menencia avatar Dec 04 '25 17:12 Menencia

IMO v0.6 is kind of wrong, as the connections are missing. These could as well be orphaned branches/commits, which is not clear in v0.6, while it is in v0.7.

mlange-42 avatar Dec 04 '25 18:12 mlange-42

I think there is an important lesson here. Fewer lines feels more clean.

Your graph is complex. If I count correctly, this subset has 10 heads, 5 branch groups/colours, and 8 merges and that is shown using only 11 columns. No wonder things get a little cluttered.

I agree that v0.6 does not show all relevant information. v0.7 could be improved and still keep the accuracy by adding a new symbol to show that a commit has a parent outside scope. This symbol could for example be a single dashed line (e.g. unicode U+254E) below the commit circle.

So this issue is really a feature request for a command line option to do somethings other than drawing a long line when parent is out of scope.

peso avatar Dec 04 '25 20:12 peso

Example with continuation symbol, based on v0.6

Image

peso avatar Dec 05 '25 13:12 peso

Example that use the reduced tail length to reduce graph width. Note that the continuation symbol has to be smaller to avoid obvious confusion, like the two red commits that now are in the same column - but on different branches.

This is more or less how the current algorithm work, if it is given a new "empty tail cell".

Image

peso avatar Dec 05 '25 13:12 peso