2017-08-31 3 views
3

github apiを使用して、特定の日にコミットをすべて見つけようとしています。Github APIコール:コミッタ日付によるフィルタ

このクエリは、予想通り、私のすべてのコミットを返します。

https://api.github.com/search/commits?q=committer-email:[email protected]

をしかし、このクエリは、指定した日付範囲外の結果を含め、その同じリストを返します。

https://api.github.com/search/commits?q=committer-email:[email protected]&committer-date=2017-08-13..2017-08-14

(これらのクエリでは、ヘッダを設定する必要があります:Accept/application/vnd.github.cloak-preview)

コミッタ日付パラメータは、想定どおりに機能しません。ここで

は、コミット、検索のためのドキュメントです:https://developer.github.com/v3/search/#search-commits

答えて

2

クエリの小さな構文エラーがあります。 &+=:に変更してみてください。これらの変更をクエリに行うと、

curl -H 'Accept: application/vnd.github.cloak-preview' \https://api.github.com/search/commits?q=committer-email:[email protected]+committer-date:2017-08-13..2017-08-14になります。

端末でこれを実行すると、コミットが1つだけ発生します(下の切り捨てられた結果を参照)。

まだ私の日付の束を返します
Medapas-MacBook-Air:~ medapa$ curl -H 'Accept: application/vnd.github.cloak-preview' \https://api.github.com/search/commits?q=committer-email:[email protected]+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": "[email protected]" 
     }, 
     "committer": { 
      "date": "2017-08-13T20:10:55.000-05:00", 
      "name": "mstricklin", 
      "email": "[email protected]" 
     }, 
     "message": "01", 
     "tree": { 
      "url": "https://api.github.com/repos/mstricklin/batis00/git/trees/e0fe96439a79eb6d84996f351025488bb0e7114d", 
      "sha": "e0fe96439a79eb6d84996f351025488bb0e7114d" 
     }, 
     "comment_count": 0 
     }, 
     "author": { 
     "login": "invalid-email-address", 
+0

:( –

+0

非常に奇妙だ。私は私が得る検索結果を含めるように私の応答を編集した。十分な – Poonacha

+1

は確かに、それは私のために動作します。私はそれを入力しておく必要があります間違っています。 –

関連する問題