-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Topic
There are no simple tools available to display a simple graph of commits. It should be easy, right? There are nice tools for VS Code (git graph) and other GUI. But what is out there for terminal?
Your thoughts
There is a nice project called git-igitt built on Rust. You can see a nice git graph displayed there. But it is not as feature and keybinding rich neither as simple as this project. git-igitt displays the git graph with aid of the git-graph Rust crate created by the same user. What is git-graph? it is a program that you can run on the terminal and will print a nice graph of git commits. It has many flags to switch different options (see the screenshots on the project to see what is all about).
Can we integrate this nice looking graph tool into the local branches panel? Or add a keybinding to switch from the current view to the git-graph view? Or add a new window to play with graph views?
The git-graph project uses lib2git to retrieve a walker that you can iterate and it will walk through the commits of the repository. You can add some globs to the walker to skip or start from some patterns (I have not studied enough how it works, otherwise I would have already solved the problem myself, lol π ). That's an idea if we want to build it from scratch. Other option is to add this git-graph binary to the project and spawn the process with the right arguments to draw what you want to draw. Another option (I think it is the most lame of all π ) is to do what I tried to do on my git_explorer project: fetch the commits one by one and following their parent by using its ID (HASH code),
Why I want this feature?
Because commits on a git repository are nodes that are linked with each others. Why the existing tools are so lame to represent something that should be so simple to do? If you got a nice visual tool to show you dots and lines and carets you could see the git graph, go to a specific node and collapse and expand branches, by hitting enter on a commit that has 2 parents for example. This way you could see a git graph and just by hitting "enter" you would be collapsing complete branches until reaching the common ancestor that are adding noise to the graph (but this would be a future feature to add: collapse and expand branches on the git graph / node graph window).
This is related to another feature request I'd probably add on the issues page: a feature to fold/unfold branches. For example. If you've got many branches on your repository called:
bug/fix_typo_root_page
bug/fix_broken_web_site
bug/bla_bla_bla
The feature will fold these 3 branches into one:
bug/>
You can hit a special key to unfold the branches underneath your cursor (in this case, starting with bug) or to fold the branches that starts with the pattern of the branch underneath your cursor.
What do these features have in common? The possibility to collapse branches on the git graph and fold branches on the branches window: reduce the NOISE on the git repository. Too many branches that are not relevant to the work I'm currently doing. So there must be a way to hide what I am not interested in right now, instead of scrolling up and down on the git log.
I am willing to collaborate on this. Although you write Go and I write Rust, this is the best project I found on github up until now. The best "Code of conduct" π€£ and nice tips on how to use VS Code. With the debugger set up and working and with good logs you are ready to do everything in no matter what language. I am already working on some good first issues :D