{"thread":{"id":"29978","subject":"rebase problem","startedAt":"2012-03-17T12:57:47Z","lastAt":"2012-03-17T16:55:41Z","messageCount":5,"participants":["Joakim Tjernlund","Vincent van Ravesteijn"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"187147","messageId":"OF506B5658.3E449452-ONC12579C4.00460A6E-C12579C4.0047355D@transmode.se","threadId":"29978","inReplyTo":null,"subject":"rebase problem","fromName":"Joakim Tjernlund","fromEmail":"joakim.tjernlund@transmode.se","sentAt":"2012-03-17T12:57:47Z","receivedAt":"2012-03-17T12:57:47Z","isPatch":false,"sender":{"key":"joakim.tjernlund@transmode.se","avatar":null},"body":"\nA co-worker this on our local u-boot repo:\n  git checkout master\n  git fetch denx/master\n  git merge denx/master\n<resolve conflicts>\n  git commit\n  ...\n  git commit\nNow u-boot is working again\nthen update to latest u-boot so:\n  git fetch denx/master\n  git rebase denx/master\nNow it is a mess, that rebase seems to start from way back as a\nstaring reference, not from the last merge shown above.\nI guess I forgotten how git works, what did go wrong?\n\n  Jocke\n"},{"id":"187149","messageId":"4F649202.4080102@lyx.org","threadId":"29978","inReplyTo":"OF506B5658.3E449452-ONC12579C4.00460A6E-C12579C4.0047355D@transmode.se","subject":"Re: rebase problem","fromName":"Vincent van Ravesteijn","fromEmail":"vfr@lyx.org","sentAt":"2012-03-17T13:30:42Z","receivedAt":"2012-03-17T13:30:42Z","isPatch":false,"sender":{"key":"vfr@lyx.org","avatar":"https://avatars.githubusercontent.com/u/687868?v=4"},"body":"Op 17-3-2012 13:57, Joakim Tjernlund schreef:\n> A co-worker this on our local u-boot repo:\n>    git checkout master\n>    git fetch denx/master\n>    git merge denx/master\n> <resolve conflicts>\n>    git commit\n>    ...\n>    git commit\n> Now u-boot is working again\n> then update to latest u-boot so:\n>    git fetch denx/master\n>    git rebase denx/master\n> Now it is a mess, that rebase seems to start from way back as a\n> staring reference, not from the last merge shown above.\n> I guess I forgotten how git works, what did go wrong?\n>\n>    Jocke\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\nThe situation is like this:\n\n  master - C - o - o - D - o - o - o - A\n                      /\n  denx/master- - - - o - o - o - o - B\n\nNow, you ask to rebase master (A) onto denx/master (B). If master would \nhave started from D, it would indeed apply the commits D -- A on top of \nB. In your case, however, master already had a lot of commits that were \nnot in denx/master: C -- D  (including the merge resolution). So it will \nalso apply C -- D on top of  B.\n\nVincent\n"},{"id":"187155","messageId":"OF03E8C640.7C5AF318-ONC12579C4.004F7449-C12579C4.004FCF5C@transmode.se","threadId":"29978","inReplyTo":"4F649202.4080102@lyx.org","subject":"Re: rebase problem","fromName":"Joakim Tjernlund","fromEmail":"joakim.tjernlund@transmode.se","sentAt":"2012-03-17T14:31:44Z","receivedAt":"2012-03-17T14:31:44Z","isPatch":false,"sender":{"key":"joakim.tjernlund@transmode.se","avatar":null},"body":"Vincent van Ravesteijn <vfr@lyx.org> wrote on 2012/03/17 14:30:42:\n>\n> Op 17-3-2012 13:57, Joakim Tjernlund schreef:\n> > A co-worker this on our local u-boot repo:\n> >    git checkout master\n> >    git fetch denx/master\n> >    git merge denx/master\n> > <resolve conflicts>\n> >    git commit\n> >    ...\n> >    git commit\n> > Now u-boot is working again\n> > then update to latest u-boot so:\n> >    git fetch denx/master\n> >    git rebase denx/master\n> > Now it is a mess, that rebase seems to start from way back as a\n> > staring reference, not from the last merge shown above.\n> > I guess I forgotten how git works, what did go wrong?\n> >\n> >    Jocke\n> >\n> > --\n> > To unsubscribe from this list: send the line \"unsubscribe git\" in\n> > the body of a message to majordomo@vger.kernel.org\n> > More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n> The situation is like this:\n>\n>   master - C - o - o - D - o - o - o - A\n>                       /\n>   denx/master- - - - o - o - o - o - B\n>\n> Now, you ask to rebase master (A) onto denx/master (B). If master would\n> have started from D, it would indeed apply the commits D -- A on top of\n> B. In your case, however, master already had a lot of commits that were\n> not in denx/master: C -- D  (including the merge resolution). So it will\n> also apply C -- D on top of  B.\n\nThanks, this makes sense. How do I get from above to\n\n   master - C - o - o - D - o - o - o - A\n                       /\n   denx/master- - o - B\n\n\nJocke\n"},{"id":"187162","messageId":"4F64B7A9.20805@lyx.org","threadId":"29978","inReplyTo":"OF03E8C640.7C5AF318-ONC12579C4.004F7449-C12579C4.004FCF5C@transmode.se","subject":"Re: rebase problem","fromName":"Vincent van Ravesteijn","fromEmail":"vfr@lyx.org","sentAt":"2012-03-17T16:11:21Z","receivedAt":"2012-03-17T16:11:21Z","isPatch":false,"sender":{"key":"vfr@lyx.org","avatar":"https://avatars.githubusercontent.com/u/687868?v=4"},"body":"Op 17-3-2012 15:31, Joakim Tjernlund schreef:\n> Vincent van Ravesteijn<vfr@lyx.org>  wrote on 2012/03/17 14:30:42:\n>> Op 17-3-2012 13:57, Joakim Tjernlund schreef:\n>>> A co-worker this on our local u-boot repo:\n>>>     git checkout master\n>>>     git fetch denx/master\n>>>     git merge denx/master\n>>> <resolve conflicts>\n>>>     git commit\n>>>     ...\n>>>     git commit\n>>> Now u-boot is working again\n>>> then update to latest u-boot so:\n>>>     git fetch denx/master\n>>>     git rebase denx/master\n>>> Now it is a mess, that rebase seems to start from way back as a\n>>> staring reference, not from the last merge shown above.\n>>> I guess I forgotten how git works, what did go wrong?\n>>>\n>>>     Jocke\n>>>\n>>> --\n>>> To unsubscribe from this list: send the line \"unsubscribe git\" in\n>>> the body of a message to majordomo@vger.kernel.org\n>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>> The situation is like this:\n>>\n>>    master - C - o - o - D - o - o - o - A\n>>                        /\n>>    denx/master- - - - o - o - o - o - B\n>>\n>> Now, you ask to rebase master (A) onto denx/master (B). If master would\n>> have started from D, it would indeed apply the commits D -- A on top of\n>> B. In your case, however, master already had a lot of commits that were\n>> not in denx/master: C -- D  (including the merge resolution). So it will\n>> also apply C -- D on top of  B.\n> Thanks, this makes sense. How do I get from above to\n>\n>     master - C - o - o - D - o - o - o - A\n>                         /\n>     denx/master- - o - B\n>\n>\n> Jocke\n>\nDon't you just want to merge with denx/master again ?\n\n    master - C - o - o - D - o - o - o - A\n                        /               /\n    denx/master- - o - o - o - o - o - B\n\n\nIn this way you pull in the new commits from denx/master.\n\nOf course you can rework your history such to obtain what you drew \nabove, but this means you need to rewrite some of the history, which you \nprobably don't want to do if you share this code with colleagues. But \nwell, if you really want:\n\ngit checkout D~1\ngit merge B\ngit rebase --onto HEAD D master\n\nVincent\n"},{"id":"187165","messageId":"OFFD4FE25C.612A22F1-ONC12579C4.005CBFF0-C12579C4.005CFD5B@transmode.se","threadId":"29978","inReplyTo":"4F64B7A9.20805@lyx.org","subject":"Re: rebase problem","fromName":"Joakim Tjernlund","fromEmail":"joakim.tjernlund@transmode.se","sentAt":"2012-03-17T16:55:41Z","receivedAt":"2012-03-17T16:55:41Z","isPatch":false,"sender":{"key":"joakim.tjernlund@transmode.se","avatar":null},"body":"Vincent van Ravesteijn <vfr@lyx.org> wrote on 2012/03/17 17:11:21:\n>\n> Op 17-3-2012 15:31, Joakim Tjernlund schreef:\n> > Vincent van Ravesteijn<vfr@lyx.org>  wrote on 2012/03/17 14:30:42:\n> >> Op 17-3-2012 13:57, Joakim Tjernlund schreef:\n> >>> A co-worker this on our local u-boot repo:\n> >>>     git checkout master\n> >>>     git fetch denx/master\n> >>>     git merge denx/master\n> >>> <resolve conflicts>\n> >>>     git commit\n> >>>     ...\n> >>>     git commit\n> >>> Now u-boot is working again\n> >>> then update to latest u-boot so:\n> >>>     git fetch denx/master\n> >>>     git rebase denx/master\n> >>> Now it is a mess, that rebase seems to start from way back as a\n> >>> staring reference, not from the last merge shown above.\n> >>> I guess I forgotten how git works, what did go wrong?\n> >>>\n> >>>     Jocke\n> >>>\n> >>> --\n> >>> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> >>> the body of a message to majordomo@vger.kernel.org\n> >>> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> >> The situation is like this:\n> >>\n> >>    master - C - o - o - D - o - o - o - A\n> >>                        /\n> >>    denx/master- - - - o - o - o - o - B\n> >>\n> >> Now, you ask to rebase master (A) onto denx/master (B). If master would\n> >> have started from D, it would indeed apply the commits D -- A on top of\n> >> B. In your case, however, master already had a lot of commits that were\n> >> not in denx/master: C -- D  (including the merge resolution). So it will\n> >> also apply C -- D on top of  B.\n> > Thanks, this makes sense. How do I get from above to\n> >\n> >     master - C - o - o - D - o - o - o - A\n> >                         /\n> >     denx/master- - o - B\n> >\n> >\n> > Jocke\n> >\n> Don't you just want to merge with denx/master again ?\n>\n>     master - C - o - o - D - o - o - o - A\n>                         /               /\n>     denx/master- - o - o - o - o - o - B\n>\n>\n> In this way you pull in the new commits from denx/master.\n>\n> Of course you can rework your history such to obtain what you drew\n> above, but this means you need to rewrite some of the history, which you\n> probably don't want to do if you share this code with colleagues. But\n> well, if you really want:\n>\n> git checkout D~1\n> git merge B\n> git rebase --onto HEAD D master\n\nThanks, the code has not been pushed yet and we don't want more merges than\nnecessary so I will try your suggestion on Monday when I meet meet my co-worker\nagain.\n\n Once again, thanks\n                      Jocke\n"}]}