{"thread":{"id":"21113","subject":"Figuring out which patches have been applied","startedAt":"2009-10-02T14:36:18Z","lastAt":"2009-10-02T19:16:00Z","messageCount":3,"participants":["Jon Smirl","Julian Phillips","skillzero@gmail.com"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"124132","messageId":"9e4733910910020736n539f4331nfd61175b275c7d28@mail.gmail.com","threadId":"21113","inReplyTo":null,"subject":"Figuring out which patches have been applied","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2009-10-02T14:36:18Z","receivedAt":"2009-10-02T14:36:18Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"I have a stack of 100 patches against 2.6.30. A lot of these got\nmerged between 2.6.30-32.  How can I tell which ones have been\napplied?\n\nIt doesn't work to check if patch A has been applied to 2.6.32. Other\npatches may have been applied on top of patch A obscuring it.\n\nOnce solution would be to rebase the patch stack forward one commit at\na time. That solves the problem of later patches obscuring patch A. Is\nthere a better way to do this?\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"124142","messageId":"alpine.LNX.2.00.0910021944040.28646@reaper.quantumfyre.co.uk","threadId":"21113","inReplyTo":"9e4733910910020736n539f4331nfd61175b275c7d28@mail.gmail.com","subject":"Re: Figuring out which patches have been applied","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2009-10-02T18:45:53Z","receivedAt":"2009-10-02T18:45:53Z","isPatch":false,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Fri, 2 Oct 2009, Jon Smirl wrote:\n\n> I have a stack of 100 patches against 2.6.30. A lot of these got\n> merged between 2.6.30-32.  How can I tell which ones have been\n> applied?\n>\n> It doesn't work to check if patch A has been applied to 2.6.32. Other\n> patches may have been applied on top of patch A obscuring it.\n>\n> Once solution would be to rebase the patch stack forward one commit at\n> a time. That solves the problem of later patches obscuring patch A. Is\n> there a better way to do this?\n\nHave you tried using git-cherry?  I belive that it was intended for this \npurpose?\n\n-- \nJulian\n\n  ---\nProgress might have been all right once, but it's gone on too long.\n \t\t-- Ogden Nash\n"},{"id":"124145","messageId":"2729632a0910021216v7b3c5dadi14a6f8c0ea41b6b9@mail.gmail.com","threadId":"21113","inReplyTo":"9e4733910910020736n539f4331nfd61175b275c7d28@mail.gmail.com","subject":"Re: Figuring out which patches have been applied","fromName":"","fromEmail":"skillzero@gmail.com","sentAt":"2009-10-02T19:16:00Z","receivedAt":"2009-10-02T19:16:00Z","isPatch":false,"sender":{"key":"skillzero@gmail.com","avatar":null},"body":"On Fri, Oct 2, 2009 at 7:36 AM, Jon Smirl <jonsmirl@gmail.com> wrote:\n> I have a stack of 100 patches against 2.6.30. A lot of these got\n> merged between 2.6.30-32.  How can I tell which ones have been\n> applied?\n>\n> It doesn't work to check if patch A has been applied to 2.6.32. Other\n> patches may have been applied on top of patch A obscuring it.\n>\n> Once solution would be to rebase the patch stack forward one commit at\n> a time. That solves the problem of later patches obscuring patch A. Is\n> there a better way to do this?\n\nThere may be a better way, but I needed to do a similar thing with\ncommits that were cherry-pick'd so I wrote a simple\ngit-contains-equivalent script to search for equivalent patch ID's\ngiven a commit ID. You could do something like that, but using\ngit-patch-id as the source instead getting it from an existing commit\nlike the following script does.\n\n#!/bin/bash\n\nset -o pipefail\nsearchCommitID=`git rev-parse $1`\nsearchPatchID=`git show $searchCommitID | git patch-id`\nif [ $? -ne 0 ]; then\n\texit 1\nfi\nsearchPatchID=${searchPatchID% *}\n\necho \"Searching for equivalents to commit $searchCommitID (patch\n$searchPatchID)...\"\ngit log --all -p | git patch-id | grep $searchPatchID |\nwhile read patchID commitID; do\n\tif [ \"$commitID\" = \"$searchCommitID\" ]; then\n\t\techo \"Exact commit $commitID is on the following branches:\"\n\telse\n\t\techo \"Equivalent commit $commitID is on the following branches:\"\n\tfi\n\tgit branch -a --contains $commitID\ndone\n"}]}