]> source.dussan.org Git - jgit.git/commit
Define NoteMap, a simple note tree reader 33/1833/5
authorShawn O. Pearce <spearce@spearce.org>
Fri, 5 Nov 2010 01:24:45 +0000 (18:24 -0700)
committerChris Aniszczyk <caniszczyk@gmail.com>
Thu, 11 Nov 2010 16:06:43 +0000 (10:06 -0600)
commit936820988fa9e46c358af7971806faa6515546f6
tree1cc2e908d397d582a3ea148a011a42f2a952ae4c
parent6043d4638cbd865688e5cd0da4dde09ec9de4678
Define NoteMap, a simple note tree reader

The NoteMap makes it easy to read a small notes tree as created by
the `git notes` command in C Git.  To make the initial implementation
simple a notes tree is read recursively into a map in memory.
This is reasonable if the application will need to access all notes,
or if there are less than 256 notes in the tree, but doesn't behave
well when the number of notes exceeds 256 and the application
doesn't need to access all of them.

We can later add support for lazily loading different subpaths,
thus fixing the large note tree problem described above.

Currently the implementation only supports reading.  Writing notes
is more complex because trees need to be expanded or collapsed at
the exact 256 entry cut-off in order to retain the same tree SHA-1
that C Git would use for the same content.  It also needs to retain
non-note tree entries such as ".gitignore" or ".gitattribute" files
that might randomly appear within a notes tree.  We can also add
writing support later.

Change-Id: I93704bd84ebf650d51de34da3f1577ef0f7a9144
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
org.eclipse.jgit.test/META-INF/MANIFEST.MF
org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/NoteMapTest.java [new file with mode: 0644]
org.eclipse.jgit/META-INF/MANIFEST.MF
org.eclipse.jgit/src/org/eclipse/jgit/notes/Note.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMap.java [new file with mode: 0644]