0

I am on branch say featureBranch which is created from master. While doing-

git log --author="ankit"

I get all my commit ids and change Id done on this featureBranch. How to get the gerrit review id or gerrit review link which is pushed to gerrit for that commit or a particular commit considering I have the commit id and change id?

A. Gupta
  • 77
  • 2
  • 9

3 Answers3

0

The git commit message should contain 'Change-Id' field. This is the gerrit change id, so you can look at this change in gerrit

ElyashivLavi
  • 1,681
  • 3
  • 22
  • 33
  • Change id and review id are different. Review Id is contained in the gerrit review link. What I want is to open a gerrit review link(or to know the gerrit review id) from for a particular change Id. – A. Gupta Jan 19 '18 at 07:33
  • For that you can use `git review` tool. `git review -d ` will download the correct version locally. You can also take a look on that: https://stackoverflow.com/questions/28370567/how-to-git-pull-a-given-patch-set-from-gerrit – ElyashivLavi Jan 19 '18 at 09:16
0

If you have the Change-Id (a number like this: I64f1c892c13a9bad903955678f104c34f36d1079) you can get the Change number (a number like this: 32151) executing the command like in the following example:

$ curl -s --request GET --netrc $REST_URL/changes/I64f1c892c13a9bad903955678f104c34f36d1079 | sed 1d | jq --raw-output "._number"
$ 32151

The Change link, in this example, would be:

https://GERRIT-SERVER/#/c/32151

But you can get the change page easily searching for the Change-Id (the I64f1c892c13a9bad903955678f104c34f36d1079 number) using the search field of the Gerrit UI.

0

The command -

git log --author="ankit"

Will give list of all the commit ids and change ids for the mentioned author. On searching the change id in the gerrit search tab available on the gerrit dashboard one can easily find the review corresponding to the change id. enter image description here

A. Gupta
  • 77
  • 2
  • 9