I uploaded a series of (basically independent) commits (ie. patchsets).

Code compiles, but jenkins fails for code style issues (whitespace, line length).

All of the wikis I've seen, including the openocd patch guide, say to

git commit --amend
git push review

However, --amend only works with the last commit.

Once additional commits for other patchsets have been made, the change is rejected by gerrit (ie. same Change-Id in multiple changes).

So it looks like the correct way to handle multiple patches is to create a separate local branch for each independent patchset, push to refs/for/master from each branch, and if code needs any rework, then make the change in the associated branch and amend the commit (which will always be the last commit for that branch).

So I would then create a number of new branches, and then check them out one at a time, cherry picking a single commit from my existing branch.

Even after jenkins is happy, I would still keep each of those branches on my local repo until the associated change / commit has been accepted by the openocd project, in case there are any changes needed due to code review.

Is that a viable approach?

Is there a simpler, or better, strategy?

I would suggest updating the patch guide, to help new developers who want to contribute to the project:

http://openocd.org/doc/doxygen/html/patchguide.html

PS. I would suggest also updating the patch guide wording:

"3b. You will need to install this hook, we will look into a better solution:"

to state *why* the hook is needed: ie. gerrit uses a Change-Id to correlate any amendments back to the original commit, and this automatically creates the Change-Id when the code is checked in.

And show the Signed-off-by example:

"5.  ... Signed-off-by: Your Name <your.em...@example.org>"

That will likely save others some searching.

Reply via email to