{"thread":{"id":"25886","subject":"Forward-port a patch using git","startedAt":"2010-12-01T15:37:14Z","lastAt":"2010-12-01T18:16:26Z","messageCount":3,"participants":["Spelic","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"156950","messageId":"4CF66BAA.1010203@shiftmail.org","threadId":"25886","inReplyTo":null,"subject":"Forward-port a patch using git","fromName":"Spelic","fromEmail":"spelic@shiftmail.org","sentAt":"2010-12-01T15:37:14Z","receivedAt":"2010-12-01T15:37:14Z","isPatch":false,"sender":{"key":"spelic@shiftmail.org","avatar":null},"body":"Hi all\nI have patches (xyz.patch files) which apply cleanly to kernel 2.6.36 \nand 2.6.36.1 and do not apply cleanly on 2.6.37-rc4 (I mean they do \napply but with massive offsets...)\nI would like to forward-port them to 2.6.37-rc4, i.e. create equivalent \npatch files that would apply cleanly on 2.6.37-rc4 with zero offsets.\n\nI have thought that there should be some git mechanism to confirm that \nsuch massive offsets which \"patch\" sees are actually correct and not \nfalse-positives, and are caused by the commits from 2.6.36 to \n2.6.37-rc4. There should be some mechanism in git to track line shifts \nin source files caused by commits...\nAfter confirming this, Git should create for me equivalent patch files \nthat apply cleanly to 2.6.37-rc4 that I can give to other people.\n\nIs it possible? I am unfortunately a newbie with git. Can you help me?\n\nThank you\nPS: I have downloaded the linux-2.6-stable git repository containing all \nneeded revisions: v2.6.36, v2.6.36.1 and v2.6.37 .\n"},{"id":"156973","messageId":"4CF68FCB.2030301@shiftmail.org","threadId":"25886","inReplyTo":"4CF66BAA.1010203@shiftmail.org","subject":"Re: Forward-port a patch using git","fromName":"Spelic","fromEmail":"spelic@shiftmail.org","sentAt":"2010-12-01T18:11:23Z","receivedAt":"2010-12-01T18:11:23Z","isPatch":false,"sender":{"key":"spelic@shiftmail.org","avatar":null},"body":"On 12/01/2010 04:37 PM, Spelic wrote:\n> Hi all\n> I have patches (xyz.patch files) which apply cleanly to kernel 2.6.36 \n> and 2.6.36.1 and do not apply cleanly on 2.6.37-rc4 (I mean they do \n> apply but with massive offsets...)\n> I would like to forward-port them to 2.6.37-rc4, i.e. create \n> equivalent patch files that would apply cleanly on 2.6.37-rc4 with \n> zero offsets.\n>\n\nI found it myself, sorry for having asked.\n\nIt was:\n\ncheckout v2.6.36\napply 1 patch\ncommit\napply 1 patch\ncommit\n...\nrebase v2.6.37-rc4\ngit format-patch -o <destdir> -numpatches\n"},{"id":"156975","messageId":"20101201181626.GD7774@sigill.intra.peff.net","threadId":"25886","inReplyTo":"4CF68FCB.2030301@shiftmail.org","subject":"Re: Forward-port a patch using git","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-12-01T18:16:26Z","receivedAt":"2010-12-01T18:16:26Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Dec 01, 2010 at 07:11:23PM +0100, Spelic wrote:\n\n> I found it myself, sorry for having asked.\n> \n> It was:\n> \n> checkout v2.6.36\n\nBe aware that checking out the v2.6.36 tag will mean you are not on any\nbranch. So this will work fine:\n\n> apply 1 patch\n> commit\n> apply 1 patch\n> commit\n> ...\n> rebase v2.6.37-rc4\n> git format-patch -o <destdir> -numpatches\n\nBut at the end, you will not have any branch tip pointing to your\nrebased work. If all you want are the patches as output, then that's\nfine. But you may want to do:\n\n  git checkout -b some-useful-name v2.6.36\n\nas the first step instead, which means you can come back to your rebased\nwork later as \"some-useful-name\".\n\n-Peff\n"}]}