gpt4 book ai didi

github-api - Github API 调用 : filter by committer-date

转载 作者:行者123 更新时间:2023-12-03 09:45:05 24 4
gpt4 key购买 nike

我正在使用 github api,试图找到我在特定日期的所有提交。

正如预期的那样,此查询返回我的所有提交:

https://api.github.com/search/commits?q=committer-email:foo@bar.com



但此查询返回相同的列表,包括指定日期范围之外的结果:

https://api.github.com/search/commits?q=committer-email:foo@bar.com&committer-date=2017-08-13..2017-08-14



(这些查询需要设置一个标题:接受:application/vnd.github.cloak-preview)

为什么 committer-date 参数不能像预期的那样工作?

以下是提交搜索的文档: https://developer.github.com/v3/search/#search-commits

最佳答案

查询中有一个小的语法错误。尝试更改 &+=: .进行这些更改您的查询将变成 -
curl -H 'Accept: application/vnd.github.cloak-preview' \https://api.github.com/search/commits?q=committer-email:foo@bar.com+committer-date:2017-08-13..2017-08-14 .

当我在我的终端上运行它时,我只得到一个提交(参见下面的截断结果)。

Medapas-MacBook-Air:~ medapa$ curl -H 'Accept: application/vnd.github.cloak-preview' \https://api.github.com/search/commits?q=committer-email:foo@bar.com+committer-date:2017-08-13..2017-08-14
{
"total_count": 1,
"incomplete_results": false,
"items": [
{
"url": "https://api.github.com/repos/mstricklin/batis00/commits/af9295b930223e394f7f0d742af351ea3ef02351",
"sha": "af9295b930223e394f7f0d742af351ea3ef02351",
"html_url": "https://github.com/mstricklin/batis00/commit/af9295b930223e394f7f0d742af351ea3ef02351",
"comments_url": "https://api.github.com/repos/mstricklin/batis00/commits/af9295b930223e394f7f0d742af351ea3ef02351/comments",
"commit": {
"url": "https://api.github.com/repos/mstricklin/batis00/git/commits/af9295b930223e394f7f0d742af351ea3ef02351",
"author": {
"date": "2017-08-13T20:10:55.000-05:00",
"name": "mstricklin",
"email": "foo@bar.com"
},
"committer": {
"date": "2017-08-13T20:10:55.000-05:00",
"name": "mstricklin",
"email": "foo@bar.com"
},
"message": "01",
"tree": {
"url": "https://api.github.com/repos/mstricklin/batis00/git/trees/e0fe96439a79eb6d84996f351025488bb0e7114d",
"sha": "e0fe96439a79eb6d84996f351025488bb0e7114d"
},
"comment_count": 0
},
"author": {
"login": "invalid-email-address",

关于github-api - Github API 调用 : filter by committer-date,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45990626/

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