{"thread":{"id":"9692","subject":"Mixing cherry-pick and merge","startedAt":"2007-08-29T12:05:55Z","lastAt":"2007-08-29T13:22:32Z","messageCount":3,"participants":["Michel Marti","Karl Hasselström","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"51810","messageId":"46D56123.4030307@objectxp.com","threadId":"9692","inReplyTo":null,"subject":"Mixing cherry-pick and merge","fromName":"Michel Marti","fromEmail":"mma@objectxp.com","sentAt":"2007-08-29T12:05:55Z","receivedAt":"2007-08-29T12:05:55Z","isPatch":false,"sender":{"key":"mma@objectxp.com","avatar":null},"body":"I just merged from a branch from which I previously cherry-picked some commits and now the\nlog contains the already cherry-picked commits twice (which is rather confusing). Is this\na bug or a feature?\n\nSteps to reproduce:\n\nmkdir foo && cd foo\ngit init\necho 123 >file\ngit add file\ngit commit -m \"init\"\ngit checkout -b branch\necho 321 >file\ngit commit -a -m \"commit from branch\"\n=> Created commit 531fa08: commit from branch\ngit checkout master\ngit cherry-pick 531fa08\ngit merge branch\ngit-log --pretty=oneline\ne5e8011c1ab7c9b8509604d27327b29fd1f7003a Merge branch 'branch'\nad91b39e433228809eb3cd6281cb686bf4871da0 commit from branch\n531fa081d93249288efb70e9e8204e4ed9d70099 commit from branch\nbc0a5bca29620eccd5b75e473d102317d8ce29f7 init\n"},{"id":"51814","messageId":"20070829131439.GA31212@diana.vm.bytemark.co.uk","threadId":"9692","inReplyTo":"46D56123.4030307@objectxp.com","subject":"Re: Mixing cherry-pick and merge","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-08-29T13:14:39Z","receivedAt":"2007-08-29T13:14:39Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-08-29 14:05:55 +0200, Michel Marti wrote:\n\n> I just merged from a branch from which I previously cherry-picked\n> some commits and now the log contains the already cherry-picked\n> commits twice (which is rather confusing). Is this a bug or a\n> feature?\n\nIt's an inevitable consequence of git's design. When you cherry-pick a\ncommit, you create a (maybe slightly modified) copy of it with\ndifferent ancestry. If you then merge a branch that contains the\noriginal commit, you will get both the original and the copy as\nancestors of your new merge commit.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"51817","messageId":"Pine.LNX.4.64.0708291422020.28586@racer.site","threadId":"9692","inReplyTo":"20070829131439.GA31212@diana.vm.bytemark.co.uk","subject":"Re: Mixing cherry-pick and merge","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-29T13:22:32Z","receivedAt":"2007-08-29T13:22:32Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 29 Aug 2007, Karl Hasselstr?m wrote:\n\n> On 2007-08-29 14:05:55 +0200, Michel Marti wrote:\n> \n> > I just merged from a branch from which I previously cherry-picked some \n> > commits and now the log contains the already cherry-picked commits \n> > twice (which is rather confusing). Is this a bug or a feature?\n> \n> It's an inevitable consequence of git's design. When you cherry-pick a \n> commit, you create a (maybe slightly modified) copy of it with different \n> ancestry. If you then merge a branch that contains the original commit, \n> you will get both the original and the copy as ancestors of your new \n> merge commit.\n\nI guess that people are not even aware that they can rebase with Git.  \nSounds like a perfect use case to me.\n\nCiao,\nDscho\n"}]}