How to retrieve notes using notes for a particular commit [message #1772420] |
Fri, 08 September 2017 19:26  |
Eclipse User |
|
|
|
Is there a way I can query notes information in a repository for a given commit id? If so, how do I do it?
Currently I am iterating through the list as below which I feel is very expensive:
try {
Repository repository = repositoryManager.openRepository(Project.NameKey.parse("testa"));
try (Git git = new Git(repository)) {
List<Note> call = git.notesList().call();
log.info("Listing " + call.size() + " notes");
for (Note note : call) {
log.info("Note: " + note + " " + note.getName() + " " + note.getData().getName() + "\nContent: ");
ObjectLoader loader = repository.open(note.getData());
byte[] data = loader.getBytes();
log.info(new String(data, "utf-8"));
}
}
} catch (Exception e) {
log.info("Couldn't open repository: {}", "testa", e);
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.05156 seconds