<div dir="ltr"><div>thanks for your patience David. Didn't see the forest for the trees kind of thing: <br>the fetch and checkout commands on gerrit were there the whole time.<br></div><div>git commit --amend isn't discussed in Wiki/VTK/Git/Develop and so I<br>
wasn't aware of it, and now the meaning and purpose of Change-Id is clear.<br>- Dean<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 30, 2013 at 11:01 AM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Dean,<br>
<br>
If you've deleted your local topic branch, then the best way to start<br>
is to check it out again from gerrit, e.g. by using the "check out"<br>
link on the gerrit page:<br>
<br>
git fetch <a href="http://review.source.kitware.com/p/VTK" target="_blank">http://review.source.kitware.com/p/VTK</a> refs/changes/47/12247/1<br>
git checkout FETCH_HEAD -b med-image-props-fix<br>
<br>
Then you can amend it by:<br>
<br>
1) editing the file(s)<br>
2) "git add" the files<br>
3) git commit --amend<br>
<br>
The only thing that gerrit needs to identify the change is a<br>
"Change-Id" line in the change log, which for this change is the<br>
following:<br>
<br>
Change-Id: Iccc5a31629d09a143e3712ba9c936528ef868afc<br>
<br>
This is not a git SHA. This is specific to gerrit. So it is not<br>
something that you can find by using git reflog or any other git<br>
commands. Whenever you amend a change, you must make sure<br>
that the Change-Id in the commit stays the same. The commit SHA<br>
can change, but the gerrit Change-Id must stay the same.<br>
<br>
If you ran VTK/Utilities/SetupForDevelopment.sh when you started<br>
working with VTK git, then a Change-Id line should automatically be<br>
added to each commit that you make. If not, every time you revise a<br>
change you should go to the gerrit page for that change to get the<br>
Change-Id.<br>
<span class="HOEnZb"><font color="#888888"><br>
David<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Fri, Aug 30, 2013 at 8:41 AM, Dean Inglis <<a href="mailto:inglis.dl@gmail.com">inglis.dl@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> being fairly new to git and especially vtk gerrit, I messed up<br>
> responding to a code review: the git response ended up as an<br>
> additional code review instead of amending to the one originally<br>
> sent to gerrit. I deleted my local topic branch and<br>
> I'd like to just start again (amend the original gerrit commit)<br>
> but am not sure how to proceed.<br>
> On vtk gerrit there is the SHA id of the first commit<br>
> and if i do git reflog on my local copy, I have other information<br>
> that would enable me to set git HEAD, just not sure<br>
> which one to select.<br>
><br>
> regards,<br>
> Dean<br>
</div></div></blockquote></div><br></div>