git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
APAndy Parkins <andyparkins@gmail.com>
Date
Apr 4, 2007, 12:56 UTC
Message-ID
<200704041356.47123.andyparkins@gmail.com>
In-Reply-To
<1175686583.19898.68.camel@okra.transitives.com>
On Wednesday 2007 April 04 12:36, Alex Bennee wrote:
Show 8 quoted lines
> 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
Previous: Alex RiesenNext: Linus Torvalds
Message 3 of 19 in “How can I easily verify my diffs are in parent branch?”
  1. Alex BenneeApr 4, 2007
  2. Alex RiesenApr 4, 2007
  3. Andy ParkinsApr 4, 2007
  4. Linus TorvaldsApr 4, 2007
  5. Junio C HamanoApr 5, 2007
  6. David KågedalApr 5, 2007
  7. Junio C HamanoApr 5, 2007
  8. Document --left-right option to rev-list.Brian Gernhardt, Apr 5, 2007
  9. Junio C HamanoApr 5, 2007
  10. Alex RiesenApr 7, 2007
  11. 1/2 git-log --cherry-pickJunio C Hamano, Apr 9, 2007
  12. 1/4 Add %m to '--pretty=format:'Junio C Hamano, Apr 10, 2007
  13. 2/4 Refactor patch-id filtering out of git-cherry and git-format-patch.Junio C Hamano, Apr 10, 2007
  14. Johannes SchindelinApr 14, 2007
  15. 3/4 git-log --cherry-pick A...BJunio C Hamano, Apr 10, 2007
  16. 4/4 Documentation: --cherry-pickJunio C Hamano, Apr 10, 2007
  17. 2/2 Add %m to '--pretty=format:'Junio C Hamano, Apr 9, 2007
  18. Alex BenneeApr 11, 2007
  19. Linus TorvaldsApr 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.