{"thread":{"id":"52779","subject":"Develop a patch series with git?","startedAt":"2020-02-11T09:22:23Z","lastAt":"2020-02-12T09:02:31Z","messageCount":4,"participants":["Steve Keller","Shourya Shukla","Jeff King","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"391524","messageId":"trinity-f39d7ed5-e4c9-45fe-944c-b5cb101cfdcd-1581412940557@3c-app-gmx-bap62","threadId":"52779","inReplyTo":null,"subject":"Develop a patch series with git?","fromName":"Steve Keller","fromEmail":"keller.steve@gmx.de","sentAt":"2020-02-11T09:22:20Z","receivedAt":"2020-02-11T09:22:23Z","isPatch":false,"sender":{"key":"keller.steve@gmx.de","avatar":null},"body":"I wonder how git supports developing a series of small patches.  In my\nusual development I go back and forth along a series of patches before\nI can commit them all.  I use quilt for that.\n\nSay I want to add feature FOO and start a patch \"FOO\" editing some\nsource file.  In the process of doing so I realize that I need an\nextension of some function to base my patch on, so I do \"quilt pop\" to\nundo patch FOO and insert a new patch BAR and then re-apply FOO by\ncalling quilt push.  No I can use the new extension from BAR in my\ncurrent patch FOO.  The patch series often contains quite a number of\npatches and I push, pop, and edit these patches quite often.  Only\nwhen everything is done I use git commit all the patches into the\nrepository.\n\nMy question is whether there is git functionality to replace quilt.\nOr is the combination of quilt and git common?\n\nSteve\n\n"},{"id":"391526","messageId":"20200211134022.7975-1-shouryashukla.oo@gmail.com","threadId":"52779","inReplyTo":"trinity-f39d7ed5-e4c9-45fe-944c-b5cb101cfdcd-1581412940557@3c-app-gmx-bap62","subject":"Re: Develop a patch series with git?","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-02-11T13:40:22Z","receivedAt":"2020-02-11T13:40:38Z","isPatch":false,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"Hello Steve,\n\n> My question is whether there is git functionality to replace quilt.\n> Or is the combination of quilt and git common?\n\nI think we can use interactive rebase[1] as well as 'git am'[2] (am = apply mail)\nto apply a series of patches from a mailbox.\n\nIn the case of, let's say a dependency missing on your end, you can do an\ninteractive rebase using 'git rebase -i' to edit your _mini-commits_ which\nyou will be making on applying the patches to include the dependencies. One\ncan also 'squash' commits together(i.e. meld multiple commits into one) in\ncase you want a smaller commit history or you think there is a redundancy in\nany of your commits.\n\nBTW, I think that 'git quiltimport' is quite old now right? And maybe even\nobsolete?\n\nBest,\nShourya Shukla\n\n[1]: https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History\n[2]: https://git-scm.com/docs/git-am\n"},{"id":"391574","messageId":"20200211200044.GG2127797@coredump.intra.peff.net","threadId":"52779","inReplyTo":"trinity-f39d7ed5-e4c9-45fe-944c-b5cb101cfdcd-1581412940557@3c-app-gmx-bap62","subject":"Re: Develop a patch series with git?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-02-11T20:00:44Z","receivedAt":"2020-02-11T20:00:47Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 11, 2020 at 10:22:20AM +0100, Steve Keller wrote:\n\n> I wonder how git supports developing a series of small patches.  In my\n> usual development I go back and forth along a series of patches before\n> I can commit them all.  I use quilt for that.\n> \n> Say I want to add feature FOO and start a patch \"FOO\" editing some\n> source file.  In the process of doing so I realize that I need an\n> extension of some function to base my patch on, so I do \"quilt pop\" to\n> undo patch FOO and insert a new patch BAR and then re-apply FOO by\n> calling quilt push.  No I can use the new extension from BAR in my\n> current patch FOO.  The patch series often contains quite a number of\n> patches and I push, pop, and edit these patches quite often.  Only\n> when everything is done I use git commit all the patches into the\n> repository.\n> \n> My question is whether there is git functionality to replace quilt.\n> Or is the combination of quilt and git common?\n\nAnother responder mentioned \"rebase -i\", which is the most direct\nequivalent. But on a smaller scale, also look at \"git add -p\", which\nlets you selectively stage hunks for commit.\n\nSo quite often my flow is something like:\n\n  1. Messy writing and refactoring, while I get a handle on what my\n     changes are going to be.\n\n  2. \"git add -p\" to pull out some hunks related to refactoring, then\n     \"git commit\" to give it a rough commit message.\n\n  3. Repeat step 2 (with maybe some more step 1 in between) as necessary\n     until you have a sequence of rough patches.\n\n  4. Revisit each patch individually with \"rebase -i\", possibly\n     re-ordering, fixing bugs, fleshing out commit messages, etc.\n     Another useful tool here is:\n\n       git rebase -x \"make test\"\n\n     which makes sure that the intermediate steps are all correct.\n\n-Peff\n"},{"id":"391598","messageId":"nycvar.QRO.7.76.6.2002121000500.3718@tvgsbejvaqbjf.bet","threadId":"52779","inReplyTo":"20200211200044.GG2127797@coredump.intra.peff.net","subject":"Re: Develop a patch series with git?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-02-12T09:02:09Z","receivedAt":"2020-02-12T09:02:31Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 11 Feb 2020, Jeff King wrote:\n\n> On Tue, Feb 11, 2020 at 10:22:20AM +0100, Steve Keller wrote:\n>\n> > I wonder how git supports developing a series of small patches.  In my\n> > usual development I go back and forth along a series of patches before\n> > I can commit them all.  I use quilt for that.\n> >\n> > Say I want to add feature FOO and start a patch \"FOO\" editing some\n> > source file.  In the process of doing so I realize that I need an\n> > extension of some function to base my patch on, so I do \"quilt pop\" to\n> > undo patch FOO and insert a new patch BAR and then re-apply FOO by\n> > calling quilt push.  No I can use the new extension from BAR in my\n> > current patch FOO.  The patch series often contains quite a number of\n> > patches and I push, pop, and edit these patches quite often.  Only\n> > when everything is done I use git commit all the patches into the\n> > repository.\n> >\n> > My question is whether there is git functionality to replace quilt.\n> > Or is the combination of quilt and git common?\n>\n> Another responder mentioned \"rebase -i\", which is the most direct\n> equivalent.\n\nI think the most direct equivalent is `guilt`:\nhttps://repo.or.cz/w/guilt.git\n\nThere haven't been any patches since May 2018 which either means that the\nproject is dead or that it is so robust that no changes are necessary\nanymore.\n\nCiao,\nJohannes\n"}]}