{"thread":{"id":"14476","subject":"[PATCH] rebase-i: keep old parents when preserving merges","startedAt":"2008-07-16T01:51:49Z","lastAt":"2008-07-16T21:51:11Z","messageCount":7,"participants":["Stephan Beyer","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"83464","messageId":"1216173109-11155-1-git-send-email-s-beyer@gmx.net","threadId":"14476","inReplyTo":null,"subject":"[PATCH] rebase-i: keep old parents when preserving merges","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-16T01:51:49Z","receivedAt":"2008-07-16T01:51:49Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"This patch fixes two issues for rebase -i with preserving\nmerges of unrelated branches.\n\nMerge parents that are part of an unrelated branch have not been\nkept as a parent in some cases.\nThat means, a rewritten merge commit has either lost a parent\nor rebase tried to cherry-pick this merge commit which resulted\nin an error.\n\nSigned-off-by: Stephan Beyer <s-beyer@gmx.net>\n---\n git-rebase--interactive.sh |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex a35212d..0df7640 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -174,6 +174,8 @@ pick_one_preserving_merges () {\n \t\t\t\tnew_parents=\"$new_parents $new_p\"\n \t\t\t\t;;\n \t\t\tesac\n+\t\telse\n+\t\t\tnew_parents=\"$new_parents $p\"\n \t\tfi\n \tdone\n \tcase $fast_forward in\n-- \n1.5.6.3.357.ge6ecd\n"},{"id":"83466","messageId":"20080716022651.GA11611@leksak.fem-net","threadId":"14476","inReplyTo":"1216173109-11155-1-git-send-email-s-beyer@gmx.net","subject":"Re: [PATCH] rebase-i: keep old parents when preserving merges","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-16T02:26:51Z","receivedAt":"2008-07-16T02:26:51Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"I have to admit that the subject is pretty ambiguous.\n\nSorry :) I should go to bed.\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"83468","messageId":"alpine.DEB.1.00.0807160432480.2841@eeepc-johanness","threadId":"14476","inReplyTo":"1216173109-11155-1-git-send-email-s-beyer@gmx.net","subject":"Re: [PATCH] rebase-i: keep old parents when preserving merges","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-16T02:33:14Z","receivedAt":"2008-07-16T02:33:14Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 16 Jul 2008, Stephan Beyer wrote:\n\n> This patch fixes two issues for rebase -i with preserving\n> merges of unrelated branches.\n\nTwo?  What's the second?\n\nPatch is obviously good.\n\nThanks,\nDscho\n"},{"id":"83489","messageId":"20080716094301.GA25087@leksak.fem-net","threadId":"14476","inReplyTo":"alpine.DEB.1.00.0807160432480.2841@eeepc-johanness","subject":"Re: [PATCH] rebase-i: keep old parents when preserving merges","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-16T09:43:01Z","receivedAt":"2008-07-16T09:43:01Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nJohannes Schindelin wrote:\n> Hi,\n> \n> On Wed, 16 Jul 2008, Stephan Beyer wrote:\n> \n> > This patch fixes two issues for rebase -i with preserving\n> > merges of unrelated branches.\n> \n> Two?  What's the second?\n\nOh, eh, well ;)\nIt's only one bug, but it results in two different behaviors...\nIf you have a merge with more than two parents and not all are lost,\nthen it merges with too few parents.\nIf you have a merge with exactly two parents and one is lost, then\nit tries to cherry-pick (with an error).\n\"Two\" \"issues\" :)\n\nRegards.\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"83492","messageId":"alpine.DEB.1.00.0807161223210.8503@eeepc-johanness","threadId":"14476","inReplyTo":"20080716094301.GA25087@leksak.fem-net","subject":"Re: [PATCH] rebase-i: keep old parents when preserving merges","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-16T10:24:05Z","receivedAt":"2008-07-16T10:24:05Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 16 Jul 2008, Stephan Beyer wrote:\n\n> Johannes Schindelin wrote:\n> \n> > On Wed, 16 Jul 2008, Stephan Beyer wrote:\n> > \n> > > This patch fixes two issues for rebase -i with preserving merges of \n> > > unrelated branches.\n> > \n> > Two?  What's the second?\n> \n> Oh, eh, well ;)\n> It's only one bug, but it results in two different behaviors...\n\nAh, okay.  Worthwhile clarifying in the commit message.\n\nThanks for the patch,\nDscho\n"},{"id":"83598","messageId":"7vd4ldpl3k.fsf@gitster.siamese.dyndns.org","threadId":"14476","inReplyTo":"1216173109-11155-1-git-send-email-s-beyer@gmx.net","subject":"Re: [PATCH] rebase-i: keep old parents when preserving merges","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-16T21:36:47Z","receivedAt":"2008-07-16T21:36:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephan Beyer <s-beyer@gmx.net> writes:\n\n... Based on the discussion thread, here is a rewrite of the log message.\n\n> When \"rebase -i -p\" tries to preserve merges of unrelated branches, it\n> lost some parents:\n>\n>  - When you have more than two parents, the commit in the new history\n>    ends up with fewer than expected number of parents and this breakage\n>    goes unnoticed;\n>\n>  - When you are rebasing a merge with two parents and one is lost, the\n>    command tries to cherry-pick the original merge commit, and the command\n>    fails.\n>\n> Signed-off-by: Stephan Beyer <s-beyer@gmx.net>\n>\n> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\n> index a35212d..0df7640 100755\n> --- a/git-rebase--interactive.sh\n> +++ b/git-rebase--interactive.sh\n> @@ -174,6 +174,8 @@ pick_one_preserving_merges () {\n>  \t\t\t\tnew_parents=\"$new_parents $new_p\"\n>  \t\t\t\t;;\n>  \t\t\tesac\n> +\t\telse\n> +\t\t\tnew_parents=\"$new_parents $p\"\n>  \t\tfi\n>  \tdone\n\nReading the surrounding code, it makes me wonder if you also need to futz\nwith variables like $preserve and $fast_forward.\n"},{"id":"83601","messageId":"20080716215111.GB18558@leksak.fem-net","threadId":"14476","inReplyTo":"7vd4ldpl3k.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] rebase-i: keep old parents when preserving merges","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-16T21:51:11Z","receivedAt":"2008-07-16T21:51:11Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nJunio C Hamano wrote:\n> Stephan Beyer <s-beyer@gmx.net> writes:\n> \n> ... Based on the discussion thread, here is a rewrite of the log message.\n> \n> > When \"rebase -i -p\" tries to preserve merges of unrelated branches, it\n> > lost some parents:\n> >\n> >  - When you have more than two parents, the commit in the new history\n> >    ends up with fewer than expected number of parents and this breakage\n> >    goes unnoticed;\n> >\n> >  - When you are rebasing a merge with two parents and one is lost, the\n> >    command tries to cherry-pick the original merge commit, and the command\n> >    fails.\n> >\n> > Signed-off-by: Stephan Beyer <s-beyer@gmx.net>\n\nOk, big thanks :)\n\n> > diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\n> > index a35212d..0df7640 100755\n> > --- a/git-rebase--interactive.sh\n> > +++ b/git-rebase--interactive.sh\n> > @@ -174,6 +174,8 @@ pick_one_preserving_merges () {\n> >  \t\t\t\tnew_parents=\"$new_parents $new_p\"\n> >  \t\t\t\t;;\n> >  \t\t\tesac\n> > +\t\telse\n> > +\t\t\tnew_parents=\"$new_parents $p\"\n> >  \t\tfi\n> >  \tdone\n> \n> Reading the surrounding code, it makes me wonder if you also need to futz\n> with variables like $preserve and $fast_forward.\n\nNo, I would not see a reason for that.\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"}]}