All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Bucur <stefan.bucur@gmail.com>
To: git@vger.kernel.org
Subject: Wrong file diff for merge conflict
Date: Sat, 4 Jul 2009 07:53:34 +0000 (UTC)	[thread overview]
Message-ID: <loom.20090704T072854-229@post.gmane.org> (raw)

Hi!

I would like to point out a very strange behavior of git merge, which led to
data loss or data duplication in the conflict file generated during a diff merge.

I had to merge two branches (A and B) which contained more files (e.g.
http://pastebin.ca/1483691 - before splitting branches) which were affected in
the following way:
* The files were formatted (indented) in branch A: http://pastebin.ca/1483684
* In branch B, their contents were altered in various points, but not
significantly (refactored some statements into macros): http://pastebin.ca/1483683

I checked out branch A, and I ran "git merge B", and (obviously) there was a
conflict with this file. The big surprise was to see that the generated diff
file looks like this:

http://pastebin.ca/1483228

The problem is with the last diff in the file, where the left portion is empty,
and the right portion contains code which already was marked as merged (common),
right before the start of the diff. Therefore, the mark at line 127 should
really have been before line 114.

Is this a bug or I am missing something?

Thanks,
Stefan Bucur

             reply	other threads:[~2009-07-04  8:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-04  7:53 Stefan Bucur [this message]
2009-07-05 18:43 ` Wrong file diff for merge conflict Linus Torvalds
2009-07-05 19:22   ` Jakub Narebski
2009-07-05 19:23   ` Junio C Hamano
2009-07-05 22:23   ` Stefan Bucur
2009-07-06  0:33     ` Linus Torvalds
2009-07-06 14:44       ` Stefan Bucur

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=loom.20090704T072854-229@post.gmane.org \
    --to=stefan.bucur@gmail.com \
    --cc=git@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.