I want to use java connect Gerrit REST API, so i find the opensource gerrit-rest-java-client. But i don't know how to query the changes commitMessage.
My simple code is as follows
GerritRestApiFactory gerritRestApiFactory = new GerritRestApiFactory();
GerritAuthData.Basic authData = new GerritAuthData.Basic("Gerrit", "User", "password");
GerritApi gerritApi = gerritRestApiFactory.create(authData);
List<ChangeInfo> changes = gerritApi.changes().query("status:merged").withLimit(1).get();
for (ChangeInfo cc : changes) {
System.out.println("subject:" + cc.subject);
System.out.println("changeId:" + cc.changeId);
System.out.println("commitMessage:");
}
ChangeApi ccapi = gerritApi.changes() .id("PROJECTBASE~BCX10A51~I031e50eb06c10638b914abb7a5d431e49b19abb8"); RevisionApi rr = ccapi.revision("031e50eb06c10638b914abb7a5d431e49b19abb8");