Best practice to fix patches that require merge or rebase

642 views
Skip to first unread message

Vicki Kozel

unread,
Nov 11, 2013, 11:50:48 AM11/11/13
to repo-d...@googlegroups.com
Hello,
what is the best practice to deal with changes that have not been merged due to a conflict?

 Gerrit UI says: 

"The change requires a local merge to resolve.

Please merge (or rebase) the change locally and upload the resolution for review."


So,

1) I checkout the patch as gerrit requires:

git fetch ssh://user@server:29418/app refs/changes/25/125/1 && git checkout FETCH_HEAD

git branch -b fix125

2) merge master into this branch: 

git merge master

3) then run interactive rebase to be able to edit the commit that was on the head of my patch:

git rebase --interactive 92bf85b~

in the interactive rebase editor I place "edit" against the commit in question.

My question is - should my commit that was on top of my patch be moved to the top of master? Also, should I squash that commit with the merge branches commit so the have the same Change IDs?

Edwin Kempin

unread,
Nov 11, 2013, 11:53:15 AM11/11/13
to Vicki Kozel, Repo and Gerrit Discussion
Do not use 'git merge' to resolve the conflict, but rather 'git rebase':


1) I checkout the patch as gerrit requires:

git fetch ssh://user@server:29418/app refs/changes/25/125/1 && git checkout FETCH_HEAD

git branch -b fix125

2) rebase this branch: 

git rebase origin/master




2013/11/11 Vicki Kozel <vicki...@gmail.com>

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Vicki Kozel

unread,
Nov 11, 2013, 3:22:35 PM11/11/13
to repo-d...@googlegroups.com, Vicki Kozel
Thank you for your answer. After  I rebase as you suggested below my change that was on top of my patch seem to disappear from the log. So when I issue: git log - neither the change id for the change i am fixing, nor its comment is there.

Matthias Sohn

unread,
Nov 11, 2013, 5:14:56 PM11/11/13
to Vicki Kozel, Repo and Gerrit Discussion
On Mon, Nov 11, 2013 at 9:22 PM, Vicki Kozel <vicki...@gmail.com> wrote:
Thank you for your answer. After  I rebase as you suggested below my change that was on top of my patch seem to disappear from the log. So when I issue: git log - neither the change id for the change i am fixing, nor its comment is there.

carefully check the commits between old and new base version before and after the rebase.
Most probably the change you are trying to rebase was already introduced by another commit.

--
Matthias 
Reply all
Reply to author
Forward
0 new messages