Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » How to get Note message
How to get Note message [message #841300] Wed, 11 April 2012 06:14 Go to next message
Hrvoje Varga is currently offline Hrvoje VargaFriend
Messages: 1
Registered: April 2012
Junior Member
I am using AddNoteCommand to, well, add a note to commit object. I see I can specify note reference using setNotesRef() and note message using setMessage(). This works correctly.

How can I read this message back from note? I can use ListNotesCommand to get the list of the notes with specific reference or ShowNoteCommand to get the note for specific commit. But I cannot read the message back from this note. Probably I am using it incorectlly.

I would be greatlly appreciate if someone can help with this. Thanks.
Re: How to get Note message [message #841692 is a reply to message #841300] Wed, 11 April 2012 16:24 Go to previous message
Kevin Sawicki is currently offline Kevin SawickiFriend
Messages: 47
Registered: September 2011
You can get the message back by parsing commits use the notes ref.

RevWalk walk = new RevWalk(repo);
Ref ref = repo.getRef(Constants.R_NOTES_COMMITS);
if (ref != null) {
  RevCommit notesCommit = walk.parseCommit(ref.getObjectId());
  String message = notesCommit.getFullMessage();
Previous Topic:Can't find the Stash commands
Next Topic:Wrong behaviour of EGit
Goto Forum:

Current Time: Wed Nov 25 12:40:50 GMT 2015

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

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