[vtk-developers] Gerrit conflicts

Bill Lorensen bill.lorensen at gmail.com
Thu Oct 14 15:11:30 EDT 2010


Here is what I've been doing in itk.

I have an itk checkout that I track master with.
When I review something, I create a branch just for the purpose of
review. I checkout that branch.
Then I pull the gerrit I want to review. I build, test and enter my
comments into the review. When I'm done reviewing I delete the branch.

So you are saying, I stay at master, then fetch I get this:
[VTK(master)] git fetch http://review.source.kitware.com/p/VTK
refs/changes/29/129/4 && git checkout FETCH_HEAD
>From http://review.source.kitware.com/p/VTK
 * branch            refs/changes/29/129/4 -> FETCH_HEAD
Note: checking out 'FETCH_HEAD'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at bc7016e... ENH: Scripts to setup development environment.
[VTK((no branch))]
--------------------------------
Now I do my build/test to verify the review.

To go back to master and discard the fetched review code I

git checkout master

Or I can retain the fetched review code in a branch with:

git checkout -b UsefulSetupScripts



On Thu, Oct 14, 2010 at 2:43 PM, Marcus D. Hanwell
<marcus.hanwell at kitware.com> wrote:
> On Thu, Oct 14, 2010 at 2:35 PM, Bill Lorensen <bill.lorensen at gmail.com>
> wrote:
>>
>> Marcus,
>>
>> Here is the situation:
>>
>> 1) I want to review your change:
>> http://review.source.kitware.com/#change,129
>> 2) I have an up-to-date version of VTK
>
> I would use the checkout option in Gerrit, in your VTK repository,
> git fetch http://review.source.kitware.com/p/VTK refs/changes/29/129/4 &&
> git checkout FETCH_HEAD
> This will put you in a detached head with exactly what I had at the time. I
> have now merged this change, and a small fix after you spotted the error. If
> you want to turn it into a topic branch after you fetched it, simply,
> git checkout -b UsefulSetupScripts
> This should allow you to review the changes as they were, without trying to
> merge it into the current master.
> Marcus



More information about the vtk-developers mailing list