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

Support Co-authored Commits #70

Closed
yousinix opened this issue May 22, 2019 · 4 comments · Fixed by #80
Closed

Support Co-authored Commits #70

yousinix opened this issue May 22, 2019 · 4 comments · Fixed by #80

Comments

@yousinix
Copy link

yousinix commented May 22, 2019

  • Running 9) Git commits per author gives the following output:
Git commits per author:

204  Youssef Raafat    49.5%
189  Michael Safwat    45.9% 
 19  Micheline Medhat  4.6%

While the GitHub repo contains the following stats due to Co-authors.

image

  • If I ran git shortlog --grep='Co-authored-by: Youssef Raafat' -s -n the output will be 77 Michael Safwat.
  • Adding the 77 commit from shortlog to the 204 commits of the previous output gives us something near GitHub stats.

So is it possible to add option to count commits by authors & co-authors?

@Chandra158
Copy link
Contributor

It seems the current github stats doesn't include the co-authored commits and is same as what's printed by git-quick-stats ** (10. Git commits per author) **

Repo : https://github.com/MichaelSafwatHanna/FitnessApp

  • As output by git-quick-stats :
   205	Youssef Raafat    49.6%
   189	Michael Safwat    45.8%
    19	Micheline Medhat  4.6%
  • As shown by repo's contributor tab :
    Screen Shot 2019-10-06 at 2 54 50 PM

@YoussefRaafatNasry
I am not sure if it's the ideal behaviour or a bug in github itself.

@tomice
Copy link
Collaborator

tomice commented Oct 6, 2019

I am seeing the same thing @ProcrastinatorCp is seeing with regards to how GitHub is parsing the stats given the current information. That said, I think this feature in general is a good idea. It might be worth looking into supporting the Linux kernel commit message conventions by also supporting the following:

Acked-by
Co-Authored-By
Reported-by
Reviewed-by
Signed-off-by
Suggested-by
Tested-by

https://git.wiki.kernel.org/index.php/CommitMessageConventions

@yousinix
Copy link
Author

yousinix commented Oct 6, 2019

GitHub themselves deprecated this feature.

image

But I think it's the concern of this tool to analyze and get as much statistics as possible about git repositories. So, it would be a nice feature to know how many commits someone co-authored.

@Chandra158
Copy link
Contributor

Agree. Good to have this feature.
I will give it a go sometime in the next week.

Chandra158 added a commit to Chandra158/git-quick-stats that referenced this issue Oct 8, 2019
git-quick-stats#70

Commits by multiple authors were not counted in co-author's contribution.
Modified the commitsPerAuthor() function to include the commits which have "Co-authored-by:" in the commit message.
Chandra158 added a commit to Chandra158/git-quick-stats that referenced this issue Oct 8, 2019
git-quick-stats#70

Commits by multiple authors were only counted towards the main authors commits.
Modified the commitsPerAuthor function to include co-authors as well.
Chandra158 added a commit to Chandra158/git-quick-stats that referenced this issue Oct 12, 2019
git-quick-stats#70

Commits by multiple authors (co-authored-by) were only counted towards main author.
Modified commitsPerAuthor() to include co-author's commits.
arzzen added a commit that referenced this issue Oct 13, 2019
Support commits by co-authors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants