Bug 334765 - Add NotesCommand to JGit API
Summary: Add NotesCommand to JGit API
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 0.11   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 0.12-M2   Edit
Assignee: Chris Aniszczyk CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on: 305354
Blocks:
  Show dependency tree
 
Reported: 2011-01-19 06:36 EST by Chris Aniszczyk CLA
Modified: 2011-04-11 12:34 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Aniszczyk CLA 2011-01-19 06:36:40 EST

    
Comment 1 Chris Aniszczyk CLA 2011-02-02 13:42:40 EST
Sasa, if I wanted to create a NotesCommand that shows and adds notes to any id, how would I do that? Who should maintain the NoteMap? Is it meant to be repository wide or kind of a reuse and recycle type of object?
Comment 2 Sasa Zivkov CLA 2011-02-14 08:40:05 EST
(In reply to comment #1)
> Sasa, if I wanted to create a NotesCommand that shows and adds notes to any id,
> how would I do that? Who should maintain the NoteMap? Is it meant to be
> repository wide or kind of a reuse and recycle type of object?

It is a reuse and recycle type of object. Here an usage example:
Repository db = <instance of org.eclipse.jgit.lib.Repository>
Ref notesBranch = db.getRef("refs/notes/commits");
if (notesBranch != null) {
  RevCommit commit = revWalk.parseCommit(notesBranch.getObjectId());
  NoteMap map = NoteMap.read(revWalk.getObjectReader(), commit);
  // now you have an instance of NoteMap and can use it as usual, for example:
  map.getNote(<some commit ID>);
}
Comment 3 Chris Aniszczyk CLA 2011-03-30 10:48:15 EDT
For review...

http://egit.eclipse.org/r/#change,2970
Comment 4 Chris Aniszczyk CLA 2011-04-11 12:34:31 EDT
Merged as e109529d6f7f9c69e6fe7e864b90cdcafe998cf0.