gitfetch icon indicating copy to clipboard operation
gitfetch copied to clipboard

feat: repo depended stats

Open Matars opened this issue 1 year ago • 35 comments

if you run gitfetch in a folder with a .git it would be nice if ti could fetch dat and stats for the specific repo.

The graph can also be modified to be something in the format below - so instead of seeing the contribution graph you want want to view your GitHub timeline tree.

(horizontally not vertically as in the image)

Matars avatar Oct 21 '25 12:10 Matars

Horizontal would be weird because the labels would need to be flipped vertically and thats hard to read, or without labels?

Zeviraty avatar Oct 21 '25 13:10 Zeviraty

if you dont want labels you can use this command: git --no-pager log --graph --all --pretty=format:"" and then flip the output somehow

Zeviraty avatar Oct 21 '25 14:10 Zeviraty

@Zeviraty it would be nice if we could toggle vertically or horizontally depending on terminal size

Matars avatar Oct 21 '25 16:10 Matars

that could work, i am working on a pr right now

Zeviraty avatar Oct 21 '25 16:10 Zeviraty

horizontal works now

Zeviraty avatar Oct 21 '25 16:10 Zeviraty

@Zeviraty Should not also add toggles to use some of the git graphs that are shown in this repo?

https://github.com/mlange-42/git-graph

Matars avatar Oct 21 '25 16:10 Matars

Those all require custom applications, the last 2 are gui the git log is what we use and the git-graph is a git extension (hard to check if installed)

Zeviraty avatar Oct 21 '25 16:10 Zeviraty

only git-graph could be possible to implement

Zeviraty avatar Oct 21 '25 16:10 Zeviraty

@Zeviraty ok then we can just work with the raw data and format it ourselves, we can probably make it look even better than theirs :p

Matars avatar Oct 21 '25 16:10 Matars

@Matars Hope we can XD

Zeviraty avatar Oct 21 '25 16:10 Zeviraty

but for now the current implementation does work

Zeviraty avatar Oct 21 '25 16:10 Zeviraty

it would be cool also to view custom contribution graph with that fetches data directly from .git (or gh if its possible)

this way you could see contribution graph for one specific repo, and if the repo Is private you would still be able to view the contribution graph and it would nt be hidden

Matars avatar Oct 21 '25 23:10 Matars

@Matars the way i fetch the graph now is with git (not gh cli), and local git repositories can (ofcourse) never be private

Zeviraty avatar Oct 22 '25 06:10 Zeviraty

@Matars the way you implemented the timeline graph into the actual display? did you test it. Because im getting all sorts of weird results and its not implemented into the complete display?

like the graph can overflow everywhere (should be clipped) it displays vertical on top of everything?

working on a pr to fix it all rn

Zeviraty avatar Oct 22 '25 07:10 Zeviraty

i now have it displaying on the left side, only i dont know how you want to handle how big the timeline should be?

Image

because if i go to a repo with more commits: Image it completely overflows, i know how to fix this i only want to know how i should calculate how big it should be? max size that fits in the terminal, 50% 25% etc etc... @Matars

Zeviraty avatar Oct 22 '25 09:10 Zeviraty

@Matars Finally done: #40

Zeviraty avatar Oct 22 '25 10:10 Zeviraty

@Zeviraty I just got back looking at the repo Thanks for looking at this

Is it fetching all commits or only looking back X amount based on window length?

Matars avatar Oct 22 '25 11:10 Matars

i now have it displaying on the left side, only i dont know how you want to handle how big the timeline should be? Image

because if i go to a repo with more commits: Image it completely overflows, i know how to fix this i only want to know how i should calculate how big it should be? max size that fits in the terminal, 50% 25% etc etc... @Matars

Look nice!

Matars avatar Oct 22 '25 11:10 Matars

it just gets the graph by using git log --graph then reverse truncates it to fit

Zeviraty avatar Oct 22 '25 11:10 Zeviraty

Could someone test if this works?

Zeviraty avatar Oct 22 '25 12:10 Zeviraty