{"thread":{"id":"13602","subject":"two git-cherry-pick enhancements","startedAt":"2008-05-21T16:38:17Z","lastAt":"2008-05-22T09:29:09Z","messageCount":4,"participants":["Nico -telmich- Schottelius","Govind Salinas","Sitaram Chamarty","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"77397","messageId":"20080521163817.GA13124@denkbrett.schottelius.org","threadId":"13602","inReplyTo":null,"subject":"two git-cherry-pick enhancements","fromName":"Nico -telmich- Schottelius","fromEmail":"nico-git-20080521@schottelius.org","sentAt":"2008-05-21T16:38:17Z","receivedAt":"2008-05-21T16:38:17Z","isPatch":false,"sender":{"key":"nico-git-20080521@schottelius.org","avatar":null},"body":"Hello!\n\nWhen using git-cherry-pick there are two things missing for me and just\nwondered how you see it (or maybe have a good solution):\n\n- Apply only parts of the patch which applies to <file ...>:\n   I sometimes want to apply patches only to some, but not all\n   files the patch introduces\n\n- Interactively selecting which parts to apply:\n   I want only 7 out of 10 changes the patch introduces.\n   It would help alot, if I could choose which parts I want\n   to apply for every part of the patch.\n\nAnything planned like that or did I oversee the right way?\n\nSincerly\n\nNico\n\nP.S.: Please CC me on reply, I am not subscribed.\n\n-- \nThink about Free and Open Source Software (FOSS).\nhttp://nico.schottelius.org/documentations/foss/the-term-foss/\n\nPGP: BFE4 C736 ABE5 406F 8F42  F7CF B8BE F92A 9885 188C\n"},{"id":"77405","messageId":"5d46db230805211136k7bf81bc0t9610fe2bb50a08b9@mail.gmail.com","threadId":"13602","inReplyTo":"20080521163817.GA13124@denkbrett.schottelius.org","subject":"Re: two git-cherry-pick enhancements","fromName":"Govind Salinas","fromEmail":"govind@sophiasuchtig.com","sentAt":"2008-05-21T18:36:29Z","receivedAt":"2008-05-21T18:36:29Z","isPatch":false,"sender":{"key":"govind@sophiasuchtig.com","avatar":null},"body":"On Wed, May 21, 2008 at 11:38 AM, Nico -telmich- Schottelius\n<nico-git-20080521@schottelius.org> wrote:\n> Hello!\n>\n> When using git-cherry-pick there are two things missing for me and just\n> wondered how you see it (or maybe have a good solution):\n>\n> - Apply only parts of the patch which applies to <file ...>:\n>   I sometimes want to apply patches only to some, but not all\n>   files the patch introduces\n>\n> - Interactively selecting which parts to apply:\n>   I want only 7 out of 10 changes the patch introduces.\n>   It would help alot, if I could choose which parts I want\n>   to apply for every part of the patch.\n>\n> Anything planned like that or did I oversee the right way?\n>\n> Sincerly\n>\n> Nico\n>\n> P.S.: Please CC me on reply, I am not subscribed.\n>\n\nYou could \"git cherry-pick --no-commit <id>\" and then \"git add -p\"\n\n-Govind\n"},{"id":"77447","messageId":"2e24e5b90805220158n5c31da1yf98cac8b432a2d9d@mail.gmail.com","threadId":"13602","inReplyTo":"20080521163817.GA13124@denkbrett.schottelius.org","subject":"Re: two git-cherry-pick enhancements","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2008-05-22T08:58:49Z","receivedAt":"2008-05-22T08:58:49Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On Wed, May 21, 2008 at 10:08 PM, Nico -telmich- Schottelius\n<nico-git-20080521@schottelius.org> wrote:\n> - Apply only parts of the patch which applies to <file ...>:\n>   I sometimes want to apply patches only to some, but not all\n>   files the patch introduces\n>\n> - Interactively selecting which parts to apply:\n>   I want only 7 out of 10 changes the patch introduces.\n>   It would help alot, if I could choose which parts I want\n>   to apply for every part of the patch.\n\nBoth of these are (often, though not always) signs that commits are\nnot granular enough.  Your branch maintainer or developer has combined\nunrelated things into one commit.  In an ideal world, he would put\neach piece as a separate commit, such that if you pick one of those\napart, it doesn't make sense.\n\nThis is also usually a sign of someone using a central VCS model (or\nmental model) on that side.\n\nUnless you have no control over who sends you these commits, you may\nwant to address that also in whatever way possible.\n\nIMO stuff like \"git add -a\" (and the GUI equivalents) were meant for\nyour own development, so that you can essentially re-write history in\na sane sequence after having worked on a complex task.\n\nRegards,\n\nSitaram\n"},{"id":"77449","messageId":"alpine.DEB.1.00.0805221026140.30431@racer","threadId":"13602","inReplyTo":"20080521163817.GA13124@denkbrett.schottelius.org","subject":"Re: two git-cherry-pick enhancements","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-05-22T09:29:09Z","receivedAt":"2008-05-22T09:29:09Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 21 May 2008, Nico -telmich- Schottelius wrote:\n\n> When using git-cherry-pick there are two things missing for me and just \n> wondered how you see it (or maybe have a good solution):\n> \n> - Apply only parts of the patch which applies to <file ...>:\n>    I sometimes want to apply patches only to some, but not all\n>    files the patch introduces\n> \n> - Interactively selecting which parts to apply:\n>    I want only 7 out of 10 changes the patch introduces.\n>    It would help alot, if I could choose which parts I want\n>    to apply for every part of the patch.\n> \n> Anything planned like that or did I oversee the right way?\n\nConceptually, this is really not cherry-picking _commits_.  For example, \nthe commit message will typically be all wrong if you pick only one \nchange.  Also, if I were the author of the original patch, I would not be \nhappy for you to label me author of the cut-down (and possibly invalid) \ncommit.\n\nTherefore I suggest (just like on IRC the other day):\n\n\tgit show <commit> -- <file(s)> | git apply\n\npossibly followed by\n\n\tgit add -i\n\nor\n\n\tgit add -p <file>\n\nHth,\nDscho\n"}]}