git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Tim Harper <timcharper@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Bizarre missing changes (git bug?)
Date: Mon, 21 Jul 2008 15:57:58 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.1.10.0807211546590.3007@woody.linux-foundation.org> (raw)
In-Reply-To: <8C23FB54-A28E-4294-ABEA-A5766200768B@gmail.com>


[ git channel added back to cc, because this is an interesting question in 
  itself ]

On Mon, 21 Jul 2008, Tim Harper wrote:
> 
> Another false impression I had is a merge conflict resolution would always be
> displayed in a merge commit.  However, after running over the merges again, if
> you pick the right or left, discarding the one or the other, nothing is shown
> in "git log -p" for the merge commit.  Is there a way to see what was chosen
> for a conflict resolution?  Seeing that in the merge commit would have made
> things a little more clear.

The default behavior for showing merges is "--cc", which is the condensed 
version that only shows _actual_ conflicts that got resolved differently 
from either of the sources.

But note how this is an "after-the-fact" determination: it doesn't look 
whether the merge _did_ conflict (because doing that would require 
re-running the whole merge!), but it looks whether the end _result_ is 
different from either side.

So you can easily have a merge that conflicts - but then you resolve that 
merge by picking just one side of the merge as the result. And in that 
case the "--cc" diff will not show anything at all - because the end 
result did not conflict with the sources of the merge!

So "--cc" only shows output if: the merge itself actually changed 
something from _all_ parents. This can happen if:

 - there was a non-trivial conflict, and the end result really was a 
   "mixture" of the two. The result wasn't just a select of either side, 
   it was a combination of the two.

   This is obviously one "common" case for a merge resolution.

   But it's equally common that when you merge something you just say "Ok, 
   that other side did it better, I'll just pick that version". And in 
   that case, "--cc" won't show anything at all, because it's not really a 
   conflict any more once you've done that choice.

 - There can also be an "evil merge" that actually adds/changes/deletes 
   code that didn't exist AT ALL in either side. And --cc is very much 
   designed to show that.

   This is actually not always a bad thing (despite the name "evil 
   merge"), because it happens regularly that one branch had changed some 
   infrastructure setup or other, and the other branch had added a totally 
   new use of that infrastructure - and as a result the _merge_ needs to 
   add that setup code that didn't exist in either of the branches (in one 
   because the use wasn't there, in the other because the setup wasn't 
   needed).

Anyway, this all means that yes, "--cc" _often_ shows conflicts, but not 
always - exactly because it doesn't show the ones that the merge had 
committed as a non-conflict.

If you actually want to see the _real_ conflicts that happened as the 
merge was done, you do have to re-do it. 

		Linus

  parent reply	other threads:[~2008-07-21 22:59 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-21 20:26 Bizarre missing changes (git bug?) Tim Harper
2008-07-21 20:37 ` Linus Torvalds
2008-07-21 22:53   ` Tim Harper
2008-07-21 22:55     ` Tim Harper
     [not found]   ` <8C23FB54-A28E-4294-ABEA-A5766200768B@gmail.com>
2008-07-21 22:57     ` Linus Torvalds [this message]
2008-07-26  3:12   ` Roman Zippel
2008-07-26 19:58     ` Linus Torvalds
2008-07-27 17:50       ` Roman Zippel
2008-07-27 18:47         ` Linus Torvalds
2008-07-27 23:14           ` Roman Zippel
2008-07-27 23:18             ` Linus Torvalds
2008-07-28  0:00               ` Roman Zippel
2008-07-28  5:00                 ` Linus Torvalds
2008-07-28  5:30                   ` Linus Torvalds
2008-07-29  2:59                   ` Roman Zippel
2008-07-29  3:15                     ` Martin Langhoff
2008-07-30  0:16                       ` Roman Zippel
2008-07-30  0:25                         ` Martin Langhoff
2008-07-30  0:32                         ` Linus Torvalds
2008-07-30  0:48                           ` Linus Torvalds
2008-07-30 23:56                             ` Junio C Hamano
2008-07-31  0:15                               ` Junio C Hamano
2008-07-31  0:30                               ` Linus Torvalds
2008-07-31  8:17                               ` [PATCH v2] revision traversal: show full history with merge simplification Junio C Hamano
2008-07-31  8:18                                 ` Junio C Hamano
2008-07-31 22:30                                   ` Linus Torvalds
2008-07-31 22:09                                 ` [PATCH v3-wip] " Junio C Hamano
2008-07-31 22:26                                   ` Linus Torvalds
2008-07-31 22:36                                     ` Junio C Hamano
2008-08-01  3:00                                     ` Junio C Hamano
2008-08-01  3:48                                       ` Linus Torvalds
2008-08-01  7:50                                         ` Junio C Hamano
2008-07-30  8:36                         ` Bizarre missing changes (git bug?) Jakub Narebski
2008-07-29  3:29                     ` Linus Torvalds
2008-07-29  3:33                       ` Linus Torvalds
2008-07-29 11:39                       ` Roman Zippel
2008-07-29 12:00                         ` David Kastrup
2008-07-29 15:50                         ` Linus Torvalds
2008-07-30  1:14                           ` Roman Zippel
2008-07-30  1:32                             ` Kevin Ballard
2008-07-30  1:49                             ` Linus Torvalds
2008-07-29  5:31                     ` Jeff King
2008-07-29 12:32                       ` Roman Zippel
2008-07-29 12:48                         ` Olivier Galibert
2008-07-29 12:52                         ` Jeff King
2008-07-29 17:25                           ` Linus Torvalds
2008-07-30  1:50                             ` Roman Zippel
2008-07-30  2:05                               ` Linus Torvalds
2008-07-30  4:26                             ` Jeff King
2008-07-30  4:52                               ` Linus Torvalds
2008-07-30  2:48                           ` Roman Zippel
2008-07-30  3:20                             ` Kevin Ballard
2008-07-30  3:21                             ` Linus Torvalds
2008-07-30  3:35                               ` Linus Torvalds
2008-07-30  4:23                             ` Jeff King
2008-07-27 23:25             ` Martin Langhoff
2008-07-28  1:29               ` Roman Zippel
2008-07-21 20:42 ` Alex Riesen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.1.10.0807211546590.3007@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=git@vger.kernel.org \
    --cc=timcharper@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).