{"thread":{"id":"21321","subject":"Re: Finding a commit","startedAt":"2009-10-22T08:32:50Z","lastAt":"2009-10-22T08:32:50Z","messageCount":1,"participants":["Soham Mehta"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"125689","messageId":"4AE018B2.2010408@box.net","threadId":"21321","inReplyTo":null,"subject":"Re: Finding a commit","fromName":"Soham Mehta","fromEmail":"soham@box.net","sentAt":"2009-10-22T08:32:50Z","receivedAt":"2009-10-22T08:32:50Z","isPatch":false,"sender":{"key":"soham@box.net","avatar":null},"body":"\nThanks for all the answers! Sorry for the delayed reply.\n\nLike Douglas Campos suggested, git-cherry (which uses git-patch-id like \nThomas Rast suggests) works for me. Here is what I tried:\n\nfrom first repo$: git fetch second-repo\nfrom first repo$: git cherry -v second-repo/branch-in-question sha1 sha1^\n- sha1 <commit message>\n\n\nOutputs the sha1 with a minus sign in front, which means the change is \nalready present in second-repo/branch-in-question, and is what I expect.\n\n-Soham\n\n\n\nthus spake Daniele Segato , On 10/21/2009 6:55 AM:\n> On Wed, Oct 21, 2009 at 2:37 PM, Thomas Rast <trast@student.ethz.ch> wrote:\n>   \n>>> Commit -> Tree ---> Blob1, Blob2, Blob3\n>>>\n>>> Commit, Trees and Blobs are all identified by sha1\n>>> the commit should keep information on the author, the \"parent\"\n>>> commit(s) and so on..\n>>> the tree should just keep the \"snapshot\" of the data..\n>>>\n>>> so I think that if you search for the SHA-1 of the tree you should be fine..\n>>>       \n>> Not if you really want to find out if X was cherry-picked into this\n>> repository, because the tree is the *final state* at that commit,\n>> which of course includes all preceding changes.\n>>\n>> So suppose you have two patches A.diff and B.diff introducing files of\n>> the same name; then if you combine them into history as\n>>\n>>  A -- B\n>>\n>> the tree state at B has both files, and hence is different from the\n>> tree state of B' in\n>>\n>>  B' -- A'\n>>\n>> because there it only has the file B.\n>>     \n>\n> Yes... obviously...\n> the tree is the snapshot of a complete data set: so if you apply the\n> same patch to different data set you get different trees...\n> thanks for pointing it out.. :)\n>\n> Regards,\n> Daniele\n>   \n"}]}