git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan del Strother <maillist@steelskies.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: Merging adjacent deleted lines?
Date: Wed, 21 Jan 2009 19:20:50 +0000	[thread overview]
Message-ID: <57518fd10901211120n62f8d0e9ya8595fc9baa6476c@mail.gmail.com> (raw)

Say I have a file that started out with the following content :

line1
line2
line3
line4


I create a branch, which deletes line2.  Someone else's branch deletes line 3.

When I merge those two branches, the conflict looks like :

line1
<<<<<<< HEAD:lines
line3
=======
line2
>>>>>>> SomeoneElse:lines
line4



Which in my cursory overview, looked an awful lot like the obvious
merge resolution ought to be

line1
line3
line4

After all - I know I want to delete line 2, and wasn't aware of the
other person deleting line 3.

It was only later that we discovered that the merge was broken and
both lines should have been deleted.  Thinking about it, I guess that
the conflict if the other branch _hadn't_ deleted line 3 would have
looked something like

line1
<<<<<<< HEAD:lines
=======
line2
>>>>>>> SomeoneElse:lines
line3
line4

 - which wouldn't have resulted in a conflict anyway.


So, it looks like I need to be way more careful when merging
conflicts.  Which leads me to - what tools do you use when studying
conflicts like that?  git blame seems the obvious one, for getting the
context of each deletion, but it seems like I need to run it once as
git blame HEAD lines, and once as git blame MERGE_HEAD lines.  Is
there something a little more integrated for comparing the origin of
each change from both merge branches simultaneously?

Would welcome any thoughts on how you guys approach conflict-resolution
-Jon

             reply	other threads:[~2009-01-21 19:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-21 19:20 Jonathan del Strother [this message]
2009-01-21 19:49 ` Merging adjacent deleted lines? Robin Rosenberg
2009-01-21 21:08 ` Junio C Hamano
2009-01-22 10:57   ` Jonathan del Strother
2009-01-22 20:13     ` Robin Rosenberg
2009-01-23  7:18       ` Jay Soffian
2009-01-23 10:32         ` Robin Rosenberg
2009-01-23 15:51           ` Jay Soffian
2009-01-23 15:59             ` Jay Soffian

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=57518fd10901211120n62f8d0e9ya8595fc9baa6476c@mail.gmail.com \
    --to=maillist@steelskies.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 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).