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

Re: Confused about "degenerate" combined diff for merge commits

From
Thomas Rast <trast@student.ethz.ch>
Date
Aug 15, 2010, 19:54 UTC
Message-ID
<201008152154.57578.trast@student.ethz.ch>
In-Reply-To
<1jna5yt.1pm42a3uw2yquM%lists@haller-berlin.de>
Stefan Haller wrote:
Show 17 quoted lines
> However, for some of these merge commits I see diff output such as this:
> 
> diff --cc Src/ClipBoard.cpp
> index 4357ea0,4357ea0..3fad79a
> --- a/Src/ClipBoard.cpp
> +++ b/Src/ClipBoard.cpp
> @@@ -71,7 -71,7 +71,7 @@@ AClipBoard* AClipBoard::SNew(
>   
>   AClipBoard* AClipBoard::SClipBoard()
>   {
> --  static AClipBoard* spClipBoard = SNew();
> ++  static TPtr<AClipBoard> spClipBoard = SNew();
>     return spClipBoard;
>   }
>   
> It looks like both merge parents had an identical diff here, so this is
> not a conflict; why does diff --cc even show this to me?

The --cc output has one column per parent, and if you removed all other +/-/space columns, then (for that hunk) you'd have a unified diff with that parent.

So I'd say the above means that both parents had
  static AClipBoard* spClipBoard = SNew();
but your merge result was
  static TPtr<AClipBoard> spClipBoard = SNew();

This is usually called an "evil merge" in git terms: it is introducing changes that are neither coming from one side, nor part of a benign merge resolution.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Stefan Haller
Message 2 of 2 in “Confused about "degenerate" combined diff for merge commits”
  1. Stefan HallerAug 15, 2010
  2. Thomas RastAug 15, 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.