extrawurst / gitui

Blazing 💥 fast terminal-ui for git written in rust 🦀
MIT License
18.37k stars 564 forks source link

Show the branching structure in the log. #81

Open jugglerchris opened 4 years ago

jugglerchris commented 4 years ago

Is your feature request related to a problem? Please describe. It can be useful seeing the branching/merging structure in the log view, in a similar way to git log --oneline --decorate --graph

Describe the solution you'd like The graph view visible in the log window.

Describe alternatives you've considered I haven't got any other alternatives other than not doing it. :-)

extrawurst commented 4 years ago

Definitely on my list aswell 👍

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

bew commented 3 years ago

nop little bot, don't close that please! :smiley:

extrawurst commented 3 years ago

@bew volunteering to take a go at it? :)

bew commented 3 years ago

That would have been a good idea, thanks for the offer, but not right now anyhow. I'm in the long process of re doing all my configs properly, and I still far from having a proper rust editor setup (I'd also need to learn writing rust, not just read, this project could help bootstrap the process for sure, but I'm not ready for now)

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

kiuKisas commented 3 years ago

up ?

kting28 commented 3 years ago

Still a planned feature? With this it will be perfect!

extrawurst commented 3 years ago

A few ideas how this could be visualized: https://stackoverflow.com/questions/1057564/pretty-git-branch-graphs

MaiLunJiye commented 3 years ago

suggestion: I hope we can merge, checkout and reset in the graph view like the vscode extension name git graph(https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph).

joseffilzmaier commented 2 years ago

It would already be nice to just show the remote branches and local branches in the log viewer

extrawurst commented 2 years ago

@joseffilzmaier not sure what you mean. There is little chance to have multiple references be on the same branch (we only show a single branch currently)

P4Cu commented 2 years ago

If gitui would ever draw more branches here's how libgit2 authors imagine it: https://github.com/libgit2/libgit2/blob/main/examples/log.c Though they've not added the part that's related to --graph but it can be deduced out of parents.

extrawurst commented 2 years ago

I put a bunch thought into this already. The biggest issue is keeping the revlog tab as efficient as it is right now.

I don’t want to start building a graph in memory to traverse. It’s a matter of finding an efficient way to store everything needed to draw the graph structure and jump around everywhere.

another factor is being able to draw iteratively while not everything is parsed yet (like now)

the example in libgit2 unfortunately is too simple to cover any of these questions.

P4Cu commented 2 years ago

Yeah, definitely! Compromising speed is not an option. Git internally uses commit-graph (from 2.24) to avoid reading whole blobs I can't tell if libgit2 has this feature already but that could be a starting point.

tony commented 2 years ago

Git internally uses commit-graph (from 2.24) to avoid reading whole blobs I can't tell if libgit2 has this feature already but that could be a starting point.

@extrawurst Would this be solve the problem, if it existed in the rust binding for libgit2?

I can't tell if libgit2 has this feature already but that could be a starting point.

As of today:

libgit2:

git2: nothing yet

hgezim commented 2 years ago

I think gitup does visualizations the best by far:

CleanShot 2022-09-14 at 12 55 36@2x
timabell commented 2 years ago

For the record I think tig does a decent job of graph rendering in a terminal and wouldn't be a bad thing to copy. shutter_2022-09-27_04

extrawurst commented 2 years ago

For sure, open for PRs 😉

huyhoang160593 commented 1 year ago

how about this repo here which also visualize Git history graphs. Maybe worth checking out @extrawurst. And this is also written in Rust, too

williamdes commented 1 year ago

how about this repo here which also visualize Git history graphs. Maybe worth checking out @extrawurst. And this is also written in Rust, too

It's really not bad, but still get the frustration of not having a readable tree. GitKraken and SmartGit manage to make it just right. git-graph does not have alternating colors for branches and that makes it hard to know the base of the branch and it's target for a merge

Here is what I would expect to have in gitui: image Some way to have my branches, different remotes (contributors or team members), tags. The colors alternating are very important.

Ergus commented 1 year ago

Hi guys:

This issue seems to me the only killer feature missing in gitui at the moment. If you allow me to suggest something, I would prefer to draw the tree with simple unicode or ascii characters (like magit or tig already do) and then you can choose a fancy draw library if you like... but but once the basic is in... remember that some of us use old fashion terminals and very basic embedded systems (with ssh, serial or even worst... cmd from MS-Windows).

extrawurst commented 1 year ago

The issue certainly is not how to make it look good atm. It’s just complex to get right on giant repos where not the entire list of commits is kept in memory let alone their ancestor relation info. The drawing then becomes the simple part

soloturn commented 1 year ago

is this git log --graph not properly giving output to digest or the library is not properly supporting it?

extrawurst commented 1 year ago

gitui does not shell out fetching the revision log to be as performant as possible.

petertheprocess commented 4 months ago

Hi, is there any progress on this feature?

Johnmcenroyy commented 2 weeks ago

There is also new interesting project Serie also written in Rust. It is in official repo of Arch Linux.

GalaxySnail commented 2 weeks ago

There is also new interesting project Serie also written in Rust. It is in official repo of Arch Linux.

That's amazing! But it requires iterm2/kitty image protocols, and even sixel is not supported. It would be great if such a TUI could be implemented without image protocols.

williamdes commented 2 weeks ago

There is also new interesting project Serie also written in Rust. It is in official repo of Arch Linux.

That's amazing! But it requires iterm2/kitty image protocols, and even sixel is not supported. It would be great if such a TUI could be implemented without image protocols.

It works fine with terminals like gnome desktop but not Guake for example. Please open an issue on their repo to support other protocols.

cgahr commented 2 weeks ago

Also, judging by https://github.com/lusingander/serie/issues/16, it just uses the git shell command under the hood, hence, it is of no use

balintbarna commented 1 week ago

+1 for the VSCode extension "Git Graph" visualization, that is excellent.