No subject


Thu May 27 11:52:52 EDT 2010


git checkout HEAD~1

This _should_ move your current checkout back one commit, before your C#
commits.  You will get a very scary sounding message about being in a
"detached HEAD" state (sort of like a headless chicken running around).  Yo=
u
could also enter a branch name, or a SHA1 rather than HEAD~1.  Incidentally=
,
HEAD~1 means the commit before the HEAD, a sort of shorthand for relative
commits.

The next thing I would try is to create a branch here:

git checkout -b SimpleITKCSharpWrapping

This should create the branch and move you onto it.  Then you'll need to
pull your commits from the master:

git cherry-pick <previous SHA1>

If I understand correctly, cherry-pick will take the patch from <previous
SHA1> and apply it to your current branch.  cherry-pick is designed to pull
commits from branch to branch (just like picking cherries).  It will also
commit those changes so your branch should be in exactly the same state as
your master.

Then you should be able to push to Gerrit.

Also, don't worry about messing up your remote.  Unless people have cloned
from it, they shouldn't be effected.  If we start re-writing history on
"official" repos, then we might have problems and angry people.

Cheers,
-dan (b)

P.S.  Notice I used a lot of "should"s.  I hope this works, I tried it out
on a clone of my SimpleITK.


On 9/20/10 1:11 AM, "Dan Mueller" <dan.muel at gmail.com> wrote:

> Hi Dan (B), (others),
>=20
> I'm a total git newbie and struggling a bit to send my SimpleITK C#
> wrapping changes to gerrit.
>=20
> I am following the steps you describe here:
>     http://www.itk.org/Wiki/ITK/Gerrit/Primer
>=20
> Firstly I rebased two commits into a single commit:
>     $ git rebase -i HEAD~2
>     [detached HEAD 6f6a4df] Add initial support for C# wrapping
>      13 files changed, 407 insertions(+), 20 deletions(-)
>      create mode 100644 Examples/SimpleGaussian.cs
>      create mode 100644 Wrapping/AssemblyInfo.cs.in
>      create mode 100644 Wrapping/CSharpModules/FindCSharp.cmake
>      create mode 100644 Wrapping/CSharpModules/FindDotNetFrameworkSdk.cma=
ke
>      create mode 100644 Wrapping/CSharpModules/FindMono.cmake
>      create mode 100644 Wrapping/CSharpModules/UseCSharp.cmake
>      create mode 100644 Wrapping/CSharpModules/UseDotNetFrameworkSdk.cmak=
e
>      create mode 100644 Wrapping/CSharpModules/UseMono.cmake
>      create mode 100644 Wrapping/CSharpTypemapHelper.i
>     Successfully rebased and updated refs/heads/master.
>=20
> Success. Then I tried to push to gerrit, but encountered my first
> problem: I did not create a topic branch for this work, but committed
> everything to the master of my github local repository. So the step:
>     $ git push gerrit topic_branch_name:refs/for/master/remote_name
> does not work because I don't have topic_branch_name.
>=20
> Instead I just tried to push "master" (though not sure if this is
> right). Anyhow, I got the following error:
>     $ git push gerrit master:refs/for/master/SimpleITKCSharpWrapping
>     Counting objects: 159, done.
>     Delta compression using up to 2 threads.
>     Compressing objects: 100% (87/87), done.
>     Writing objects: 100% (159/159), 234.51 KiB, done.
>     Total 159 (delta 79), reused 134 (delta 70)
>     To danmuel at review.source.kitware.com:ITK
>      ! [remote rejected] master ->
> refs/for/master/SimpleITKCSharpWrapping (no common ancestry)
>     error: failed to push some refs to 'danmuel at review.source.kitware.com=
:ITK'
>=20
> I think my problem is that I need to add a remote to the SimpleITK
> project (not the ITK project described in the primer), so I did this:
>     $ git remote add gerritsimpleitk
> danmuel at review.source.kitware.com:SimpleITK
>=20
> Questions: Is this correct? Will pushing my "master" work, or do I
> need a topic branch? If I need a topic branch, how can I create one
> when I have already committed the changes to the master?
>=20
> Next issue: as described above, I rebased two commits into one.
> However, before I did the rebase, I had previously pushed those single
> commits to my remote repository on github. I was reading here
>    http://progit.org/book/ch3-6.html#the_perils_of_rebasing
> that pushing again will cause people to hate me. I don't really want
> people to hate me...
>=20
> Does that mean I should send two reviews to gerrit: one for each
> pushed commit? (And revert the rebase to make sure I don't push it?).
>=20
> Sorry for all the newbie questions...
>=20
> Cheers, Dan
>=20
> On 16 September 2010 22:07, Daniel Blezek <Blezek.Daniel at mayo.edu> wrote:
>> Hi Dan,
>>=20
>> =A0I just finished writing a primer for Gerrit / git. =A0It is based on ITK,
>> but if you substitute SimpleITK, it should be identical. =A0The last step =
is
>> also different, as I simply push to my Github repo any final changes.
>>=20
>> http://www.itk.org/Wiki/ITK/Gerrit/Primer
>>=20
>> Best,
>> -dan
>>=20
>>=20
>> On 9/15/10 1:10 AM, "Dan Mueller" <dan.muel at gmail.com> wrote:
>>=20
>>> Hi Dan (B),
>>>=20
>>>> =A0Would you mind pushing this to Gerrit?
>>> Sure. Once you're ready, just point me to the wiki page describing the
>>> process.
>>>=20
>>> Cheers, Dan (M)
>>>=20
>>> On 14 September 2010 22:23, Daniel Blezek <Blezek.Daniel at mayo.edu> wrot=
e:
>>>> Hi Dan,
>>>>=20
>>>> =A0Would you mind pushing this to Gerrit? =A0I have not yet had time to pu=
t
>>>> together a primer on how to assemble a Gerrit push, so if you want to =
wait
>>>> a
>>>> bit I can get that together and you can test it the process.
>>>>=20
>>>> Thanks,
>>>> -dan
>>>>=20
>>>>=20
>>>> On 9/14/10 2:21 PM, "Dan Mueller" <dan.muel at gmail.com> wrote:
>>>>=20
>>>>> Hi all,
>>>>>=20
>>>>> For your reference: I've finally had the time to finish my first
>>>>> attempt adding C# wrapping to SimpleITK:
>>>>>=20
>>>>> http://github.com/danmuel/SimpleITK/commit/a851b4c8f185f9c97b95739de8=
e39a4
>>>>> c4
>>>>> 2c
>>>>> bca60
>>>>>=20
>>>>> I based the CMake modules on those in GDCM. The refactored CMake
>>>>> modules may be useful for WrapITK. Currently only .NET on Windows is
>>>>> supported; I still need to add support for Mono. Also, there is lots
>>>>> more work required in the SWIG .i file, but at least it's a start...
>>>>>=20
>>>>> Cheers, Dan
>>>>=20
>>>> --
>>>> Daniel Blezek, PhD
>>>> Medical Imaging Informatics Innovation Center
>>>>=20
>>>> P 127 or (77) 8 8886
>>>> T 507 538 8886
>>>> E blezek.daniel at mayo.edu
>>>>=20
>>>> Mayo Clinic
>>>> 200 First St. S.W.
>>>> Harwick SL-44
>>>> Rochester, MN 55905
>>>> mayoclinic.org
>>>> "It is more complicated than you think." -- RFC 1925
>>>>=20
>>>>=20
>>=20
>> --
>> Daniel Blezek, PhD
>> Medical Imaging Informatics Innovation Center
>>=20
>> P 127 or (77) 8 8886
>> T 507 538 8886
>> E blezek.daniel at mayo.edu
>>=20
>> Mayo Clinic
>> 200 First St. S.W.
>> Harwick SL-44
>> Rochester, MN 55905
>> mayoclinic.org
>> "It is more complicated than you think." -- RFC 1925
>>=20
>>=20

--=20
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.daniel at mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org
"It is more complicated than you think." -- RFC 1925



More information about the Insight-developers mailing list