mhutchie / vscode-git-graph

View a Git Graph of your repository in Visual Studio Code, and easily perform Git actions from the graph.
https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph
Other
1.97k stars 253 forks source link

Collapsible Graph #387

Open TomasJuocepis opened 3 years ago

TomasJuocepis commented 3 years ago

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:

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

mhutchie commented 3 years ago

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.

hedgehog-zizi commented 3 years ago

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.

BrendanSimon commented 3 years ago

+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.

altxt commented 2 years ago

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

t-gehring commented 2 years ago

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.

xwyam commented 2 years ago

does it work? example

heartacker commented 2 years ago

does it work? example

no,but it is usefull

TomasJuocepis commented 2 years ago

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...".

alexisfrjp commented 1 month ago

That's exactly what I need, wireshark's repo has way too many commits between branches.

How did you get that option? I don't see it in my up-to-date vscode.

image