See the docs: http://gerrit.googlecode.com/svn/documentation/2.0/user-upload.html#push_replace
that means, only pulling change-B, I always get the patch set-1 of
change-A and not patch-set 2 - why ?
How do I resolve this ?
regards,
Pavan
> >> >> > remove thedependencylink between them?...
Because the commit for the patch set on change-B points to the 1st
patch set on change-A.
In cases like this, when you upload a new change-A, you also must
upload a new change-B. Gerrit can't update change-B for you,
there might be merge conflicts that need to be resolved.
Using a push to refs/changes/<changenumber> like JBQ suggested
below is fine when there are no dependencies. With two commits,
you almost can handle it:
git push <URL> <commit-A>:refs/changes/A <commit-B>:refs/changes/B
but after that it gets impossible to do by hand. That's why
we introduced the Change-Id footer, and the commit-msg hook to
automatically insert it into commits for you.
> --
> To unsubscribe, email repo-discuss...@googlegroups.com
> More info at http://groups.google.com/group/repo-discuss?hl=en
This is exactly what I tried to do.
git push ... refs/changes/change-A = which got me patch set 2
but when I tried to do a
git push .. refs/changes/change-B = to get a patch set 2 dependent on
change-A (patch set2)
I get a squash commits first error..
regards,
Pavan
--
--Pavan Savoy
You must have created a 3rd commit and uploaded it as a replacement
to change-B. That's not what you wanted to do.
During the first upload, when changes A and B were first created
in Gerrit's database, your local Git repository should have looked
like this:
origin/master my-topic
| |
o--------------o-----------o
Gerrit assigned the changes and patch sets:
origin/master my-topic
| |
o--------------o-----------o
| |
A.1 B.1
Now you should have modified A using `git rebase -i HEAD~2`,
which creates the following:
origin/master
|
o--------------o-----------o
\ | |
\ A.1 B.1
\
\ my-topic
\ |
+--------o-----------o
You wanted to upload those two new commits to A and B, so Gerrit
can assign them as A patch set 2, B patch set 2:
origin/master
|
o--------------o-----------o
\ | |
\ A.1 B.1
\
\ my-topic
\ |
+--------o-----------o
| |
A.2 B.2
But, since you got a squash commits first error, it sounds like
perhaps you would up with this graph instead:
origin/master topic-B
| |
o--------------o-----------o-------o
\ | | /
\ A.1 B.1 /
\ /
\ topic-A /
\ | /
+--------o-------------+
|
A.2
Which is wrong, because A.1 and B.1 are both part of the history of
topic-B, which is what you tried to make Gerrt call A.2. If this
was actually submitted to your project, your bad versions of A
would actually be part of the project, polluting the history.
You should rebuild the branch that your "B" change is being developed
on by cherry-picking B.1 on top of A.2, getting you back to a graph
that looks like the 2nd one above. Then you should be ready to
upload it as a replacement for change B.
Is there a hack or something in gerrit where we can remove off a
dependency for a particular changes, I makes sense when there are
merge conflicts for gerrit to have dependency.
But even when the change is totally independecy, still a git push
would result in a dependency for a particular change, why is that ?
regards,
Pavan
No. There isn't. Changing the dependency requires cherry picking
the commit onto a different base. That could cause a conflict, or
it might cherry-pick clean but the code might not work as expected.
So you have to do the cherry-pick (or rebase) locally so you have
a chance to test it before uploading a replacement commit that uses
a different base.
> But even when the change is totally independecy, still a git push
> would result in a dependency for a particular change, why is that ?
Because the commit you are pushing still has a parent that it was
based on. It didn't come out of nowhere, it was created by taking
some existing version of the project and changing things.
The only way to have no dependency is to create a branch new git
repository, add files to it, and make the first commit. But that
is no way to develop a project, because you are forced to start
over from scratch every time you make a change.