gitui icon indicating copy to clipboard operation
gitui copied to clipboard

Show the branching structure in the log.

Open jugglerchris opened this issue 4 years ago • 26 comments

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. :-)

jugglerchris avatar May 20 '20 20:05 jugglerchris

Definitely on my list aswell 👍

extrawurst avatar May 21 '20 08:05 extrawurst

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.

stale[bot] avatar Oct 27 '20 20:10 stale[bot]

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

bew avatar Oct 27 '20 21:10 bew

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

extrawurst avatar Oct 27 '20 21:10 extrawurst

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)

bew avatar Oct 28 '20 00:10 bew

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.

stale[bot] avatar Jan 26 '21 02:01 stale[bot]

up ?

kiuKisas avatar Mar 23 '21 13:03 kiuKisas

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

kting28 avatar Apr 22 '21 23:04 kting28

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

extrawurst avatar May 24 '21 00:05 extrawurst

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

MaiLunJiye avatar Sep 07 '21 01:09 MaiLunJiye

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

joseffilzmaier avatar Dec 30 '21 01:12 joseffilzmaier

@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)

extrawurst avatar Dec 30 '21 07:12 extrawurst

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.

P4Cu avatar Jan 30 '22 10:01 P4Cu

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.

extrawurst avatar Jan 30 '22 11:01 extrawurst

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.

P4Cu avatar Jan 30 '22 12:01 P4Cu

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

tony avatar Feb 09 '22 14:02 tony

I think gitup does visualizations the best by far:

CleanShot 2022-09-14 at 12 55 36@2x

hgezim avatar Sep 14 '22 18:09 hgezim

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

timabell avatar Sep 27 '22 22:09 timabell

For sure, open for PRs 😉

extrawurst avatar Sep 27 '22 22:09 extrawurst

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

huyhoang160593 avatar Oct 18 '22 10:10 huyhoang160593

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.

williamdes avatar Oct 27 '22 21:10 williamdes

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

Ergus avatar Feb 04 '23 12:02 Ergus

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

extrawurst avatar Feb 04 '23 12:02 extrawurst

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

soloturn avatar Feb 19 '23 11:02 soloturn

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

extrawurst avatar Feb 19 '23 11:02 extrawurst