Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] How to get one gerrit change into local branch

4 jan 2011 kl. 17:39 skrev Shawn Pearce:

> On Tue, Jan 4, 2011 at 06:16, Thorsten Kamann
> <thorsten.kamann@xxxxxxxxxxxxxx> wrote:
>> I want to edit a change from gerrit on a second workstation. For this I have
>> clone the egit repository. From this master I've created a local branch.
>> How can I merge the gerrit change in this branch? Can this be done with
>> egit?
>> Gerrit-Change:,2155
> This may be harder to do in EGit than it should be.  Setup a fetch
> from Gerrit's URL, but in the fetch refspecs you need to copy
> refs/changes/55/2155/7 into some local branch on your repository (e.g.
> refs/remotes/gerrit/2155).  After that is fetched, do a reset hard to
> that commit.
> Gerrit has some of these actions as C Git command lines you can copy
> and paste, on the start of those lines you can get the URL and the
> refs/changes/... string for the given patch set you are interested in.
> Since these sorts of lines are so common in the Git world, it might
> help if EGit had a "Pull" dialog that just accepted a "git pull URL
> REF" syntax and parsed it all for you.  Sadly, I don't think we have
> that yet.

I have something like this, that get me very change from gerrit. It
helps in this case.

	fetch = +refs/changes/*:refs/remotes/gerrit/changes/*

That gives a lot of references, but so far, no problems. It gives some
ideas for improving the UI.

We could parse a paste request in the pull dialog. I do that kind of
stuff in a license check dialog. Rather than forcing the user to paste
a certain part, I allow the user to just paste everything from an email
and the dialog grabs what it wants. I think the merge dialog should also
have an option for performing a merge right away. Pasting a gerrit generated
command into the URL could fill in the rest of the dialog and leave just
the URL in the URL field.

-- robin

Back to the top