git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Merging adjacent deleted lines?
@ 2009-01-21 19:20 Jonathan del Strother
  2009-01-21 19:49 ` Robin Rosenberg
  2009-01-21 21:08 ` Junio C Hamano
  0 siblings, 2 replies; 9+ messages in thread
From: Jonathan del Strother @ 2009-01-21 19:20 UTC (permalink / raw)
  To: Git Mailing List

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

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

end of thread, other threads:[~2009-01-23 16:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-21 19:20 Merging adjacent deleted lines? Jonathan del Strother
2009-01-21 19:49 ` 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

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