Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] Learning the right way to push changes

On 4 Jun 2010, at 21:51, Matthias Sohn <matthias.sohn@xxxxxxxxxxxxxx> wrote:

2010/6/4 Alex Blewitt <alex.blewitt@xxxxxxxxx>
I discovered a bug with the earlier change I'd pushed to the review (and which Mathias kindly committed for me into 2854822da4c717e8df745486b440000639f80d49).
In your current case I would say squash the pending changes using rebase -i and push the resulting change.

Ok, I'll do that. 

 So that I know for next time, what should I have done? 

If you want to replace an existing change already pushed to gerrit you need to add its changeid as a footer in the last paragraph
of the commit message. Gerrit will check if the incoming new change has an already known changeid and if that's the case it
will put it as a new patchset for this change. Otherwise a new one will be created.

Ah, that's what I was missing. I'll give that another go. 

So the way to go would be
- abandon 807 
- squash the other 3 changes into 806 (means the squashed commit needs its changeid) 
- if necessary tweak this commit again until you are happy (amend is your friend)
- push the squashed commit and check if the result on gerrit is ok
- abandon 808 and 809

If this is confusing let me know, if you want I can also do this for you.

The description was excellent. I have a good handle on what I should do - I'll ping back if I get stuck again. 

Alex

Back to the top