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

[Question]: Question about "cherry-pick" internal

From
WLWang, Lei <lei4.wang@intel.com>
Date
Aug 4, 2022, 01:25 UTC
Message-ID
<e564b1e3-0f34-dce3-400d-439a40ec4d48@intel.com>
Hi,

I heard that cherry-pick is just a kind of merge, the difference between it and the traditional merge is that it treats the parent commit of the commit you want to cherry-pick as the merge-base, then it will diff both the current branch with the parent and the commit you want to cherry-pick with the parent to generate 2 diffs, then it will try to apply these 2 diffs to the parent commit. If the diff modified the same line, then a conflict occurs.

If the above is true, but why when I cherry-picked a commit, a conflict occurs even the 2 diffs didn't modify the same line, they modified the two consecutive lines (line n and line n + 1), so what can be the potential reason for this?

Looking forward to your valuable comments!
-- 
BR,
Lei
Next: Chris Torek
Message 1 of 3 in “[Question]: Question about "cherry-pick" internal”
  1. Wang, LeiAug 4, 2022
  2. Chris TorekAug 7, 2022
  3. Wang, LeiAug 8, 2022

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.