Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » How to retrieve notes using notes for a particular commit
How to retrieve notes using notes for a particular commit [message #1772420] Fri, 08 September 2017 23:26 Go to next message
Sharath Pala Shivaraja Gupta is currently offline Sharath Pala Shivaraja GuptaFriend
Messages: 1
Registered: September 2017
Junior Member
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);
}
Re: How to retrieve notes using notes for a particular commit [message #1774530 is a reply to message #1772420] Mon, 16 October 2017 20:07 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1032
Registered: July 2009
Senior Member
See ShowNoteCommand and its usage in NotesCommandTest
Previous Topic:JGIT how to delete remote tag and branch ? thanks
Next Topic:Update on project creation status
Goto Forum:
  


Current Time: Mon Sep 24 15:00:30 GMT 2018

Powered by FUDForum. Page generated in 0.01990 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top