git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Figuring out which patches have been applied
@ 2009-10-02 14:36 Jon Smirl
  2009-10-02 18:45 ` Julian Phillips
  2009-10-02 19:16 ` skillzero
  0 siblings, 2 replies; 3+ messages in thread
From: Jon Smirl @ 2009-10-02 14:36 UTC (permalink / raw)
  To: Git Mailing List

I have a stack of 100 patches against 2.6.30. A lot of these got
merged between 2.6.30-32.  How can I tell which ones have been
applied?

It doesn't work to check if patch A has been applied to 2.6.32. Other
patches may have been applied on top of patch A obscuring it.

Once solution would be to rebase the patch stack forward one commit at
a time. That solves the problem of later patches obscuring patch A. Is
there a better way to do this?

-- 
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Figuring out which patches have been applied
  2009-10-02 14:36 Figuring out which patches have been applied Jon Smirl
@ 2009-10-02 18:45 ` Julian Phillips
  2009-10-02 19:16 ` skillzero
  1 sibling, 0 replies; 3+ messages in thread
From: Julian Phillips @ 2009-10-02 18:45 UTC (permalink / raw)
  To: Jon Smirl; +Cc: Git Mailing List

On Fri, 2 Oct 2009, Jon Smirl wrote:

> I have a stack of 100 patches against 2.6.30. A lot of these got
> merged between 2.6.30-32.  How can I tell which ones have been
> applied?
>
> It doesn't work to check if patch A has been applied to 2.6.32. Other
> patches may have been applied on top of patch A obscuring it.
>
> Once solution would be to rebase the patch stack forward one commit at
> a time. That solves the problem of later patches obscuring patch A. Is
> there a better way to do this?

Have you tried using git-cherry?  I belive that it was intended for this 
purpose?

-- 
Julian

  ---
Progress might have been all right once, but it's gone on too long.
 		-- Ogden Nash

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Figuring out which patches have been applied
  2009-10-02 14:36 Figuring out which patches have been applied Jon Smirl
  2009-10-02 18:45 ` Julian Phillips
@ 2009-10-02 19:16 ` skillzero
  1 sibling, 0 replies; 3+ messages in thread
From: skillzero @ 2009-10-02 19:16 UTC (permalink / raw)
  To: Jon Smirl; +Cc: Git Mailing List

On Fri, Oct 2, 2009 at 7:36 AM, Jon Smirl <jonsmirl@gmail.com> wrote:
> I have a stack of 100 patches against 2.6.30. A lot of these got
> merged between 2.6.30-32.  How can I tell which ones have been
> applied?
>
> It doesn't work to check if patch A has been applied to 2.6.32. Other
> patches may have been applied on top of patch A obscuring it.
>
> Once solution would be to rebase the patch stack forward one commit at
> a time. That solves the problem of later patches obscuring patch A. Is
> there a better way to do this?

There may be a better way, but I needed to do a similar thing with
commits that were cherry-pick'd so I wrote a simple
git-contains-equivalent script to search for equivalent patch ID's
given a commit ID. You could do something like that, but using
git-patch-id as the source instead getting it from an existing commit
like the following script does.

#!/bin/bash

set -o pipefail
searchCommitID=`git rev-parse $1`
searchPatchID=`git show $searchCommitID | git patch-id`
if [ $? -ne 0 ]; then
	exit 1
fi
searchPatchID=${searchPatchID% *}

echo "Searching for equivalents to commit $searchCommitID (patch
$searchPatchID)..."
git log --all -p | git patch-id | grep $searchPatchID |
while read patchID commitID; do
	if [ "$commitID" = "$searchCommitID" ]; then
		echo "Exact commit $commitID is on the following branches:"
	else
		echo "Equivalent commit $commitID is on the following branches:"
	fi
	git branch -a --contains $commitID
done

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-02 19:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-02 14:36 Figuring out which patches have been applied Jon Smirl
2009-10-02 18:45 ` Julian Phillips
2009-10-02 19:16 ` skillzero

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).