Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User and repository statistics #551

Open
Cysioland opened this issue Oct 11, 2014 · 13 comments · May be fixed by #7728
Open

User and repository statistics #551

Cysioland opened this issue Oct 11, 2014 · 13 comments · May be fixed by #7728
Labels
🎯 feature Categorizes as related to a new feature priority: low Open source project is supported at the best effort

Comments

@Cysioland
Copy link

Like on GitHub.
In repository: ex. top commiters
In user: ex. commits by day, daily average of commits, streak

@unknwon unknwon added 🎯 feature Categorizes as related to a new feature priority: maybe You know what, it sounds good labels Oct 11, 2014
@unknwon
Copy link
Member

unknwon commented Oct 11, 2014

Thanks your feedback, these are planned around 0.8

@carbontwelve
Copy link
Contributor

Is this still planned for 0.8 or is it getting pushed to a later version?

@unknwon
Copy link
Member

unknwon commented Feb 25, 2016

Apparently pushed to later version, sorry!

@carbontwelve
Copy link
Contributor

One of these days I might get round to properly learning go and giving a hand.

@unknwon
Copy link
Member

unknwon commented Feb 26, 2016

Good for you!

But you might want to choose a easier one...

@bkcsoft
Copy link
Contributor

bkcsoft commented May 26, 2016

I've had a look at this and it seems almost terribly simple to implement (with regards to go-git-module). Performance-wise (at least for git-commands) I don't see any reason to cache it either to be honest...

(all time-related things are ran on the gogs-repo, on a Core i5-3317U @ 1.70GHz )

Top Commtters

$ time git log --format=format:%an | sort | uniq -c | sort -r -n | head -5
   1468 Unknwon
    573 Unknown
    385 无闻
    197 Lunny Xiao
    146 FuXiaoHei
[...]
real    0m0.115s
user    0m0.060s
sys 0m0.017s

which is easy to parse:

var (
  num int
  commiter string
)
fmt.Sscanf(command.StdOut, "[ ]+%d %s", &num, &commiter)
$ time git log --format=format:%an | sort | uniq -c | sort -r -n | head -20
[...]

Though for Gogs we'd need to do sort|uniq|sort|head in Golang, no clue about the performance-hit there)

Commit counting per User (per day, daily average, and streaks)

$ time git --no-pager log --author="Unknwon" --format=%aI 
2016-05-12T14:32:28-04:00
2016-05-12T14:31:06-04:00
2016-05-11T12:19:26-04:00
2016-05-11T12:17:52-04:00
[...]
real    0m0.075s
user    0m0.070s
sys 0m0.000s

That format is ISO8601, so it's easy to parse with

commitTime := time.Parse(input, time.RFC3339)

(RFC3339 is a profile of ISO8601, git uses RFC3339 but say ISO8601...)
Sorting time.Time is relatively simple as well

Like with the previous command, we still need to parse and sort in Golang, no clue how that will impact performance, but git sure isn't the bottleneck 😆

@unknwon unknwon added priority: low Open source project is supported at the best effort and removed priority: maybe You know what, it sounds good labels May 30, 2016
@stevenleeg
Copy link

Hm, looks like developer support for this feature is low but I'd like to add my support for getting this in as well!

@Stuey2
Copy link

Stuey2 commented Oct 31, 2017

First off, thanks Unknwon, great project!

The problem with low priority items... they never get to the top of the list.

Like a blown light bulb in a shopping centre, it's only one, and there are always bigger issues, broken doors, heating systems, etc. it never gets replaced.

Sometime, this will just have to get shunted to the top of the list if it's ever going to get done.

Got to say there are higher priority items that I'd like from gogs too, but would suggest a firm milestone being set, so this one gets done.

@tgoncuoglu
Copy link

I'd like to bump this thread too, just as a reminder that it would be very useful to some of us. I understand there are higher priority items on to-do list, but... It has been 4 years since this request and I bet a whole bunch of high-priority items have come and gone since then, without this ever being touched. Seeing as bkcsoft demonstrated above how easy it is to implement, I would like to remind that this is here.

@shaileshsharan98
Copy link

+1

2 similar comments
@mmmeeedddsss
Copy link

+1

@JustForFunDeveloper
Copy link

+1

@pikomonde pikomonde linked a pull request Apr 15, 2024 that will close this issue
3 tasks
@pikomonde
Copy link

pikomonde commented Apr 15, 2024

I'm creating a PR, the changes are creating 3 pages:

  • Contributors Page
  • Commits Page
  • Code Frequency Page

Here are the comparisons on GIthub vs Gogs:

Contributors Page

image
image
image

There are many things that can be improved in this page:

  1. Cache, I think this page can be cached to make it faster
  2. I don't know how to make the list of user having 2 columns instead of 1 (I'm bad with CSS)
  3. Can select range by dragging on the main chart (https://stackoverflow.com/questions/42855738/how-do-i-selecting-a-date-range-like-onclick-but-drag-select)
  4. The header formatting on list of user contribution, especially for 21 commits 38 ++ 10 --
  5. Not sure how to implement comma on 1000's, for example 4000 commits, in GIthub it will be written 4,000 commits, not sure the implementation for different language formatting (should pass string or integer in the template)

Commits Page

image
image

Code Frequency Page

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎯 feature Categorizes as related to a new feature priority: low Open source project is supported at the best effort
Projects
None yet
Development

Successfully merging a pull request may close this issue.

12 participants