我正在使用 github api,试图找到我在特定日期的所有提交。
正如预期的那样,此查询返回我的所有提交:
https://api.github.com/search/commits?q=committer-email:foo@bar.com
但此查询返回相同的列表,包括指定日期范围之外的结果:
(这些查询需要设置一个标题:接受: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",
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1277 次 |
| 最近记录: |