git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to find and analyze bad merges?
@ 2012-02-02  8:10 norbert.nemec
  2012-02-02  8:16 ` Junio C Hamano
  2012-02-02 10:05 ` norbert.nemec
  0 siblings, 2 replies; 11+ messages in thread
From: norbert.nemec @ 2012-02-02  8:10 UTC (permalink / raw)
  To: git

Hi there,

a colleague of mine happened to produce a bad merge by unintenionally 
picking the version of the remote branch ("R") for all conflicting 
files. Effectively, he eliminated a whole bunch of bugfixes that were 
already on his local branch ("L").

Obviously this was a mistake on his side, but hey: everyone makes 
mistakes. The real problem is to find this problem afterwards, possibly 
weeks later, when you suddenly realize that a bug that you had fixed 
suddenly reappears.

A "git log" on the whole repository shows both branches R and L.
A "git show" on the bugfix commit shows the bugfix as you expect it.

BUT:
A "git log" on the file itself shows neither the problematic merge nor 
the bugfix commit. Git considers the merge of this file trivial because 
the content is identical to that of parent R. Therefore, whatever 
happened on branch L is not considered relevant history of the file.

FURTHERMORE:
A "git show" of the merge itself does not show the conflicting file 
either. Obviously, "git show" on a merge decides which files are 
relevant not based on conflicts but based on resolutions.

To sort out what happened, you first need to have a suspicion and then 
dig fairly deep in the manuals to set the correct options to show what 
happened.

I think, both "git log" and "git show" should by default be a bit more 
conservative in hiding "insignificant" merges:
* In "git log" a branch should only be hidden if it never touched the file.
* In "git show" a merge should display all files that did have a 
conflict independent of the resolution. (I am open to discuss whether 
auto-resolvable conflicts should be displayed by default. Non-trivial 
conflicts definitely should)

Greetings,
Norbert

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

end of thread, other threads:[~2012-02-02 20:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-02  8:10 How to find and analyze bad merges? norbert.nemec
2012-02-02  8:16 ` Junio C Hamano
2012-02-02  9:01   ` norbert.nemec
2012-02-02 20:09     ` Junio C Hamano
2012-02-02 10:05 ` norbert.nemec
     [not found]   ` <87haz97c2k.fsf@thomas.inf.ethz.ch>
2012-02-02 11:17     ` Norbert Nemec
2012-02-02 11:41       ` David Barr
2012-02-02 12:03         ` Jonathan Nieder
2012-02-02 12:16           ` norbert.nemec
2012-02-02 15:09             ` Neal Groothuis
2012-02-02 12:10         ` norbert.nemec

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).