Subject: Re: How can I easily verify my diffs are in parent branch?

From: Andy Parkins <[email-masked]>
Date: Wed, 4 Apr 2007 13:56:46 +0100

On Wednesday 2007 April 04 12:36, Alex Bennee wrote:

> What I need to do is check that my commits that I submitted for the
> baseline have been correctly merged. Of course if I do "git-diff
> master..mywork" I'll see all the other code that has been added in (or
> more usually is missing from my branch).
>
> Is there an invocation of git-diff or another tool that can tell me all
> my diffs are present in the big uber-commit of my master branch baseline
> release?

Kind of.  Try git-cherry (I like to use -v as well).  This will compare the 
hash of the diff of each of the revisions in your current branch with those 
of an upstream branch.

 * -- O -- * -- * -- C' -- * (upstream)
       \
        A -- B -- C -- D (yourbranch)

With something like the above, were C has been accepted into upstream as 
revision C', runing git-cherry on yourbranch would give:

 $ git-cherry upstream
 +A
 +B
 -C
 +D

The "-" in front of C means that you can remove C from yourbranch - it's been 
accepted.

However, this relies on the applied patch matching exactly (not the log 
message - that can be anything), so if a typo got fixed by the maintainer, it 
would show up as not having been accepted.

Another good way of telling is to rebase yourbranch onto the current 
upstream - a patch that doesn't need applying (because it's already there) 
get's dropped automatically by git.  This is really handy because git 
effectively filters those patches that you don't need to worry about any more 
in yourbranch.  This would cope with a typo fix as well, because git-rebase 
would note a conflict which you would then see as being a minor typo and 
would do "git rebase --skip" which would manually drop the patch from 
yourbranch.

Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
[email-masked]