[Insight-developers] Useful Gerrit trick -- compare patch versions locally

Williams, Norman K norman-k-williams at uiowa.edu
Tue Jul 12 11:31:20 EDT 2011


Probably you've all messed with using the command line gerrit helpfully
generates for you to get a Gerrit topic branch into your local ITK
repository.

I've lately hit on an idiom that's extremely useful:

If I have a patch already downloaded, that I may have modified in ways
that I don't precisely remember, I grab the git command from the gerrit
page and append a '2' to the patch name -- e.g. I paste this

git fetch http://review.source.kitware.com/p/ITK refs/changes/93/1993/11
&& git checkout FETCH_HEAD -b 20110629_GERRIT_MERGE

and add 2

git fetch http://review.source.kitware.com/p/ITK refs/changes/93/1993/11
&& git checkout FETCH_HEAD -b 20110629_GERRIT_MERGE2

Then I can locally diff the patch I was working on with what's currently
up on gerrit:

git diff 20110629_GERRIT_MERGE2 20110629_GERRIT_MERGE

You can actually work on different versions of the same patch if you need
to go down that road. You just have to remember to rename the patch before
you push it back up to match what's in Gerrit already, and of course, to
delete branches you no longer need.

--
Kent Williams norman-k-williams at uiowa.edu






________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________


More information about the Insight-developers mailing list