gpt4 book ai didi

Github V3 API : list contributors

转载 作者:太空狗 更新时间:2023-10-29 13:00:22 24 4
gpt4 key购买 nike

我已经阅读了以下文档 ( https://developer.github.com/v3/repos/#list-contributors ) 列出了我工作过的存储库上的贡献者,我可以看到一个提交了多次的人没有出现,而我自己只有 3 个贡献,而我 push 了最多我们的 301 次提交。

我真的不明白这个端点返回了什么,但它看起来并不准确。该文档对此不是很详细,有人知道可以解释它的内容吗?

最佳答案

我将我的问题提交给了 Github API 的支持,他们为我提供了非常详细的答案。这是(缩写):

It looks like your missing commits were authored with an email address not linked to your GitHub profile. You can find the missing email by adding ".patch" to the end of a commit URL, then looking at the "From:" line. Once you have the email, you can link it to your profile by following these instructions:

https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user

After you link your email to your account, any valid missing contributions will be backfilled and new ones should show up automatically.

For example, when I check out the Projet-merou's commit history:

https://github.com/jxw1102/Projet-merou/commits/master

When I choose the latest commit with your GitHub username as its author and add .patch to the URL like so:

https://github.com/jxw1102/Projet-merou/commit/f5bf30243ab99efc40802d3d78c08e49839ec9c9.patch

I see this on the second line:

From: Dicee courtinot.david@orange.fr

Adding that email will backfill any missing valid contributions. After you do that, calling the API should show the expected result.

API Endpoints: Contributors and Contributors Statistics

I have written up some notes about each endpoint below. Let me know if you have any questions!

/repos/:owner/:repo/contributors

When you call GET /repos/:owner/:repo/contributors, the GitHub API will list contributors to the specified repository, sorted by the number of commits per contributor in descending order. Contributors data is cached for performance reasons. This endpoint may return information that is a few hours old. Git contributors are identified by author email address. This API attempts to group contribution counts by GitHub user, across all of their associated email addresses. For performance reasons, only the first 500 author email addresses in the repository will be linked to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information.

If you call this endpoint with anon=1 specified, the API will return a count of all commits on the default branch, including commits that aren't associated with any user on GitHub. Here's an example:

https://api.github.com/repos/jxw1102/Projet-merou/contributors?anon=1

When anon=1 isn't specified like this:

https://api.github.com/repos/jxw1102/Projet-merou/contributors

notice how the results only show commits associated with some GitHub user and doesn't count merge commits.

/repos/:owner/:repo/stats/contributors

When you call GET /repos/:owner/:repo/stats/contributors, the GitHub API will return the contributors list with additions, deletions, and commit counts. The total denotes the total number of commits authored by the contributor.

Does that help?

All the best,
Francis
@francisfuzz
GitHub Support

关于Github V3 API : list contributors,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36410357/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com