{"thread":{"id":"11077","subject":"how to create v2 patch","startedAt":"2007-12-01T12:41:55Z","lastAt":"2007-12-07T08:11:56Z","messageCount":10,"participants":["Tilman Schmidt","Pascal Obry","Mike Hommey","Jakub Narebski","Björn Steinbrink","Jan Hudec","Andreas Ericsson","Wincent Colaiuta"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"61575","messageId":"47515693.9070405@imap.cc","threadId":"11077","inReplyTo":null,"subject":"how to create v2 patch","fromName":"Tilman Schmidt","fromEmail":"tilman@imap.cc","sentAt":"2007-12-01T12:41:55Z","receivedAt":"2007-12-01T12:41:55Z","isPatch":false,"sender":{"key":"tilman@imap.cc","avatar":null},"body":"Let's say that following the scheme laid out in\nhttp://www.kernel.org/pub/software/scm/git/docs/everyday.html#Individual%20Developer%20(Participant)\nI have produced a patch, submitted it to LKML, received a few\ncomments, committed appropriate changes to my local git tree,\nand now want to submit a revised patch. How do I do that?\nIf I just run git-format-patch again, it produces my original\npatch plus a second one containing my updates, but what I need\nis a single new patch replacing the first one.\n\nThanks,\nTilman\n\n-- \nTilman Schmidt                          E-Mail: tilman@imap.cc\nBonn, Germany\nYes, I have searched Google!\n\n"},{"id":"61576","messageId":"47515EF3.8010507@obry.net","threadId":"11077","inReplyTo":"47515693.9070405@imap.cc","subject":"Re: how to create v2 patch","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2007-12-01T13:17:39Z","receivedAt":"2007-12-01T13:17:39Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Tilman Schmidt a écrit :\n> Let's say that following the scheme laid out in\n> http://www.kernel.org/pub/software/scm/git/docs/everyday.html#Individual%20Developer%20(Participant)\n> I have produced a patch, submitted it to LKML, received a few\n> comments, committed appropriate changes to my local git tree,\n> and now want to submit a revised patch. How do I do that?\n> If I just run git-format-patch again, it produces my original\n> patch plus a second one containing my updates, but what I need\n> is a single new patch replacing the first one.\n\nCan't you merge both of your changes in your local repository? I would\ndo that with an interactive rebase.\n\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|              http://www.obry.net\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595\n"},{"id":"61577","messageId":"20071201134321.GA10997@glandium.org","threadId":"11077","inReplyTo":"47515EF3.8010507@obry.net","subject":"Re: how to create v2 patch","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2007-12-01T13:43:21Z","receivedAt":"2007-12-01T13:43:21Z","isPatch":false,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Sat, Dec 01, 2007 at 02:17:39PM +0100, Pascal Obry wrote:\n> Tilman Schmidt a écrit :\n> > Let's say that following the scheme laid out in\n> > http://www.kernel.org/pub/software/scm/git/docs/everyday.html#Individual%20Developer%20(Participant)\n> > I have produced a patch, submitted it to LKML, received a few\n> > comments, committed appropriate changes to my local git tree,\n> > and now want to submit a revised patch. How do I do that?\n> > If I just run git-format-patch again, it produces my original\n> > patch plus a second one containing my updates, but what I need\n> > is a single new patch replacing the first one.\n> \n> Can't you merge both of your changes in your local repository? I would\n> do that with an interactive rebase.\n\nOr just git commit --amend when committing.\n\nMike\n"},{"id":"61580","messageId":"m3r6i6wm1g.fsf@roke.D-201","threadId":"11077","inReplyTo":"47515693.9070405@imap.cc","subject":"Re: how to create v2 patch","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-12-01T14:02:23Z","receivedAt":"2007-12-01T14:02:23Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Tilman Schmidt <tilman@imap.cc> writes:\n\n> Let's say that following the scheme laid out in\n> \"Everyday GIT ...\", chapter \"Individual Developer (Participant)\".\n> I have produced a patch, submitted it to LKML, received a few\n> comments, committed appropriate changes to my local git tree,\n> and now want to submit a revised patch. How do I do that?\n\nIf you have original commit and commit with corrections on top of it,\ndo a squash rebase using \"git rebase -i\" (interactive), or do a squash\nmerge.\n\nIn the future it would be better to just amend (\"git commit --amend\")\noriginal commit (or if you are using StGIT, \"stg refresh\" it).\n\n-- \nJakub Narebski\nPoland\n"},{"id":"61583","messageId":"20071201141410.GA4430@atjola.homenet","threadId":"11077","inReplyTo":"m3r6i6wm1g.fsf@roke.D-201","subject":"Re: how to create v2 patch","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2007-12-01T14:14:10Z","receivedAt":"2007-12-01T14:14:10Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2007.12.01 06:02:23 -0800, Jakub Narebski wrote:\n> Tilman Schmidt <tilman@imap.cc> writes:\n> \n> > Let's say that following the scheme laid out in\n> > \"Everyday GIT ...\", chapter \"Individual Developer (Participant)\".\n> > I have produced a patch, submitted it to LKML, received a few\n> > comments, committed appropriate changes to my local git tree,\n> > and now want to submit a revised patch. How do I do that?\n> \n> If you have original commit and commit with corrections on top of it,\n> do a squash rebase using \"git rebase -i\" (interactive), or do a squash\n> merge.\n> \n> In the future it would be better to just amend (\"git commit --amend\")\n> original commit (or if you are using StGIT, \"stg refresh\" it).\n\nFor completeness:\nTo use \"git commit --amend\" for any but the latest commit, you use\nrebase -i, too. Just change the \"pick\" for the commit you want to amend\nto \"edit\". Rebasing will stop _after_ applying that commit and you can\namend it.\n\nBjörn\n"},{"id":"62196","messageId":"475855D6.201@imap.cc","threadId":"11077","inReplyTo":"20071201134321.GA10997@glandium.org","subject":"Re: how to create v2 patch","fromName":"Tilman Schmidt","fromEmail":"tilman@imap.cc","sentAt":"2007-12-06T20:04:38Z","receivedAt":"2007-12-06T20:04:38Z","isPatch":false,"sender":{"key":"tilman@imap.cc","avatar":null},"body":"Am 01.12.2007 14:43 schrieb Mike Hommey:\n> On Sat, Dec 01, 2007 at 02:17:39PM +0100, Pascal Obry wrote:\n>> Tilman Schmidt a écrit :\n>>> I have produced a patch, submitted it to LKML, received a few\n>>> comments, committed appropriate changes to my local git tree,\n>>> and now want to submit a revised patch. How do I do that?\n>>> If I just run git-format-patch again, it produces my original\n>>> patch plus a second one containing my updates, but what I need\n>>> is a single new patch replacing the first one.\n>> Can't you merge both of your changes in your local repository? I would\n>> do that with an interactive rebase.\n> \n> Or just git commit --amend when committing.\n\nHmm. But wouldn't each of these approaches lead to my original\ncommit being removed from my git repository? And isn't removing\ncommits that have already been published strongly discouraged?\n\nThx\nT.\n\n-- \nTilman Schmidt                          E-Mail: tilman@imap.cc\nBonn, Germany\nYes, I have searched Google!\n\n"},{"id":"62198","messageId":"20071206204405.GA4216@efreet.light.src","threadId":"11077","inReplyTo":"475855D6.201@imap.cc","subject":"Re: how to create v2 patch","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2007-12-06T20:44:05Z","receivedAt":"2007-12-06T20:44:05Z","isPatch":false,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"On Thu, Dec 06, 2007 at 21:04:38 +0100, Tilman Schmidt wrote:\n> Am 01.12.2007 14:43 schrieb Mike Hommey:\n> > On Sat, Dec 01, 2007 at 02:17:39PM +0100, Pascal Obry wrote:\n> >> Tilman Schmidt a écrit :\n> >>> I have produced a patch, submitted it to LKML, received a few\n> >>> comments, committed appropriate changes to my local git tree,\n> >>> and now want to submit a revised patch. How do I do that?\n> >>> If I just run git-format-patch again, it produces my original\n> >>> patch plus a second one containing my updates, but what I need\n> >>> is a single new patch replacing the first one.\n> >> Can't you merge both of your changes in your local repository? I would\n> >> do that with an interactive rebase.\n> > \n> > Or just git commit --amend when committing.\n> \n> Hmm. But wouldn't each of these approaches lead to my original\n> commit being removed from my git repository? And isn't removing\n> commits that have already been published strongly discouraged?\n\nRemoving commits that you already published is strongly discouraged. But\npatch is not a commit. A v2 (short for 'second version') patch means a patch,\nthat should be applied /instead/ of the previous. The previous patch -- and\nthe commit it was generated from as well as any commit generated by applying\nit -- should indeed be replaced by the new version.\n\n-- \n\t\t\t\t\t\t Jan 'Bulb' Hudec <bulb@ucw.cz>\n"},{"id":"62201","messageId":"47586BC6.2020100@obry.net","threadId":"11077","inReplyTo":"475855D6.201@imap.cc","subject":"Re: how to create v2 patch","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2007-12-06T21:38:14Z","receivedAt":"2007-12-06T21:38:14Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Tilman Schmidt a écrit :\n> Hmm. But wouldn't each of these approaches lead to my original\n> commit being removed from my git repository? And isn't removing\n> commits that have already been published strongly discouraged?\n\nThey won't be removed, just changed/merged... and that's what you were\nlooking for or I did not understand your question! This is not bad\npractice as it is done on YOUR repository. Of course this should never\nbe done on a pushed/published changeset.\n\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|              http://www.obry.net\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595\n"},{"id":"62204","messageId":"4758719F.1080408@op5.se","threadId":"11077","inReplyTo":"475855D6.201@imap.cc","subject":"Re: how to create v2 patch","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2007-12-06T22:03:11Z","receivedAt":"2007-12-06T22:03:11Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Tilman Schmidt wrote:\n> Am 01.12.2007 14:43 schrieb Mike Hommey:\n>> On Sat, Dec 01, 2007 at 02:17:39PM +0100, Pascal Obry wrote:\n>>> Tilman Schmidt a écrit :\n>>>> I have produced a patch, submitted it to LKML, received a few\n>>>> comments, committed appropriate changes to my local git tree,\n>>>> and now want to submit a revised patch. How do I do that?\n>>>> If I just run git-format-patch again, it produces my original\n>>>> patch plus a second one containing my updates, but what I need\n>>>> is a single new patch replacing the first one.\n>>> Can't you merge both of your changes in your local repository? I would\n>>> do that with an interactive rebase.\n>> Or just git commit --amend when committing.\n> \n> Hmm. But wouldn't each of these approaches lead to my original\n> commit being removed from my git repository? And isn't removing\n> commits that have already been published strongly discouraged?\n> \n\nThe term \"published\" means different things for different projects.\nFor the Linux kernel, \"published\" is when your commit ends up in a\nrepository that Linus pulls from.\n\nSo long as you're getting suggestions to fix up your patch, it's\nsafe to assume it hasn't been accepted into one of those repos, and\nyou can safely --amend the offending commit(s).\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"62257","messageId":"71AAB890-A1BC-49AA-9695-9701356DB514@wincent.com","threadId":"11077","inReplyTo":"475855D6.201@imap.cc","subject":"Re: how to create v2 patch","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2007-12-07T08:11:56Z","receivedAt":"2007-12-07T08:11:56Z","isPatch":false,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 6/12/2007, a las 21:04, Tilman Schmidt escribió:\n\n> Am 01.12.2007 14:43 schrieb Mike Hommey:\n>> On Sat, Dec 01, 2007 at 02:17:39PM +0100, Pascal Obry wrote:\n>>> Tilman Schmidt a écrit :\n>>>> I have produced a patch, submitted it to LKML, received a few\n>>>> comments, committed appropriate changes to my local git tree,\n>>>> and now want to submit a revised patch. How do I do that?\n>>>> If I just run git-format-patch again, it produces my original\n>>>> patch plus a second one containing my updates, but what I need\n>>>> is a single new patch replacing the first one.\n>>> Can't you merge both of your changes in your local repository? I  \n>>> would\n>>> do that with an interactive rebase.\n>>\n>> Or just git commit --amend when committing.\n>\n> Hmm. But wouldn't each of these approaches lead to my original\n> commit being removed from my git repository?\n\nNot immediately, but eventually. Let's say you have a history like this:\n\nA--B--C--D\n\nAnd you amend commit D to become D':\n\nA--B--C--D'\n        \\\n         D\n\nYou effectively have two \"branches\" now, but one of them (the original  \nD) is unreferenced and will eventually be garbage collected. In other  \nwords, your ongoing development will look like this:\n\nA--B--C--D'-E--F--G\n        \\\n         D\n\nAt this point the only thing which references commit D will be your  \nreflog, and with default settings that means that the commit will hang  \naround for at least 90 more days before being pruned during garbage  \ncollection.\n\n> And isn't removing\n> commits that have already been published strongly discouraged?\n\nYes, normally that statement is true (because someone else may have  \nbased work on top of \"D\" and if you delete \"D\" then you just pulled  \nthe rug out from under them). But as others have pointed out, posting  \na PATCH to a mailing list isn't the same thing as \"publishing a  \ncommit\", so I won't repeat what's already been explained.\n\nIf, however, you really had *published* the commit (ie. pushed it out  \nto an accessible repository) then you'd want to use \"git revert\"  \nrather than \"git commit --amend\".\n\nA--B--C--D--D'--E--F\n\nReverting doesn't delete any commits at all; instead it introduces a  \nnew commit (D') which undoes the change introduced in D. So you're  \nundoing the *effect* of D without actually \"undoing\" the fact that you  \ncommitted and published it.\n\nCheers,\nWincent\n"}]}