No, this functionality is not in JGit. I like "git cherry" functionality and sometimes use it by switching to native git for that. But up to know IIRC nobody asked for that functionality in JGit. In contrast to other missing features which can also be achieved by combining other JGit commands "git cherry" is really something new. One would have to diff the patches for all commits in the target branch to that of the commit to be "cherried?". If the patches are equal enough one could determine the commit is already in the target branch. Do you have an interest to contribute?
Thanks for your reply Christian!
Indeed, I discovered this command recently, it's really neat to spot that a commit is most likely generated by a cherry-pick! It avoids to manually generate the patch-id of both commits and compare them.
I could be interested to contribute, but I do have to admit that I feel like the code is a bit hardcore xD How does it work for the contribution?
In the meantime, do you think there is a way to achieve this "cherry-pick detection"? I don't remember having seen the patch-id command neither... Or is it an option of the patch one?