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

2009/12/14 Matthias Sohn <matthias.sohn@xxxxxxxxxxxxxx>
Mihael Vrbanec [mailto:Mihael.Vrbanec@xxxxxxxxxxxxxxxxxxxxxx] wrote:
> I pulled the latest version from

>
> git://egit.eclipse.org/egit/parallelip-egit.git
>
> and the patch sets
>
> git pull git://egit.eclipse.org/egit/parallelip-egit
> refs/changes/21/121/2
>
> and
>
> git pull git://egit.eclipse.org/egit/parallelip-egit
> 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.

I found an easier way to achieve the same result :

install gerrit-cherry-pick (http://gerrit.googlecode.com/svn/documentation/2.1/cmd-cherry-pick.html,
on Windows I had to install it to /bin/ instead of ~/bin/ otherwise MINGW doesn't find it):

    d029788@WDFN00200862A /c/data/git/EGit/egit (master)
    $ scp -p -P 29418 username@xxxxxxxxxxxxxxxx:bin/gerrit-cherry-pick ~/bin/

 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'

gerrit-cherry-pick 121/2 onto your fresh topic branch :

    d029788@WDFN00200862A /c/data/git/EGit/egit (121)
    $ gerrit-cherry-pick origin 121/2
    From http://egit.eclipse.org/egit/parallelip-egit
     * branch            refs/changes/21/121/2 -> FETCH_HEAD

    Applying: Implement "Compare with Revision" action
    Using index info to reconstruct a base tree...
    Falling back to patching base and 3-way merge...
    Auto-merging org.eclipse.egit.ui/plugin.xml
    CONFLICT (content): Merge conflict in org.eclipse.egit.ui/plugin.xml
    Failed to merge in the changes.
    Patch failed at 0001 Implement "Compare with Revision" action

    When you have resolved this problem run "/bin/gerrit-cherry-pick --continue".
    If you would prefer to skip this patch, run "/bin/gerrit-cherry-pick --skip".

we end up with the same conflict :

Oops, Alex introduced another action (IgnoreAction) with commit
http://egit.eclipse.org/w/?p=egit/parallelip-egit.git;a=commitdiff;h=7fe41b7e3c0732c8f391a61d5feabfc14d2965ba
which conflicts with your addition of CompareWithRevisionAction.

Open the conflicting file, the conflict has been marked by git (see
http://kernel.org/home/ftp/pub/software/scm/git/docs/git-merge.html

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


then restart the command with the --continue option

    d029788@WDFN00200862A /c/data/git/EGit/egit (121|REBASE)
    $ gerrit-cherry-pick --continue
    Applying: Implement "Compare with Revision" action
    /bin/gerrit-cherry-pick: line 52: get_changeid: command not found
    /bin/gerrit-cherry-pick: line 57: .git/GERRIT_CHANGES/: File exists
    Done.
 
Here we go, now you have reached (as git log shows):

- change 121 patchset 2 rebased to current master (conflict resolution included) is now ready on branch 121

    d029788@WDFN00200862A /c/data/git/EGit/egit (121)
    $ git log
    commit 6b43aedaf5bc8d2ec8db39e25da910545ba4ed8d
    Author: Mihael Vrbanec <vrbanec@xxxxxxxxxxxx>
    Date:   Wed Dec 2 13:41:12 2009 +0100

        Implement "Compare with Revision" action
   
        Signed-off-by: Stefan Lay <stefan.lay@xxxxxxx>
        Change-Id: I50f1287b72aca6defc044a8dd47b233d8c3a40e3
   
    ...

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 http://groups.google.com/group/repo-discuss/browse_thread/thread/44b3afdedd37db6d 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).

 --
Matthias

Back to the top