在我们的Gerrit存储库中,有人删除了一个分支。有没有办法查看删除该分支的人员。本地reflog不显示详细信息。
嗨,VonC,从这个链接https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#get-reflog
我试图通过REST-API
找到人的详细信息。
curl -v -k -H "Authorization: user:<http-password>" -X GET https://gerrit-server/gerrit/projects/core/test-repo/branches/dev/reflog HTTP/1.0
但是它显示了下面的错误。
< HTTP/1.1 404 Not Found
< Server: nginx
< Date: Mon, 30 Mar 2020 07:59:55 GMT
< Content-Type: text/plain;charset=utf-8
< Content-Length: 19
< Connection: keep-alive
< Content-Disposition: attachment
< X-Content-Type-Options: nosniff
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Pragma: no-cache
< Expires: Mon, 01 Jan 1990 00:00:00 GMT
<
Not found: core
* Connection #0 to host gerrit-server left intact
Note: Unnecessary use of -X or --request, GET is already inferred.
* Could not resolve host: HTTP
* Closing connection 1
curl: (6) Could not resolve host: HTTP
发布于 2020-03-27 05:18:23
我mentioned before说Git本身不能提供足够的审计来找出是谁推了一个分支删除。
Gerrit本身提供了有限的审计功能(如Gerrit 2.12 and its Group audit log),或者,正如OP所提到的,提供了reflog。
(可能访问Gerrit服务器侦听器(SSH或HTTPS服务器)的日志,您可能会将可能的删除日期与一些网络访问日志进行协调,但这似乎是可行的。)
操作会尝试:
GET https://gerrit-server/gerrit/projects/core/test-repo/branches/dev/reflog
但它返回404,并且使用该API调用必须遵守:
GET /projects/{project-name}/branches/{branch-id}/reflog
It turned out这是一个网址问题:
curl --user user:<http-password> https://gerrit-server/gerrit/a/projects/core%2Ftest-repo/branches/dev/reflog
请注意gerrit-server/gerrit/a/projects/...
中的'/a/
‘:在OP的情况下,它似乎是强制的。
https://stackoverflow.com/questions/60880109
复制相似问题