Oddly enough, Gerrit doesn’t report the Git commit id of its Change Sets.
The only way I found to get that piece of information is to use its SSH interface, using the
The syntax is this:
ssh -p 29418 user@gerritHost gerrit query --current-patch-set <ChangeId>
29418 with the port you normally use to contact Gerrit via SSH.
That will display a number of properties about the Change Set, including the
revision parameter which is the extended version of the Git commit id.
You can use the
--format JSON option if you want to get a JSON representation of the same data, or you can get the short commit id using for example:
ssh -p 29418 user@gerritHost gerrit query --current-patch-set <ChangeId> \ cut -d':' -f2 | cut -c2-7