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

Collapsible Graph

Open TomasJuocepis opened this issue 4 years ago • 10 comments

Describe the improvement that you'd like A clear and concise description of what you'd like to be improved in Git Graph.

I would love line items in the graph to be collapsible. The main use case for me would be the ability to very quickly visualize the branching structure in a compact view without the noise of long stretches of commits to scroll through. With the existing ability to hide remote branches to do additional branch filtering, ideally, I would be able to see a concise view of my branching. On a project with dozens or even hundreds of commits daily, my own commits get buried down the list fast.

The way I imagine this feature to work is for each commit to have a toggle-able state of collapsed or not collapsed. A user could then select any range of commits and toggle them. All visually adjacent commits/lines (a range) would be collapsed into a single line. Specifics of how to represent different data columns of multiple commits can be discussed further (e.g. Date column can become a date range, or blank; Author can remain if all commits are from the same author but replaced with "{n} authors"; etc). On the graph itself, multiple collapsed commits on a given branch can be visualized in some way. Maybe show a dot-dot-dot pattern, or maybe show a larger circle with a number of commits overlaying the circle.

Bonus features:

  • action to uncollapse all
  • action to collapse "uninteresting" commits (i.e. keep branching commits, keep tagged commits, keep branch-tip commits)

Additional context (optional) Add any other context or screenshots about the improvement here.

Here's a quick example I was able to "photoshop" to illustrate just a simple example:

Current: without collapsing

With collapsing: with collapsing

TomasJuocepis avatar Sep 22 '20 21:09 TomasJuocepis

Hi @TomasJuocepis, Thanks for raising this feature request!

This is quite an interesting feature. I can definitely understand the benefit that this functionality would provide, and can see how it allows a better user experience with the commit topology you provide as an example.

I've had a think about how this could be implemented, and it's actually extremely challenging to do (I assume this is why many other Git UI's don't offer this feature). I'll keep this feature request open to gauge the interest from the Git Graph user community. This will allow me to prioritise it's delivery with the other outstanding feature requests.

mhutchie avatar Sep 23 '20 13:09 mhutchie

This feature would be awesome. I don't know if this would make it easier but maybe instead of a toggle for every commit it could be sufficient to show only commits that are a branch heads, tags or have more children (and so are branching points). That could provide the topology overview as well.

hedgehog-zizi avatar Jan 29 '21 13:01 hedgehog-zizi

+1 for me !!

When there are lots of branches with lots of commits it is hard to see the recent branch and an older branch (maybe years old). E.g. for comparison or for merging etc.

Being able to fold/unfold (collapse/expand) branch heads would be a great - maybe with summary info (e.g. number of commits, date range, etc - which could be a hover tip or not?)

Also another way of visualising it is to support split screens. So I can see recent branches/commits in a left pane, and older branches/commits in another pane.

BrendanSimon avatar May 17 '21 00:05 BrendanSimon

Depending on where you want Git Graph to go UI-wise, this may justify a separate view. TortoiseGit, for example, uses a graph-like view for visualizing and navigating numerous branches.

Revision Graph

altxt avatar Oct 16 '21 10:10 altxt

If it were possible to specify additional arguments to the git log process, then you would be able to achieve something like this by adding --simplify-by-decoration. It's not quite this feature, as by default it wouldn't tell you the number of collapsed commits, but it would get you a quick overview of your branch (and tag) structure.

t-gehring avatar Nov 25 '21 14:11 t-gehring

does it work? example

xwyam avatar Jun 23 '22 05:06 xwyam

does it work? example

no,but it is usefull

heartacker avatar Jun 23 '22 09:06 heartacker

does it work? example example

I'd use it. It's a good compromise until a more fleshed out solution is implemented. One issue with this is that hiding a branching commit (i.e. one with multiple children) makes it appear like branching happened on an earlier commit. This can be seen in the animation: when expanded, the top-most branching occurs at commit "Rebase 1.30.0 ..."; but when collapsed, the branching appears to happen at commit "#491 Standalone...".

TomasJuocepis avatar Aug 25 '22 18:08 TomasJuocepis