| Summary: | Add NotesCommand to JGit API | ||
|---|---|---|---|
| Product: | [Technology] JGit | Reporter: | Chris Aniszczyk <caniszczyk> |
| Component: | JGit | Assignee: | Chris Aniszczyk <caniszczyk> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | caniszczyk, matthias.sohn, sasa.zivkov |
| Version: | 0.11 | Keywords: | noteworthy |
| Target Milestone: | 0.12-M2 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Bug Depends on: | 305354 | ||
| Bug Blocks: | |||
|
Description
Chris Aniszczyk
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? (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>); } For review... http://egit.eclipse.org/r/#change,2970 Merged as e109529d6f7f9c69e6fe7e864b90cdcafe998cf0. |