[Insight-developers] how to recover from a git/gerrit screw-up

Marcus D. Hanwell marcus.hanwell at kitware.com
Wed Oct 13 18:19:05 EDT 2010


On Wed, Oct 13, 2010 at 5:30 PM, kent williams
<norman-k-williams at uiowa.edu>wrote:

> So I took the plunge into the git/gerrit/ITK pool, and made a slight mess,
> due to unfamiliarity.
>

Nothing that can't be fixed.

>
> I now have 3 checkins on my topic and I need to do another to get things in
> a reviewable state.  I think I mis-read what to do if you need to amend a
> topic.
>

Any changes you don't want to keep open can be abandoned through the Gerrit
web interface. I just did this after an accidental rebase...pushing the
rebased commits to Gerrit made them appear as new.

>
> Then I  used interactive rebasing to squash all my changes together.  Do I
> just push those to the Gerrit repository, as a single patch?
>

You can do that, I was talking with Luis earlier, and I honestly don't think
squashing a topic down to a single commit is a necessary step. It is
certainly a step you can use to reduce uploaded commits, but it is not
required.

>
> Can I kill those earlier partial checkins, or is that even necessary?
>

You can click on the abandon button in each of the commit pages.

>
> The current (laughable) state of play for my topic is here:
>
> http://review.source.kitware.com/#q,status:open+project:ITK+branch:master+to
> pic:FloatingPointException-Handling,n,z
>
> I am heading out right now, but you should be able to abandon these
changes, and upload the new one. If you wish to amend your previous commits,
and have the Gerrit hook enabled to add the Change-Id lines to your commit
messages you can literally update a topic and push it to Gerrit again.

I will be preparing material for a Git/Gerrit workshop at the ITK meeting,
and so I will be working on refining the documentation.

Let me know if that hasn't made things clearer. I will be around tomorrow if
you need help.

Marcus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20101013/3efa3d52/attachment.htm>


More information about the Insight-developers mailing list