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

Re: Merging a commit from a distant branch, cherry-pick seems to fail

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Jun 8, 2010, 05:57 UTC
Message-ID
<4C0DDBC8.9030909@viscovery.net>
In-Reply-To
<4C1009EE-3A67-4DF9-9F45-493CD463AEF9@dazjorz.com>
Am 6/8/2010 0:46, schrieb Sjors Gielen:
Show 8 quoted lines
> sjors@smbp:~/Projecten/kmess/git$ git log -1 --name-only --oneline f9380fd43a2c1
> f9380fd 2010-06-03 (Sjors) (noknotify branch)
> ChangeLog
> src/CMakeLists.txt
> src/notification/macnotification.cpp
> src/notification/macnotification.h
> src/notification/notificationmanager.cpp
> src/notification/notificationmanager.h
...
Show 18 quoted lines
> sjors@smbp:~/Projecten/kmess/git$ git status
> # On branch kmess-2.0.x
> # Changes to be committed:
> #   (use "git reset HEAD <file>..." to unstage)
> #
> #	modified:   src/CMakeLists.txt
> #	new file:   src/notification/macnotification.cpp
> #	new file:   src/notification/macnotification.h
> #	modified:   src/notification/notificationmanager.cpp
> #
> # Unmerged paths:
> #   (use "git reset HEAD <file>..." to unstage)
> #   (use "git add/rm <file>..." as appropriate to mark resolution)
> #
> #	both modified:      ChangeLog
> #	added by us:        contrib/isf-qt
> #	both modified:      src/notification/notificationmanager.h
> #
...
Show 8 quoted lines
> I'd have expected git cherry-pick to simply take the changes in commit
> f9380fd43 and apply them to kmess-2.0.x, without pulling along history
> in 'master'. Testing and debugging in the #git channel on Freenode didn't
> show what I was doing wrong (<http://git.pastebin.com/dUntbHDV>). Now I
> could just take the patch with 'git show' and use 'git apply' to apply it,
> but that doesn't seem like the Git way to do this. So the question is:
> does any of you know why this is happening, what I'm doing wrong, and what
> I should do instead?
You did nothing wrong. If at all, there is a bug in git.
The *only* curious thing after your cherry-pick is this:
> #	added by us:        contrib/isf-qt

because contrib/isf-qt is not touched by the commit that you are cherry-picking.

contrib/isf-qt is a submodule on branch kmess-2.0.x, but it is a regular directory on master. I don't think that git should report it as a conflict.

To go ahead, simply resolve the conflicts in ChangeLog and notificationmanager.h, and make sure that you do not have staged any changes to contrib/isf-qt before you commit.

-- Hannes
Previous: Sjors GielenNext: Johannes Sixt
Message 2 of 4 in “Merging a commit from a distant branch, cherry-pick seems to fail”
  1. Sjors GielenJun 7, 2010
  2. Johannes SixtJun 8, 2010
  3. merge-recursive: demonstrate an incorrect conflict with submoduleJohannes Sixt, Jun 8, 2010
  4. Johannes SixtJun 8, 2010

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.