Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Append note


On Mon, Sep 26, 2016 at 3:54 PM, Imran <imranbohoran@xxxxxxxxx> wrote:
Hi Christian

I agree with you that the AddCommand functionality could be deemed as "work as designed" with regards to the "git notes add" (Although native git notes add fails if there's a note already exists, unless -f is used -  But that's a different discussion). 

and if -f is used then the "git notes add" command replaces the existing note ... which is the same functionality which we have in JGit.
 
What I'm after is a similar command for "git notes append", which doesn't exist as of now AFAIK. Inspecting the code a bit more I realise https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/notes/LeafBucket.java#L147 is implemented particularly for "git notes add ..". I was able to get "git notes append ..." working on a local branch by changing LeafBucket.set(AnyObjectId noteOn, AnyObjectId noteData, ObjectReader or) method (to support add and append). However there are tests that fail due to the current expectation that LeafBucket.set() only supports "git notes add". 
I assumed there could be a LeafBucket.append() method which can support "git notes append ..", which is exposed by a new AppendNoteCommand. Does that make sense?

I agree. I also think we should add a AppendNoteCommand (as a sibling of AddNoteCommand) to support your use case. Maybe you would like to contribute to JGit? It's always good to have somebody with a real need for a certain feature to start the development. 
 

Back to the top