Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] RE: [master] Change I50f1287b: (egit/parallelip-egit) Implement "Compare with Revision" action

Mihael Vrbanec [mailto:Mihael.Vrbanec@xxxxxxxxxxxxxxxxxxxxxx] wrote:
> I pulled the latest version from

> git://
> and the patch sets
> git pull git://
> refs/changes/21/121/2
> and
> git pull git://
> refs/changes/22/122/2
> because they kind of belong together.
> Now I want to make changes to fix the issues in 21/121/2.
> How do I have to proceed?

I always use my local master branch to follow the blessed repo at eclipse
and do my work on topic branches per change I want to submit to Gerrit.

This way I can keep the changes separate until they are accepted upstream.

 Ensure your local master is up to date with egit/parallelip-egit.git :

      d029788@WDFN00200862A /c/data/git/EGit/egit (master)
      $ git pull
      Already up-to-date.

Create topic branch :

      d029788@WDFN00200862A /c/data/git/EGit/egit (master)
      $ git checkout -b 121
      Switched to a new branch '121'

Fetch 121 (if you don't do it from the branch this change has been initiated
from as far as i know it's better to fetch and cherry-pick, otherwise you may pull)

      d029788@WDFN00200862A /c/data/git/EGit/egit (121)
      $ git fetch git:// refs/changes/21/121/2
      From git://
       * branch            refs/changes/21/121/2 -> FETCH_HEAD

      d029788@WDFN00200862A /c/data/git/EGit/egit (121)
      $ git cherry-pick FETCH_HEAD
      Automatic cherry-pick failed.  After resolving the conflicts,
      mark the corrected paths with 'git add <paths>' or 'git rm <paths>' and commit the result.
      When commiting, use the option '-c fda069e' to retain authorship and message.

Oops, Alex introduced another action (IgnoreAction) with commit;a=commitdiff;h=7fe41b7e3c0732c8f391a61d5feabfc14d2965ba
which conflicts with your addition of CompareWithRevisionAction.

Open the conflicting file, the conflict has been marked by git (see

for the details). The area where a pair of conflicting changes happened is marked with markers
<<<<<<<, =======, and >>>>>>>. The part before the ======= is typically your side, and the part
afterwards is typically their side.

Edit the file until you reached the content you want. Stage your changes for the next commit

      d029788@WDFN00200862A /c/data/git/EGit/egit (121)
      $ git add org.eclipse.egit.ui/plugin.xml

and commit (using the option cherry-pick mentioned which will retain the author
and commit message of the picked change)

      d029788@WDFN00200862A /c/data/git/EGit/egit (121)
      $ git commit -c fda069e

Here we go, now you have reached:
- change 121 patchset 2 rebased to current master (conflict resolution included) is now ready on branch 121

Now do whatever changes you want to do, add them to the index and commit --amend them
(to replace previous version of patch).

Then push the result to Gerrit.

See why to use fetch / cherry-pick.

In case you start from the branch the first version of your patchset came from you may as well pull the change,
then you should check for conflicts with upstream changes by doing "rebase master" from branch 121 and resolve
and amend potentially resulting conflicts (in order not to pollute the upstream history with merge commits).

Looks a bit complicated but to my understanding this should work.

Maybe some more seasoned Gerrit user knows an easier recipe (Shawn ?)


Back to the top