Why not create a topic branch, and then work off that topic.
In gerrit, create new branch "topic" from "master". Then:
devA$ git fetch
devA$ git checkout -b topic origin/topic
devA$ edit, commit, git push origin HEAD:refs/for/topic
review and submit change to topic. Next:
devB$ git fetch
devB$ git checkout -b topic/origin topic
devB$ edit, commit, git push origin HEAD:refs/for/topic
Rinse, wash, repeat. When topic is all done, then it gets merged to
master by one of the devs:
devA$ git fetch
devA$ git checkout origin/master
devA$ git merge origin/topic
Review the merge commit, which sadly needs to be done outside of gerrit. Then:
devA$ git push origin HEAD:master
You can also push the merge commit to refs/for/master, but since
gerrit doesn't really help in reviewing merge commits, there's not a
lot of benefit in doing so.
> (2) The other problem we've found is that we can't really use the
> Gerrit repo as a temporary store for works in progress that aren't
> ready for review yet. For example, if we make an unrestricted
> namespace that people can push into (eg. refs/heads/topics) to share
> their works in progress with collaborators, then once the topic is
> baked and is ready for submission it can't be submitted to refs/for/
> master because Gerrit has already seen the Change-Ids and considers
> that to already have been merged.
I think the problem is that you're using refs/heads. See using a
sandbox as described here:
http://gerrit-documentation.googlecode.com/svn/Documentation/2.1.7/access-control.html
Also http://www.mailinglistarchive.com/html/repo-d...@googlegroups.com/2010-07/msg00085.html
j.
[...]
> The only remaining issue we still need to face is how to push a topic
> through, bypassing review, so that we can run the code on our remote
> staging servers during development, prior to review. (We have a very
> large data set, so when we want to test out an idea against real data,
> the staging environment is good for that as it has a regularly
> refreshed copy of our production data.)
>
> For now, the simplest solution seems to be squashing the topic branch
> and suppressing the Change-Id, so that Gerrit won't later claim there
> are "no new changes", and letting the commit go through to a sandbox
> area.
Why not run the tests against the uploaded (and unmerged) changes? Just
set up the staging servers to fetch and check out refs/changes/X/Y and
you're all set.
--
Magnus Bäck Opinions are my own and do not necessarily
SW Configuration Manager represent the ones of my employer, etc.
Sony Ericsson