Not quite... sorry I wasn't as clear as I'd hoped.
On Mar 11, 4:35 pm, Shawn Pearce <
s...@google.com> wrote:
> On Wed, Mar 11, 2009 at 14:23, Brad Larson <
bklar...@gmail.com> wrote:
>
> > I want to make sure we are handling this situation correctly...
>
> > Let's start with a diagram (and hope it doesn't garble too badly):
>
> > C* - - - - - - - - -H*
> > / /
> > A - B - C - D - E - F - G - H
>
> > The master branch from a.g.k.o starts at A. We branched to an
> > internal development branch for a change C*. Now we want to merge
> > other changes made in master so we are back up to tips (H*).
>
> > We have pulled up by calling 'git-merge H' while on our development
> > branch. However, if we repo upload, it wants to push changes D-H
> > (actually something like 27 changes in our case). Can a merge like
> > this go through repo, or does it need to be git-pushed underneath
> > gerrit? (following the user-upload docs). We are comfortable doing
> > the git push, but would prefer if all changes/merges went through
> > gerrit and the code-review process. What is the best way to handle
> > this situation?
>
> Let me be sure I understand you correctly.
>
> Your Gerrit says "master" is currently at A. E.g. a
>
> git ls-remote your-gerrit:project.git refs/heads/master
>
> outputs "A".
No, it outputs "H". Our "master" branch is a pristine copy of AOSP/
master. Our changes are only done in a devel branch.
>
> Your client has gone and merged H from the AOSP, in addition to creating C*
> and H*.
>
> You only want to code review C* and H* on your internal Gerrit.
Actually, our only change is C*. I meant H* to mean the merge of C*
and H. We haven't introduced any changes since C* and just want to
merge in changes from upstream (D - H).
>
> To get this to work, you need to enable push access on the project, and push
> H to master directly, then "repo sync" or at least "git fetch" to update the
> tracking branch. repo upload will then show only C*, H* as being uploaded.
>
> But, this only works the first time. The next time you try to update from
> AOSP "master" is pointing at H* (or something further down the line) and you
> can't directly push P from the AOSP because P isn't a strict superset of H*.
>
> The best way around this is to create a pristine master branch that only
> contains the AOSP commits. Go into Gerrit web UI and create branch named
> "aosp/master" with revision A. Then push H into aosp/master directly.
>
> Now when you repo upload H* into master, Gerrit will only make changes for
> C*, H*, but master won't get the D-H until H* is submitted. The reason this
> works is, Gerrit makes a change record only for the first time a commit
> enters the repository. A-H are already visible in the repository through
> asop/master, and A is visible through master, so only C*,H* need changes to
> be reviewed.
We have already reviewed and merged C*. Now the developer has merged
D-H in his sandbox. If he runs 'repo upload', it says that he has 5
commits to merge, one for each of D-H. If he continues with the
merge, will it create 5 changes in Gerrit? That is what we are trying
to avoid. We would like to see 1 change in Gerrit for the merge of C*
with H (or, as a fallback, no changes in Gerrit and the merge to be
done behind the scenes).
>
> On future updates from AOSP, push AOSP into asop/master, then merge it on a
> client, and upload the merge to master. Rinse, repeat.
This is basically what we are doing... now we need to merge from asop/
master to us/devel.
Thanks!
-Brad