{"thread":{"id":"27130","subject":"rebasing branch with reverted patches","startedAt":"2011-04-19T07:32:37Z","lastAt":"2011-04-19T10:21:45Z","messageCount":7,"participants":["Francis Moreau","Michael J Gruber","Andreas Ericsson","Santi Béjar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"166065","messageId":"BANLkTim5mf6okFN8V5V+B=Ns1JORD47a5A@mail.gmail.com","threadId":"27130","inReplyTo":null,"subject":"rebasing branch with reverted patches","fromName":"Francis Moreau","fromEmail":"francis.moro@gmail.com","sentAt":"2011-04-19T07:32:37Z","receivedAt":"2011-04-19T07:32:37Z","isPatch":false,"sender":{"key":"francis.moro@gmail.com","avatar":null},"body":"Hello,\n\nI'm wondering if it would be a good idea for git rebase to allow not\nrebasing reverted patch which are part of the rebased branch.\n\nFor example I'm currently rebasing my branch 'devel' onto master. This\nbranch have several commits and specially one called A and another one\ncalled A' which reverts A.\n\nWhen rebasing 'devel' branch, rebase could try to drop both A and A'.\n\nWhat do you think ?\n\nBTW is there a way to do this currently ?\n\nThanks\n-- \nFrancis\n"},{"id":"166068","messageId":"4DAD4B0F.9030908@drmicha.warpmail.net","threadId":"27130","inReplyTo":"BANLkTim5mf6okFN8V5V+B=Ns1JORD47a5A@mail.gmail.com","subject":"Re: rebasing branch with reverted patches","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-04-19T08:42:55Z","receivedAt":"2011-04-19T08:42:55Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Francis Moreau venit, vidit, dixit 19.04.2011 09:32:\n> Hello,\n> \n> I'm wondering if it would be a good idea for git rebase to allow not\n> rebasing reverted patch which are part of the rebased branch.\n> \n> For example I'm currently rebasing my branch 'devel' onto master. This\n> branch have several commits and specially one called A and another one\n> called A' which reverts A.\n> \n> When rebasing 'devel' branch, rebase could try to drop both A and A'.\n> \n> What do you think ?\n> \n> BTW is there a way to do this currently ?\n\nYou can do this with \"rebase -i\" by removing A and A' from the commit\nlist (or squashing them or dealing with them in whatever way you like).\n\nMichael\n"},{"id":"166071","messageId":"BANLkTimbSes-B8zK2a2t1Jp1v+29HdNvqw@mail.gmail.com","threadId":"27130","inReplyTo":"4DAD4B0F.9030908@drmicha.warpmail.net","subject":"Re: rebasing branch with reverted patches","fromName":"Francis Moreau","fromEmail":"francis.moro@gmail.com","sentAt":"2011-04-19T09:09:33Z","receivedAt":"2011-04-19T09:09:33Z","isPatch":false,"sender":{"key":"francis.moro@gmail.com","avatar":null},"body":"On Tue, Apr 19, 2011 at 10:42 AM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> Francis Moreau venit, vidit, dixit 19.04.2011 09:32:\n>> Hello,\n>>\n>> I'm wondering if it would be a good idea for git rebase to allow not\n>> rebasing reverted patch which are part of the rebased branch.\n>>\n>> For example I'm currently rebasing my branch 'devel' onto master. This\n>> branch have several commits and specially one called A and another one\n>> called A' which reverts A.\n>>\n>> When rebasing 'devel' branch, rebase could try to drop both A and A'.\n>>\n>> What do you think ?\n>>\n>> BTW is there a way to do this currently ?\n>\n> You can do this with \"rebase -i\" by removing A and A' from the commit\n> list (or squashing them or dealing with them in whatever way you like).\n\nOf course, but my point was to make this automatically...\n\n-- \nFrancis\n"},{"id":"166072","messageId":"4DAD52BA.5000206@op5.se","threadId":"27130","inReplyTo":"BANLkTimbSes-B8zK2a2t1Jp1v+29HdNvqw@mail.gmail.com","subject":"Re: rebasing branch with reverted patches","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2011-04-19T09:15:38Z","receivedAt":"2011-04-19T09:15:38Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"On 04/19/2011 11:09 AM, Francis Moreau wrote:\n> On Tue, Apr 19, 2011 at 10:42 AM, Michael J Gruber\n> <git@drmicha.warpmail.net>  wrote:\n>> Francis Moreau venit, vidit, dixit 19.04.2011 09:32:\n>>> Hello,\n>>>\n>>> I'm wondering if it would be a good idea for git rebase to allow not\n>>> rebasing reverted patch which are part of the rebased branch.\n>>>\n>>> For example I'm currently rebasing my branch 'devel' onto master. This\n>>> branch have several commits and specially one called A and another one\n>>> called A' which reverts A.\n>>>\n>>> When rebasing 'devel' branch, rebase could try to drop both A and A'.\n>>>\n>>> What do you think ?\n>>>\n>>> BTW is there a way to do this currently ?\n>>\n>> You can do this with \"rebase -i\" by removing A and A' from the commit\n>> list (or squashing them or dealing with them in whatever way you like).\n> \n> Of course, but my point was to make this automatically...\n> \n\nThat would be akin to removing in-code comments of why it's a bad idea\nto implement a particular solution in a particular way, and it also\nremoves the capability of reverting the revert (ie, re-doing the change)\nat a later time when stability can be sacrificed temporarily.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n\nConsidering the successes of the wars on alcohol, poverty, drugs and\nterror, I think we should give some serious thought to declaring war\non peace.\n"},{"id":"166073","messageId":"BANLkTi=2LZGdZ7+QfVbd3g9dTKEcjNwsHw@mail.gmail.com","threadId":"27130","inReplyTo":"4DAD52BA.5000206@op5.se","subject":"Re: rebasing branch with reverted patches","fromName":"Francis Moreau","fromEmail":"francis.moro@gmail.com","sentAt":"2011-04-19T09:19:27Z","receivedAt":"2011-04-19T09:19:27Z","isPatch":false,"sender":{"key":"francis.moro@gmail.com","avatar":null},"body":"On Tue, Apr 19, 2011 at 11:15 AM, Andreas Ericsson <ae@op5.se> wrote:\n>\n> That would be akin to removing in-code comments of why it's a bad idea\n> to implement a particular solution in a particular way, and it also\n> removes the capability of reverting the revert (ie, re-doing the change)\n> at a later time when stability can be sacrificed temporarily.\n\nThat's right but OTOH I use git-rebase for development stuff where all\ncorrect points you raised don't apply.\n\n-- \nFrancis\n"},{"id":"166075","messageId":"BANLkTim_QNFhChme=nxGf1_Dw8LedTS3Ag@mail.gmail.com","threadId":"27130","inReplyTo":"BANLkTimbSes-B8zK2a2t1Jp1v+29HdNvqw@mail.gmail.com","subject":"Re: rebasing branch with reverted patches","fromName":"Santi Béjar","fromEmail":"santi@agolina.net","sentAt":"2011-04-19T09:39:24Z","receivedAt":"2011-04-19T09:39:24Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Tue, Apr 19, 2011 at 11:09 AM, Francis Moreau <francis.moro@gmail.com> wrote:\n> On Tue, Apr 19, 2011 at 10:42 AM, Michael J Gruber\n> <git@drmicha.warpmail.net> wrote:\n>> Francis Moreau venit, vidit, dixit 19.04.2011 09:32:\n>>> Hello,\n>>>\n>>> I'm wondering if it would be a good idea for git rebase to allow not\n>>> rebasing reverted patch which are part of the rebased branch.\n>>>\n>>> For example I'm currently rebasing my branch 'devel' onto master. This\n>>> branch have several commits and specially one called A and another one\n>>> called A' which reverts A.\n>>>\n>>> When rebasing 'devel' branch, rebase could try to drop both A and A'.\n>>>\n>>> What do you think ?\n>>>\n>>> BTW is there a way to do this currently ?\n>>\n>> You can do this with \"rebase -i\" by removing A and A' from the commit\n>> list (or squashing them or dealing with them in whatever way you like).\n>\n> Of course, but my point was to make this automatically...\n\nYou can also change the A' commit title to \"fixup! original_title\"\nwhile reverting (there is no --fixup argument like \"git commit\" has),\nthen git rebase -i would reorder the todo file for you.\n\ngit revert gets confused by the resulting empty change but you can\n\"git rebase --continue\", or now that both are next to the other just\nremove them.\n\nHTH,\nSanti\n"},{"id":"166077","messageId":"BANLkTim9vKpp6=AwSG9pkWZrw9YKCuFS9w@mail.gmail.com","threadId":"27130","inReplyTo":"BANLkTim_QNFhChme=nxGf1_Dw8LedTS3Ag@mail.gmail.com","subject":"Re: rebasing branch with reverted patches","fromName":"Francis Moreau","fromEmail":"francis.moro@gmail.com","sentAt":"2011-04-19T10:21:45Z","receivedAt":"2011-04-19T10:21:45Z","isPatch":false,"sender":{"key":"francis.moro@gmail.com","avatar":null},"body":"Hello,\n\nOn Tue, Apr 19, 2011 at 11:39 AM, Santi Béjar <santi@agolina.net> wrote:\n>\n> You can also change the A' commit title to \"fixup! original_title\"\n> while reverting (there is no --fixup argument like \"git commit\" has),\n> then git rebase -i would reorder the todo file for you.\n\nInteresting I wasn't aware of --autosquash option, thanks.\n\nThis is almost what I was asking for actually, the only part which is\nmissing is the fact that git-rebase detect the \"Revert: \" magic\nstring, check that the revert is sane (by comparing the diff of the\nrevert with the diff of the original commit) and do the same as\n\"fixup!\" would do without the confusion of the resulting empty commit.\n\nThanks\n-- \nFrancis\n"}]}