GitHub的V3 API可以让你列出一个拉请求评论通过
curl 'https://api.github.com/repos/danvk/dygraphs/pulls/296/comments'
响应看起来像这样:
[
{
"id": 11908831,
"diff_hunk": "@@ -1521,16 +1576,6 @@ Dygraph.prototype.doZoomX_ = function(lowX, highX) {\n };\n \n /**\n- * Transition function to use in animations. Returns values between 0.0\n- * (totally old values) and 1.0 (totally new values) for each frame.\n- * @private\n- */\n-Dygraph.zoomAnimationFunction = function(frame, numFrames) {",
"path": "dygraph.js",
"position": 140,
"original_position": 140,
"commit_id": "bacf5ce283d6871ce1c090f29bf5411341622248",
"original_commit_id": "335011fd4473f55aaaceb69726d15e0063373149",
"user": { ... }
"body": "I'm not sure why this is showing up in the diff -- did you move it?",
}
]
(你可以看到在github此评论在这里。)
我的问题是:“位置”和“原始位置”字段中的140到底是什么意思?
我想将其转换为特定提交上的行号/从行号中翻译出来。该API文档表明,这是一个统一的DIFF线数,但我不能告诉它的索引成统一的差异。“ dygraph.js”与335011f..bacf5ce相同,即original_commit_id..commit_id。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句