git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Confused about "degenerate" combined diff for merge commits
@ 2010-08-15 17:51 Stefan Haller
  2010-08-15 19:54 ` Thomas Rast
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Haller @ 2010-08-15 17:51 UTC (permalink / raw)
  To: git

(Git newbie alert. Please be patient with me if I'm missing obvious
things...)

I'm converting a moderately large repository from Subversion to git.  As
part of the process, I'm experimenting with correctly representing
merges in the resulting git repository. In Subversion, we used commit
logs such as "Merged r1234:1279 from branch_xyz", so in most cases it
should be possible to use this information to create the proper parents
in git. I'm currently trying how well this works by using grafts; but
that's not the question.

Now, I'm using "gitk --all --merges" to look at my synthesized merge
commits; and I assume that I manufactured them correctly if the
resulting combined diff is empty.  I only expect diff output for merge
conflicts with a non-trivial resolution, i.e. neither ours nor theirs
was used to resolve the conflict. Is this assumption correct so far?

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?


-- 
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Confused about "degenerate" combined diff for merge commits
  2010-08-15 17:51 Confused about "degenerate" combined diff for merge commits Stefan Haller
@ 2010-08-15 19:54 ` Thomas Rast
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Rast @ 2010-08-15 19:54 UTC (permalink / raw)
  To: Stefan Haller; +Cc: git

Stefan Haller wrote:
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-15 19:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-15 17:51 Confused about "degenerate" combined diff for merge commits Stefan Haller
2010-08-15 19:54 ` Thomas Rast

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).