[openstack-dev] [gerrit] Preparing a patch that has dependency to more than one code under review

Sylvain Bauza sbauza at redhat.com
Fri Aug 8 07:47:06 UTC 2014


Hi Nader,
Le 08/08/2014 09:23, Nader Lahouti a écrit :
> Hi,
>
> Is it possible to send a patch for review (i.e. A) on gerrit based on 
> multiple commit under the review (i.e. B and C)?
> Based on the wiki page to add dependency these command should be used:
> A->B, A->C (no dependency between B and C)
> #fetch change under review and check out branch based on that change.
> git review -d $PARENT_CHANGE_NUMBER
> git checkout -b $DEV_TOPIC_BRANCH
> # Edit files, add files to git
> git commit
> git review
> This seems to work only for one dependency. Is it possible to repeat 
> the first command,
> (i.e. git review -d $PARENT_CHANGE_NUMBER) multiple times for each 
> dependency?
>
>

The thing is really simple, just create a local branch for your patches 
series, and do one commit per Gerrit change.

When you'll run git-review and say "yes" to what it will ask you, there 
will be a commit hook which will append a Change-Id to every commit you 
have in your branch, and it will publish the whole series (so A will 
depend on B which itself depends on C).

If you need to produce a new patchset (ie. a new iteration of a change), 
you'll just have to interactively  rebase your local branch to the local 
master you have, edit the commit you want to amend (and leave git pick 
the others) and as Git will stop on your patch to edit when rebasing, 
you'll just have to --amend it and perform a git rebase --continue.

Hope it makes things clearer now,
-Sylvain
> Thanks,
> Nader.
>
>
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140808/29c1d7b4/attachment.html>


More information about the OpenStack-dev mailing list