{"thread":{"id":"13045","subject":"Creating a patch set with git-format-patch","startedAt":"2008-04-10T08:51:59Z","lastAt":"2008-04-10T11:55:23Z","messageCount":4,"participants":["Ian Brown","Björn Steinbrink","Sean Estabrooks","Stephan Beyer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"74047","messageId":"d0383f90804100151s6ffde16al6035116c27c9cb3a@mail.gmail.com","threadId":"13045","inReplyTo":null,"subject":"Creating a patch set with git-format-patch","fromName":"Ian Brown","fromEmail":"ianbrn@gmail.com","sentAt":"2008-04-10T08:51:59Z","receivedAt":"2008-04-10T08:51:59Z","isPatch":false,"sender":{"key":"ianbrn@gmail.com","avatar":null},"body":"Hello,\n  I have a question regarding creating a patch set with git-format-patch:\nI had downloaded a git repository of the Linux kernel.\n\nI intend to  make a change in two files: net/ipv4/route.c and\ninclude/net/dst.h and send a\npatch set of two patches for review.\nNow I want to create this  patch set of two pathces correctly;\nFirst patch for net/ipv4/route.c and second for include/net/dst.h.\n\nwhat should I do ?\n\nRegards,\nIan\n"},{"id":"74053","messageId":"20080410105610.GB29742@atjola.homenet","threadId":"13045","inReplyTo":"d0383f90804100151s6ffde16al6035116c27c9cb3a@mail.gmail.com","subject":"Re: Creating a patch set with git-format-patch","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2008-04-10T10:56:10Z","receivedAt":"2008-04-10T10:56:10Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2008.04.10 11:51:59 +0300, Ian Brown wrote:\n> Hello,\n>   I have a question regarding creating a patch set with git-format-patch:\n> I had downloaded a git repository of the Linux kernel.\n> \n> I intend to  make a change in two files: net/ipv4/route.c and\n> include/net/dst.h and send a\n> patch set of two patches for review.\n> Now I want to create this  patch set of two pathces correctly;\n> First patch for net/ipv4/route.c and second for include/net/dst.h.\n> \n> what should I do ?\n\nJust create a branch for you work, then start working and creating\ncommits. In the end, you'll get one patch for each commit, so group your\nwork in the commits just as you want it to appear in the patches.\n\nThen, create the patches with:\ngit format-patch <options> master\n\nThat will create patches for all commits that are in your branch, but\nnot in master. Finally, you can use either git send-email or your\nfavourite mbox-capable MUA to send the patches.\n\nHTH\nBjörn\n"},{"id":"74054","messageId":"BAYC1-PASMTP020D4804B5CBAC8A5BEBD5AEEC0@CEZ.ICE","threadId":"13045","inReplyTo":"d0383f90804100151s6ffde16al6035116c27c9cb3a@mail.gmail.com","subject":"Re: Creating a patch set with git-format-patch","fromName":"Sean Estabrooks","fromEmail":"seanlkml@sympatico.ca","sentAt":"2008-04-10T10:56:38Z","receivedAt":"2008-04-10T10:56:38Z","isPatch":false,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Thu, 10 Apr 2008 11:51:59 +0300\n\"Ian Brown\" <ianbrn@gmail.com> wrote:\n\nHi Ian,\n\n> I intend to  make a change in two files: net/ipv4/route.c and\n> include/net/dst.h and send a patch set of two patches for review.\n> Now I want to create this  patch set of two pathces correctly;\n> First patch for net/ipv4/route.c and second for include/net/dst.h.\n> \n> what should I do ?\n\nThe first step is to edit route.c and commit your change to Git with a complete\ndescription[1].  Then edit the dst.h file and commit that to Git as a separate\nchange.  Afterward you can use git format-patch to prepare these commits to\nbe emailed:\n\n$  git format-patch HEAD^^\n\nThis tells Git to create a\t text file in the current directory for each commit made\nsince the reference you pass.   You can then configure git send-email[2] to send\nthese text files out, or send them manually with your regular email client.  If you\ndo send them manually, make sure to include the text file inline in your email,\ndon't send it as an attachment.  You will find a subject line inside the file you can\ncut-and-paste into place, and  a few other headers that you'll need to delete.\n\nHTH,\nSean\n\n[1]  Remember that each commit log entry should be made as a one-line overview,\nfollowed by a blank line, followed by as much prose as it takes to fully explain the\nchange.\n\n[2]  There is a small section about configuring git-send-email for use with gmail\nusing msmtp here:  http://git.or.cz/gitwiki/GitTips\n"},{"id":"74060","messageId":"20080410115523.GD8157@leksak.fem-net","threadId":"13045","inReplyTo":"20080410105610.GB29742@atjola.homenet","subject":"Re: Creating a patch set with git-format-patch","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-04-10T11:55:23Z","receivedAt":"2008-04-10T11:55:23Z","isPatch":false,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\n> Just create a branch for you work, then start working and creating\n> commits.\n> [...]\n\nI've got a further question on that \"patch-based\" workflow because the \ndocumentation always stops at \"send the patch\".\n\nCase 1:\n Assume your patch series get accepted.\n What to do with your local changes branch, say \"my-changes\"?\n Keeping it would result in a lot of dead branches after a while.\n\n So, I guess \"git branch -D my-changes\" is the cleanest way to go,\n but I'm not sure.\n\nCase 2:\n Assume your patch series is not accepted but some patches\n are discussed and need some further work.\n What to do?[1]\n\n I guess the right way is (after updating master) to rebase--interactive\n the my-changes branch to the master and \"edit\" every commit that\n need further changes. After the rebase with all changes has finished,\n format-patch and re-send the interesting patches \n (or format-patch the whole my-changes branch down to master and re-send\n  only the changed patches)...\n\nAre my guesses \"right\" for the two cases? Comments?\n\nRegards,\n Stephan\n\nFootnotes:\n  1. Yes, there is step (3) of \"An ideal patch flow\" in\n     http://git.kernel.org/?p=git/git.git;a=blob;f=Documentation/SubmittingPatches\n     but it does not suggest steps how to \"polish\" and \"refine\".\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"}]}