{"thread":{"id":"8088","subject":"kernel cherry UN-picking?","startedAt":"2007-05-11T21:31:14Z","lastAt":"2007-05-15T02:39:41Z","messageCount":9,"participants":["Jeff Garzik","Andrew Morton","Junio C Hamano","Jan Harkes","Josef Sipek"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"41861","messageId":"4644E0A2.90008@garzik.org","threadId":"8088","inReplyTo":null,"subject":"kernel cherry UN-picking?","fromName":"Jeff Garzik","fromEmail":"jeff@garzik.org","sentAt":"2007-05-11T21:31:14Z","receivedAt":"2007-05-11T21:31:14Z","isPatch":false,"sender":{"key":"jeff@garzik.org","avatar":null},"body":"So, I merge the next batch of net driver patches.  After I merge a PPP \npatch, deep in the pile-o-patches, Andrew says \"I shouldn't have sent \nthat to you, don't apply it\"  ;-)\n\nRight now, my process for reversing this damage is to start over: \ncreate a new branch, manually double-click the mouse on each commit in \nthe \"damaged\" branch, and git-cherrypick it.  Very, very time consuming \nwhen you have more than a couple commits.\n\nIs there a better way?\nIs there any way to say \"cherrypick all commits except <these>\"?\n\n\tJeff\n"},{"id":"41862","messageId":"20070511145509.09f3c354.akpm@linux-foundation.org","threadId":"8088","inReplyTo":"4644E0A2.90008@garzik.org","subject":"Re: kernel cherry UN-picking?","fromName":"Andrew Morton","fromEmail":"akpm@linux-foundation.org","sentAt":"2007-05-11T21:55:09Z","receivedAt":"2007-05-11T21:55:09Z","isPatch":false,"sender":{"key":"akpm@linux-foundation.org","avatar":null},"body":"On Fri, 11 May 2007 17:31:14 -0400\nJeff Garzik <jeff@garzik.org> wrote:\n\n> So, I merge the next batch of net driver patches.  After I merge a PPP \n> patch, deep in the pile-o-patches, Andrew says \"I shouldn't have sent \n> that to you, don't apply it\"  ;-)\n\nI'm bad.\n\n> Right now, my process for reversing this damage is to start over: \n> create a new branch, manually double-click the mouse on each commit in \n> the \"damaged\" branch, and git-cherrypick it.  Very, very time consuming \n> when you have more than a couple commits.\n> \n> Is there a better way?\n> Is there any way to say \"cherrypick all commits except <these>\"?\n\nLet me refactor your question more usefully.  What we want is quilt-export\nand quilt-import.  And I really mean that: commands called git-quilt-export\nand git-quilt-import.\n\ncoz then, your problem becomes\n\n\tgit-quilt-export\n\t<delete one line from the series file>\n\tgit-quilt-import\n\n\nBecause git-quilt-export and git-quilt-import would be useful for lots of\nother things.\n"},{"id":"41863","messageId":"7vhcqj9g8r.fsf@assigned-by-dhcp.cox.net","threadId":"8088","inReplyTo":"4644E0A2.90008@garzik.org","subject":"Re: kernel cherry UN-picking?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-11T21:56:20Z","receivedAt":"2007-05-11T21:56:20Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff Garzik <jeff@garzik.org> writes:\n\n> So, I merge the next batch of net driver patches.  After I merge a PPP\n> patch, deep in the pile-o-patches, Andrew says \"I shouldn't have sent\n> that to you, don't apply it\"  ;-)\n>\n> Right now, my process for reversing this damage is to start over:\n> create a new branch, manually double-click the mouse on each commit in\n> the \"damaged\" branch, and git-cherrypick it.  Very, very time\n> consuming when you have more than a couple commits.\n\nDo the commits on the branch being rebuilt form a single strand\nof pearls without any merges?  If that is the case, what I would\ndo is:\n\n\tgit heckout thatbranch\n\tgit format-patch -o ./+outdir linus\n        rm ./+outdir/0XXX-that-unwanted-patch.patch\n        git reset --hard linus\n        git am ./+outdir/????-*.patch\n"},{"id":"41864","messageId":"4644E6AA.9050908@garzik.org","threadId":"8088","inReplyTo":"20070511145509.09f3c354.akpm@linux-foundation.org","subject":"Re: kernel cherry UN-picking?","fromName":"Jeff Garzik","fromEmail":"jeff@garzik.org","sentAt":"2007-05-11T21:56:58Z","receivedAt":"2007-05-11T21:56:58Z","isPatch":false,"sender":{"key":"jeff@garzik.org","avatar":null},"body":"Andrew Morton wrote:\n> On Fri, 11 May 2007 17:31:14 -0400\n> Jeff Garzik <jeff@garzik.org> wrote:\n> \n>> So, I merge the next batch of net driver patches.  After I merge a PPP \n>> patch, deep in the pile-o-patches, Andrew says \"I shouldn't have sent \n>> that to you, don't apply it\"  ;-)\n> \n> I'm bad.\n\nYou're just an example.  This is a problem guaranteed to appear...\n\n\n>> Right now, my process for reversing this damage is to start over: \n>> create a new branch, manually double-click the mouse on each commit in \n>> the \"damaged\" branch, and git-cherrypick it.  Very, very time consuming \n>> when you have more than a couple commits.\n>>\n>> Is there a better way?\n>> Is there any way to say \"cherrypick all commits except <these>\"?\n> \n> Let me refactor your question more usefully.  What we want is quilt-export\n> and quilt-import.  And I really mean that: commands called git-quilt-export\n> and git-quilt-import.\n> \n> coz then, your problem becomes\n> \n> \tgit-quilt-export\n> \t<delete one line from the series file>\n> \tgit-quilt-import\n\nDoesn't work when I've pulled git trees from Linville...\n\n\tJeff\n"},{"id":"41866","messageId":"7vbqgr9fn9.fsf@assigned-by-dhcp.cox.net","threadId":"8088","inReplyTo":"7vhcqj9g8r.fsf@assigned-by-dhcp.cox.net","subject":"Re: kernel cherry UN-picking?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-11T22:09:14Z","receivedAt":"2007-05-11T22:09:14Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> Jeff Garzik <jeff@garzik.org> writes:\n>\n>> So, I merge the next batch of net driver patches.  After I merge a PPP\n>> patch, deep in the pile-o-patches, Andrew says \"I shouldn't have sent\n>> that to you, don't apply it\"  ;-)\n>>\n>> Right now, my process for reversing this damage is to start over:\n>> create a new branch, manually double-click the mouse on each commit in\n>> the \"damaged\" branch, and git-cherrypick it.  Very, very time\n>> consuming when you have more than a couple commits.\n>\n> Do the commits on the branch being rebuilt form a single strand\n> of pearls without any merges?  If that is the case, what I would\n> do is:\n>\n> \tgit heckout thatbranch\n> \tgit format-patch -o ./+outdir linus\n>         rm ./+outdir/0XXX-that-unwanted-patch.patch\n>         git reset --hard linus\n>         git am ./+outdir/????-*.patch\n\nOk, you answered that your branch involves a merge from Linville\ntree.\n\nYou would need to segment things then.\n\nSuppose you have something like this (you may have more than one\nsuch merge but the principle is the same):\n\n  U---o---o---o---M---x---o---o---o---T\n                 /\n   Linville o---o\n\nUp to 'U' you have already sent upstream and no need for\nresending.  'M' is merge with Linville tree.  'x' is the bad\none, and 'o' are good ones.  'T' is the tip of your net driver\nbranch.\n\nFirst find out 'x'.  Then\n\n        git format-patch -o ./outdir x..T\n\nwould format everything starting from (but excluding) 'x' up to\n'T'.\n\nThen\n\n        git reset --hard x^\n        git am ./outdir/*.patch\n\nwould rebuild:\n\n  U---o---o---o---M---x---o'--o'--o'--T'\n                 /\n   Linville o---o\n\n\nA variant that needs \"segmenting\" is if the bad one is before\nthe merge, like this:\n\n  U---o---x---b---M---o---o---o---o---T\n                 /\n   Linville o---a\n\nFirst you need to note 'a' (tip of Linville you pulled) and 'b'\n(tip of you before you pulled from Linville).  Then:\n\n        git format-patch -o ./outdir-1 x..b\n        git format-patch -o ./outdir-2 M..T\n        git reset --hard x^\n        git am ./outdir-1/*.patch\n\nwould give you this:\n\n\n  U---o-------b'\n                 \n   Linville o---a\n\nand leave you at b (rebased not to contain the bad one).  Then\nyou redo the Linville merge:\n\n  U---o-------b'--M'\n                 /\n   Linville o---a\n\nAnd finally apply the rest:\n\n        git am ./outdir-2/*.patch\n\nto arrive at:\n\n  U---o-------b'--M'--o'--o'--o'--o'--T'\n                 /\n   Linville o---a\n"},{"id":"41867","messageId":"7v7irf9fjc.fsf@assigned-by-dhcp.cox.net","threadId":"8088","inReplyTo":"7vbqgr9fn9.fsf@assigned-by-dhcp.cox.net","subject":"Re: kernel cherry UN-picking?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-11T22:11:35Z","receivedAt":"2007-05-11T22:11:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> Suppose you have something like this (you may have more than one\n> such merge but the principle is the same):\n>\n>   U---o---o---o---M---x---o---o---o---T\n>                  /\n>    Linville o---o\n>\n> Up to 'U' you have already sent upstream and no need for\n> resending.  'M' is merge with Linville tree.  'x' is the bad\n> one, and 'o' are good ones.  'T' is the tip of your net driver\n> branch.\n>\n> First find out 'x'.  Then\n>\n>         git format-patch -o ./outdir x..T\n>\n> would format everything starting from (but excluding) 'x' up to\n> 'T'.\n>\n> Then\n>\n>         git reset --hard x^\n>         git am ./outdir/*.patch\n>\n> would rebuild:\n>\n>   U---o---o---o---M---x---o'--o'--o'--T'\n>                  /\n>    Linville o---o\n\nCorrection.  This would rebuild:\n\n    U---o---o---o---M-------o'--o'--o'--T'\n                   /\n     Linville o---o\n\nas if 'x' did not happen.\n"},{"id":"41919","messageId":"20070512133951.GE12121@delft.aura.cs.cmu.edu","threadId":"8088","inReplyTo":"7vbqgr9fn9.fsf@assigned-by-dhcp.cox.net","subject":"Re: kernel cherry UN-picking?","fromName":"Jan Harkes","fromEmail":"jaharkes@cs.cmu.edu","sentAt":"2007-05-12T13:39:51Z","receivedAt":"2007-05-12T13:39:51Z","isPatch":false,"sender":{"key":"jaharkes@cs.cmu.edu","avatar":"https://gravatar.com/avatar/cf95aecd150ca8ef33d6edc337ac4bb9e13aa4246fc3679257d578c7fddc1633?d=mp&s=160"},"body":"On Fri, May 11, 2007 at 03:09:14PM -0700, Junio C Hamano wrote:\n> Suppose you have something like this (you may have more than one\n> such merge but the principle is the same):\n> \n>   U---o---o---o---M---x---o---o---o---T\n>                  /\n>    Linville o---o\n> \n> Up to 'U' you have already sent upstream and no need for\n> resending.  'M' is merge with Linville tree.  'x' is the bad\n> one, and 'o' are good ones.  'T' is the tip of your net driver\n> branch.\n\nThere are even more ways to fix this up, they both start with\nidentifying the commit 'y' that was committed after 'x',\n\n    git rebase --onto x^ y T\n\nThe other solution is to use .git/info/grafts,\n\n    Add a line with the sha1 of 'y' with the parents of 'x'. You can\n    visually inspect with gitk if it looks right and then use a script\n    that rewrites the history. Either cg-admin-rewrite or the one I\n    posted to the list a while ago.\n\nThe history rewriting solution will work even if 'x' was introduced\nbefore the merge commit.\n\nJan\n"},{"id":"41922","messageId":"20070512140117.GF12121@delft.aura.cs.cmu.edu","threadId":"8088","inReplyTo":"20070512133951.GE12121@delft.aura.cs.cmu.edu","subject":"Re: kernel cherry UN-picking?","fromName":"Jan Harkes","fromEmail":"jaharkes@cs.cmu.edu","sentAt":"2007-05-12T14:01:17Z","receivedAt":"2007-05-12T14:01:17Z","isPatch":false,"sender":{"key":"jaharkes@cs.cmu.edu","avatar":"https://gravatar.com/avatar/cf95aecd150ca8ef33d6edc337ac4bb9e13aa4246fc3679257d578c7fddc1633?d=mp&s=160"},"body":"On Sat, May 12, 2007 at 09:39:51AM -0400, Jan Harkes wrote:\n> On Fri, May 11, 2007 at 03:09:14PM -0700, Junio C Hamano wrote:\n> > Suppose you have something like this (you may have more than one\n> > such merge but the principle is the same):\n> > \n> >   U---o---o---o---M---x---o---o---o---T\n> >                  /\n> >    Linville o---o\n> > \n> > Up to 'U' you have already sent upstream and no need for\n> > resending.  'M' is merge with Linville tree.  'x' is the bad\n> > one, and 'o' are good ones.  'T' is the tip of your net driver\n> > branch.\n> \n> There are even more ways to fix this up, they both start with\n> identifying the commit 'y' that was committed after 'x',\n> \n>     git rebase --onto x^ y T\n> \n> The other solution is to use .git/info/grafts,\n> \n>     Add a line with the sha1 of 'y' with the parents of 'x'. You can\n>     visually inspect with gitk if it looks right and then use a script\n>     that rewrites the history. Either cg-admin-rewrite or the one I\n>     posted to the list a while ago.\n> \n> The history rewriting solution will work even if 'x' was introduced\n> before the merge commit.\n\nMy brain must be fried. history rewriting is not a good solution here.\nAlthough it removes the commit message, it would leave the bad change\naround because it leaves the actual trees intact.\n\nJan\n"},{"id":"42183","messageId":"20070515023941.GA20340@filer.fsl.cs.sunysb.edu","threadId":"8088","inReplyTo":"20070511145509.09f3c354.akpm@linux-foundation.org","subject":"Re: kernel cherry UN-picking?","fromName":"Josef Sipek","fromEmail":"jsipek@fsl.cs.sunysb.edu","sentAt":"2007-05-15T02:39:41Z","receivedAt":"2007-05-15T02:39:41Z","isPatch":false,"sender":{"key":"jsipek@fsl.cs.sunysb.edu","avatar":null},"body":"On Fri, May 11, 2007 at 02:55:09PM -0700, Andrew Morton wrote:\n> On Fri, 11 May 2007 17:31:14 -0400\n> Jeff Garzik <jeff@garzik.org> wrote:\n> \n> > So, I merge the next batch of net driver patches.  After I merge a PPP \n> > patch, deep in the pile-o-patches, Andrew says \"I shouldn't have sent \n> > that to you, don't apply it\"  ;-)\n> \n> I'm bad.\n> \n> > Right now, my process for reversing this damage is to start over: \n> > create a new branch, manually double-click the mouse on each commit in \n> > the \"damaged\" branch, and git-cherrypick it.  Very, very time consuming \n> > when you have more than a couple commits.\n> > \n> > Is there a better way?\n> > Is there any way to say \"cherrypick all commits except <these>\"?\n> \n> Let me refactor your question more usefully.  What we want is quilt-export\n> and quilt-import.  And I really mean that: commands called git-quilt-export\n> and git-quilt-import.\n> \n> coz then, your problem becomes\n> \n> \tgit-quilt-export\n> \t<delete one line from the series file>\n> \tgit-quilt-import\n\n<shameless plug>\n\nYou can use Guilt:\n\n$ guilt-init\n$ guilt-import-commit <the bad commit hash>^..\n$ $EDITOR .git/patches/$branch/series\n\t# remove the offending line from the series file\n$ guilt-push -a\n$ rm -rf .git/patches/$branch\n\n</shameless plug>\n\n\nJosef \"Jeff\" Sipek.\n\n-- \nAll science is either physics or stamp collecting.\n\t\t- Ernest Rutherford\n"}]}