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

Re: cherry-pick applies some other changes than the specified one?

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Mar 21, 2011, 16:41 UTC
Message-ID
<4D877FAD.9000807@viscovery.net>
In-Reply-To
<7vwrjssbfk.fsf@alter.siamese.dyndns.org>
Am 3/21/2011 17:09, schrieb Junio C Hamano:
Show 15 quoted lines
> Piotr Krukowiecki <piotr.krukowiecki@gmail.com> writes:
>> But when I take a different approach, and in addition to this:
>>
>>> If I edit the file and remove the "<<<< HEAD" marked and code
>>> between "===" and ">>>"  then
>>
>> I also manually add the "+line" which is the change done in the cherry-picked
>> commit, git diff shows a lot of other changes in unrelated lines
>> (which lie close
>> but still were not modified by the patch, nor were shown previously by
>> git diff).
>>
>> This is very weird.
> 
> Sorry, I have no idea what you are talking about.

Assuming you did not 'git add' the file yet, you are looking at the "condensed combined diff" after manually resolving the conflict by doing the "+line" manually that the cherry-pick should have brought in. Of course, a lot of context is visible here if both sides have diverged considerably in this area.

I.e. the diff will look something like
 +line from HEAD
 +line from HEAD
+ line from cherry-picked
 +line from HEAD
...

Notice the double columns before the content lines. This sort of diff extens above and below the conflicting section until there is a "gap" of 3 lines that changed neither on the HEAD side nor on the cherry-picked side since the merge base.

-- Hannes
Previous: Junio C HamanoNext: Piotr Krukowiecki
Message 3 of 13 in “cherry-pick applies some other changes than the specified one?”
  1. Piotr KrukowieckiMar 21, 2011
  2. Junio C HamanoMar 21, 2011
  3. Johannes SixtMar 21, 2011
  4. Piotr KrukowieckiMar 21, 2011
  5. Junio C HamanoMar 21, 2011
  6. Piotr KrukowieckiMar 21, 2011
  7. Jonathan NiederMar 21, 2011
  8. Piotr KrukowieckiMar 21, 2011
  9. Junio C HamanoMar 21, 2011
  10. Junio C HamanoMar 21, 2011
  11. Jonathan NiederMar 22, 2011
  12. Junio C HamanoMar 22, 2011
  13. Piotr KrukowieckiMar 22, 2011

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.