gerrit-rest-java-client icon indicating copy to clipboard operation
gerrit-rest-java-client copied to clipboard

CommitApi file endpoint

Open nickb-carallon opened this issue 4 years ago • 6 comments

Hey, it's currently possible to query the contents of a file in a commit (rather than all the files in that commit) via the Gerrit rest api, however there isn't a method for this exposed in the CommitApi java class. I was wondering if I wanted to add this to your project, would I first need to add a method for it to the main Gerrit repo, or would it be okay to just add here?

nickb-carallon avatar Feb 27 '21 23:02 nickb-carallon

Hi, thank you for pointing this out.

The files in the src/main/java/com/google directory are periodically synched with the ones of the main Gerrit repo.

For this reason, you should first add this functionality in the main Gerrit repo. Then, we will import the modified CommitApi class here and it will be possible to proceed with the implementation.

@uwolfer, do you agree?

EFregnan avatar Feb 28 '21 12:02 EFregnan

@uwolfer, do you agree?

Yes, makes sense to me.

@nickb-carallon: I'd suggest to open an issue against Gerrit, and get feedback whether it makes sense to add to their extensions API. And in that case implement it there first.

uwolfer avatar Mar 01 '21 20:03 uwolfer

Okay, thanks for the advice 🙂

nickb-carallon avatar Mar 02 '21 17:03 nickb-carallon

After some more reading and pondering, I believe I can accomplish more using the Gitiles plugin for Gerrit (such as retrieving trees as well as files). However it seems that including support for plugin apis here is still under discussion so I may leave making any changes until that discussion has been resolved.

nickb-carallon avatar Mar 02 '21 23:03 nickb-carallon

I assume you are talking about #59.

uwolfer avatar Mar 04 '21 19:03 uwolfer

Yep, that's the one.

nickb-carallon avatar Mar 04 '21 23:03 nickb-carallon