{"thread":{"id":"30795","subject":"how to know this commit is merged by whic commit","startedAt":"2012-06-13T16:50:59Z","lastAt":"2012-06-13T22:22:48Z","messageCount":3,"participants":["lei yang","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"193547","messageId":"CAHsH0E9HooVsAq8NhWm-OSk7gSPFMmoYHsArtYqhwTmE0ngwjA@mail.gmail.com","threadId":"30795","inReplyTo":null,"subject":"how to know this commit is merged by whic commit","fromName":"lei yang","fromEmail":"yanglei.fage@gmail.com","sentAt":"2012-06-13T16:50:59Z","receivedAt":"2012-06-13T16:50:59Z","isPatch":false,"sender":{"key":"yanglei.fage@gmail.com","avatar":null},"body":"Hi list\n\nI have a question as the title indicate. assume the commmit id is\nee5r3343. how to know this commit is merged by  which commit?\n\nThanks\nLei\n"},{"id":"193596","messageId":"20120613213435.GA25301@sigill.intra.peff.net","threadId":"30795","inReplyTo":"CAHsH0E9HooVsAq8NhWm-OSk7gSPFMmoYHsArtYqhwTmE0ngwjA@mail.gmail.com","subject":"Re: how to know this commit is merged by whic commit","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-06-13T21:34:35Z","receivedAt":"2012-06-13T21:34:35Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jun 14, 2012 at 12:50:59AM +0800, lei yang wrote:\n\n> I have a question as the title indicate. assume the commmit id is\n> ee5r3343. how to know this commit is merged by  which commit?\n\nThere is not one answer to \"which commit\"; there may be an infinite\nnumber of commits which merge it into something else. The best you can\ndo is start at some point (e.g., the tip of \"master\") and walk backwards\nlooking for commits which merge it (and you still may find multiple, if\nthe commit was merged into two other lines of development, each of which\nwas merged into your starting point). There is not an option to do this\nsearch automatically, so you would have to use grep, like:\n\n  git log --format='%H %P' |\n  grep \" $commit\" |\n  cut -d' ' -f1\n\nwhich will list the id of all commits (%H) for which $commit appears in\nthe list of parents (%P).\n\n-Peff\n\nPS You didn't give any background on your problem, but you may also find\n   \"git tag --contains\" and \"git branch --contains\" useful.\n"},{"id":"193598","messageId":"7vzk86g8cn.fsf@alter.siamese.dyndns.org","threadId":"30795","inReplyTo":"20120613213435.GA25301@sigill.intra.peff.net","subject":"Re: how to know this commit is merged by whic commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-13T22:22:48Z","receivedAt":"2012-06-13T22:22:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Thu, Jun 14, 2012 at 12:50:59AM +0800, lei yang wrote:\n>\n>> I have a question as the title indicate. assume the commmit id is\n>> ee5r3343. how to know this commit is merged by  which commit?\n>\n> There is not one answer to \"which commit\"; there may be an infinite\n> number of commits which merge it into something else. The best you can\n> do is start at some point (e.g., the tip of \"master\") and walk backwards\n> looking for commits which merge it (and you still may find multiple, if\n> the commit was merged into two other lines of development, each of which\n> was merged into your starting point). There is not an option to do this\n> search automatically, so you would have to use grep, like:\n\nOr you can use \"git bisect\" ;-).\n"}]}