Skip to main content

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

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). 

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?

Cheers
-- Imran

On Mon, Sep 26, 2016 at 8:38 AM, Christian Halstrick <christian.halstrick@xxxxxxxxx> wrote:
I think in JGit we implemented the functionality of "git notes add ..." [1]. And this command does not add an additional note to an object but it just sets or overwrite the single note on a object. That command will by default even abort if the object on which you want to put a note already has a note. I would say: works as designed. I think the name is of the sub-command in native git is a little bit misleading  since one could easily think you could add multiple notes to an object with this command.

Ciao
  Chris

On Sun, Sep 25, 2016 at 12:10 AM, Imran <imranbohoran@xxxxxxxxx> wrote:
Hello

I'm trying to append a note to a commit and not sure there's a way to do that using the jgit API. I've used the AddNoteCommand to add a note to a commit, but using the same to add another note on a commit just overrides it. I believe this is because;

Is there another way I could append a note or is that something that is missing? Happy to create pull request for a AppendNoteCommand if that's what everyone thinks should be done.

Cheers
-- Imran

_______________________________________________
jgit-dev mailing list
jgit-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jgit-dev



Back to the top