あなたは、単一のGET /repos/:owner/:repo/commits/:sha
を使用してコミット取得することができ、その後、あなたはjq
を使用して、それを処理することができ、例えばこれは、フラットリストとして修正したファイルを印刷します:
curl -s https://api.github.com/ENDPOINT | jq -r '.files | .[] | select(.status == "modified") | .filename'
重要な注意点は、しかしあります:このフィルタは、コミットの内容全体を含むGETクエリの結果です。これは大量のデータである可能性があります。それがあなたにとって懸念であるかどうかはわかりません。不要な帯域幅を使わないように、返されたフィールドをフィルタリングする方法を探しましたが、APIで見つけることができませんでした。
あなたがそれに興味を持っている場合は、このように、JSON形式で、詳細を得ることができる:
curl -s https://api.github.com/ENDPOINT | jq '[.files | .[] | select(.status == "modified")]'
をこれは、このような出力を生成します:
[
{
"sha": "564324525eb706f7cc2756ceef8b82cdfeaf270c",
"filename": "README.md",
"status": "modified",
"additions": 1,
"deletions": 0,
"changes": 1,
"blob_url": "https://github.com/janosgyerik/test1/blob/41885b6c8183de3ab5be02884fdcc37d920e41b9/README.md",
"raw_url": "https://github.com/janosgyerik/test1/raw/41885b6c8183de3ab5be02884fdcc37d920e41b9/README.md",
"contents_url": "https://api.github.com/repos/janosgyerik/test1/contents/README.md?ref=41885b6c8183de3ab5be02884fdcc37d920e41b9",
"patch": "@@ -1,3 +1,4 @@\n test1\n =====\n nothing special\n+Sat May 13 00:16:02 CEST 2017"
},
{
"sha": "37a26e04e6bdc55935e00f2a092d936240771aca",
"filename": "index.html",
"status": "modified",
"additions": 1,
"deletions": 0,
"changes": 1,
"blob_url": "https://github.com/janosgyerik/test1/blob/41885b6c8183de3ab5be02884fdcc37d920e41b9/index.html",
"raw_url": "https://github.com/janosgyerik/test1/raw/41885b6c8183de3ab5be02884fdcc37d920e41b9/index.html",
"contents_url": "https://api.github.com/repos/janosgyerik/test1/contents/index.html?ref=41885b6c8183de3ab5be02884fdcc37d920e41b9",
"patch": "@@ -55,3 +55,4 @@\n </div>\n </body>\n </html>\n+"
}
]
を多くのおかげで、チェックアウトします私の場合は帯域幅にどのような影響を与えますか? – Nitin