Thread (6 messages) flat view 6 messages, 4 authors, 2016-06-15

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

From: Andy Parkins <hidden>
Date: 2016-06-15 22:43:03

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
andyparkins@gmail.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help