[Insight-developers] Gerrit thinks my new patch depends on another patch, when it shouldn't?

Marcus D. Hanwell marcus.hanwell at kitware.com
Fri Oct 22 18:14:56 EDT 2010


Hi Kent,

On Thu, Oct 21, 2010 at 1:51 PM, kent williams
<norman-k-williams at uiowa.edu> wrote:
> http://review.source.kitware.com/#change,221
>
> My procedure:
>
> git checkout -b FixImageLinearIteratorWithIndex2-Example
>
> # edit the file that needs fixing
>
> git commit -a
>
> git push gerrit
> HEAD:refs/for/master/FixImageLinearIteratorWithIndex2-Example
>
> I think my problem was not doing this at the start:
>
> git checkout -b FixImageLinearIteratorWithIndex2-Example origin/master
>
> Is there a way to break the dependency?
>
You would want to make a new topic branch, and then cherry-pick your
commit to it, and push the new topic branch to Gerrit.

git fetch
git checkout -b new-topic origin/master
git cherry-pick <hash-of-commit>

Then you can push this new topic, and the dependency will be broken.
If using the aliases I added, before pushing do,

git prepush

Otherwise,

git log origin/master..

That will give you a list of commits you are about to push into Gerrit.

I hope that helps, please let me know if you are confused. The main
thing is copying/pasting the hash of the commit you want to move onto
the new topic branch. I have also just cherry-picked commits using
Gerrit before staging/merging.

Marcus


More information about the Insight-developers mailing list