{"thread":{"id":"3188","subject":"Re: Two newbie question: \"dead\" branches and merging after cherry-pick.","startedAt":"2006-01-30T11:44:44Z","lastAt":"2006-01-30T11:44:44Z","messageCount":1,"participants":["Romano Giannetti"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"15250","messageId":"20060130114444.GA17093@pern.dea.icai.upcomillas.es","threadId":"3188","inReplyTo":null,"subject":"Re: Two newbie question: \"dead\" branches and merging after cherry-pick.","fromName":"Romano Giannetti","fromEmail":"romanol@upcomillas.es","sentAt":"2006-01-30T11:44:44Z","receivedAt":"2006-01-30T11:44:44Z","isPatch":false,"sender":{"key":"romanol@upcomillas.es","avatar":null},"body":"First of all, 1000 thanks and please forgive me for the broken thread, I was\nnot subscribed to the list before so I did a copy-and-paste from the web\narchive. \n\nJunio C. Hamano wrote:\n> \n> You are done with what you did in the branch for now, but you\n> have not merged the work to your day-to-day development \"master\"\n> for some reason.  In the meantime you would want to switch to\n> other topic branches to work on other topics, and while working\n> on them you do not want to \"git branch\" and \"git show-branch\" to\n> show the topic you are done with but not merged yet.  Later you\n> would want to come back to it to do some interesting stuff with\n> it (maybe finally merge into \"master\", or format-patch to send\n> upstream).  Is that what is happening here?\n> If so, I would have chosen \"postponed\" not \"dead\" to describe\n> the situation but you said \"dead\" and that is why I am wondering\n> if I am getting you correctly.\n\nYes, you have understood perfectly. I called them \"dead\" because really I do\nnot think to come back to them ever, but I want to maintain that as \"old\nstory\", something of the style \"that was an error, store it so that you will\nnever fall in it again\". \n> \n> Yes.  You have the tag under .git/refs which points at the tip\n> of that postponed branch head, so the development trail will not\n> be lost.  When you are done with other topics and would want to\n> come back to that topic again, you could do this:\n> \n\n>     $ git tag hold/jc/gitlink jc/link ;# copy it to tags/\n>        $ git branch -D jc/link             ;# delete it from heads/\n> \n> Now \"git branch\" would not show it, but \"gitk --all\" still would.\n>\n\nWhat I have done (and it seems to work perfectly) is \n\n    git checkout master\n    mkdir .git/refs/olds \n    mv .git/heads/test-bill-idea .git/olds\n\nand it seems to work ok. Thanks! \n\n    \n>         - Easier: suppose I cheery-picked \"abababab\" from branch \"testing\"\n>         to master branch. What will happen if later I decide to merge\n>         all \"testing\" to master branch? I will have a merge conflict (trying\n>         to apply two times the same fix) or not? \n> \n> This is easy to experiment so I'd suggest you to try it and tell\n> us what you see, like this:\n> \n>   $ git checkout -b test-merge-throwaway master\n>        $ git cherry-pick abababab\n>        $ ... play with it, maybe making a couple of commits\n>        $ git pull . testing\n> \n> I would not be surprised if this resolves cleanly. If abababab\n> is the only thing that touches the set of paths it touches,\n> other than what are in \"testing\" and what you did since\n> \"testing\" forked from \"master\", it is likely that the merge\n> would resolve cleanly.\n> \n> Otherwise you would likely to see conflicts --- in which case\n> you may want to suggest if/how we can reduce it.  \"cherry-pick\"\n> without -r drops a hint of which commit was picked in the commit\n> log so it _might_ be a good idea to teach git to optionally take\n> that information into account while doing the merge.  I dunno.\n> \n> Once you are done experimenting, you can come back to master and\n> delete the test-merge-throwaway branch:\n> \n>       $ git checkout master\n>        $ git branch -D test-merge-throwaway\n> \n\nThanks. I will play a bit with it. I sometime have a bit of fear to not\nbeing able to come back to a good state. I will do my homework and study a\nbit more git checkout, branch and reset (this latter gives me a bit of\nheadheache last time... ;-) ).\n\nThanks a lot. \n          \n-- \nRomano Giannetti             -  Univ. Pontificia Comillas (Madrid, Spain)\nElectronic Engineer - phone +34 915 422 800 ext 2416  fax +34 915 596 569\nhttp://www.dea.icai.upcomillas.es/romano/\n"}]}