Hi! Akos Vandra wrote: > >> I tried doing: > >> > >> git fetch ssh://axo...@openocd.zylin.com:29418/openocd > >> refs/changes/34/534/4 && git checkout FETCH_HEAD > >> git pull ssh://axo...@openocd.zylin.com:29418/openocd refs/changes/69/669/1 > >> > >> (make changes) > >> > >> git add ... > >> git commit > >> tools/checkpatch.sh > >> > >> However I can't push to the gerrit: > > > > The above is no good. Please explain in more detail what you want to > > do exactly? > > I committed a few patches to gerrit over the current origin/master, > not having Andreas' patches merged. > From now on I'd like to have Andreas' patches around when I work, > because it's easier to see how it works. > However whatever I commit also depends on my previous work, so my work > kindof depends on two set of patches. Which basically is a merge, > which gerrit does not allow me to do. > > > Does your new work strictly require both the ftdi driver and the 669 > > change, or is the ftdi driver just a nice-to-have while testing? > > It's just a nice-to-have while testing.
Ok! Thanks for explaining! Since your work does not strictly require the ftdi driver I recommend this: git checkout master && git pull --rebase && \ git fetch origin refs/changes/69/669/1 && \ git checkout -b yournewwork FETCH_HEAD && \ git add files && git commit -s && tools/checkpatch.sh The above creates your new commits on top of your previous work. Since your previous is a strict requirement for your new work that's the way to do it. At this point you have a branch called yournewwork, which includes your 669 change as well as a new commit. This branch starts at the commit in master where you created the 669 change, as you can confirm in git log. 669 was created without the ftdi driver, which is the right way to go. Now, the question is how to add the ftdi driver into yournewwork. You can include it at any point in history, but if you want to push the yournewwork branch and you make some changes before the 669 commit in your local branch (using e.g. git rebase -i to insert the ftdi driver before 669) then when you push you will make 669 depend on the ftdi driver, which is not really right. Instead, I would suggest to simply create a local yournewwork_ftdi branch for testing, where you combine the yournewwork branch with the ftdi driver commits in any way that you like. This branch will only be for testing purposes. Switching between branches is fast with git, so having many of them is not a big problem. I would suggest first creating an ftdi branch with (only) the new driver, and then it becomes very easy both to cherry-pick or to merge the two branches (yournewwork and ftdi) together. First prepare the ftdi branch: git fetch origin refs/changes/34/534/4 && \ git checkout -b ftdi FETCH_HEAD Now create (and checkout) the yournewwork_ftdi branch, which will be at exactly the same point as the yournewwork branch created above. git checkout -b yournewwork_ftdi yournewwork And finally bring in the ftdi driver, either using: git cherry-pick master..ftdi or: git merge ftdi Cherry-pick above avoids the merge which IMO makes it easier to get an overview of the commit. Note that you will never push the yournewwork_ftdi branch, it is exclusively for your local testing. You push the yournewwork branch only, which adds new commits in Gerrit which depend on your 669 change. If you get some feedback or have new ideas for further changes on the yournewwork branch then you will: git checkout yournewwork && \ edit files && \ git add files && git commit --amend -C HEAD In order to update the last commit on the yournewwork branch. After this, yournewwork and yournewwork_ftdi will have diverged. In order to test the new change, you'll do: git rebase yournewwork yournewwork_ftdi (I.e: Rebase the yournewwork_ftdi on top of the latest yournewwork state.) If the tests are successful and you want to push, there's a shortcut which works regardless of what branch you have currently checked out: git push origin yournewwork:refs/for/master Please pay very close attention to the Change-Id when you rewrite history (using git rebase and using git commit --amend) in order to not create a mess in Gerrit. Hope this helps! Feel free to ask if something is not clear. //Peter ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ OpenOCD-devel mailing list OpenOCD-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openocd-devel