From: Jonathan Nieder <jrnieder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: git-core: conflictstyle=diff3 doesn't actually use diff3 compatible format
Date: Sun, 7 Mar 2010 22:54:54 -0600 [thread overview]
Message-ID: <20100308045454.GA22672@progeny.tock> (raw)
In-Reply-To: <7vpr3itn89.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
>> I’d be interested to hear from xdiff people
>> whether it should be easy to add the ancestor name to the output.
>
> I don't think there was any xdiff people involved in this area.
>
> I suspect that our tools actually rely on the common ancestor markers not
> having any extra cruft after them, so it would be introducing a bug if you
> change this output without changing the places that read them (I know
> about "rerere", but there may be others).
I guess the relevant xdiff person was you. ;-)
Thank you for the quick response. On the xdiff level, it looks like
all that is needed is to pass the ancestor label as a member of struct
s_xmparam, and then fill_conflict_hunk() could respect that. Not
complicated at all.
For merge_trees() users, the ancestor label could be passed with
branch1 and branch2 in struct merge_options.
That leaves the question of merge_recursive(). With merge_recursive(),
there is more than one ancestor, so it is not completely clear what the
diff3 merge should do. Currently it writes something like this:
<<<<<<< HEAD
Conflict resolution is hard;
let's go shopping.
|||||||
<<<<<<< Temporary merge branch 1
Who knows whose this is?
|||||||
Ancient history.
=======
Another intermediate result.
>>>>>>> Temporary merge branch 2
=======
Git makes conflict resolution easy.
>>>>>>> topic
which is hard to read [1]. Probably it would be better to use a consolidated
common ancestor, by cocatenating the internal common ancestors; in this
simple case, that would look like this:
<<<<<<< HEAD
Conflict resolution is hard;
let's go shopping.
||||||||
Ancient history.
========
Git makes conflict resolution easy.
>>>>>>>> topic
What should be the label of this possibly fictional merge base?
Jonathan
[1] For people and for rerere. See http://bugs.debian.org/569645
next prev parent reply other threads:[~2010-03-08 4:55 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20100305215253.364.63583.reportbug@localhost>
2010-03-05 22:19 ` git-core: conflictstyle=diff3 doesn't actually use diff3 compatible format Jonathan Nieder
2010-03-05 22:31 ` Junio C Hamano
2010-03-06 12:57 ` Bert Wesarg
2010-03-06 19:03 ` Junio C Hamano
2010-03-08 4:54 ` Jonathan Nieder [this message]
2010-03-15 7:47 ` [PATCH/RFC 0/10] Add label for common ancestor to conflictstyle=diff3 Jonathan Nieder
2010-03-15 7:49 ` [PATCH 01/10] xdl_merge(): add optional ancestor label to diff3-style output Jonathan Nieder
2010-03-15 8:10 ` Junio C Hamano
2010-03-15 8:35 ` Jonathan Nieder
2010-03-15 8:37 ` Junio C Hamano
2010-03-15 7:51 ` [PATCH 02/10] merge-file --diff3: add a label for ancestor Jonathan Nieder
2010-03-15 7:52 ` [PATCH 03/10] ll_merge(): add ancestor label parameter for diff3-style output Jonathan Nieder
2010-03-15 7:55 ` [PATCH 04/10] checkout --conflict=diff3: add a label for ancestor Jonathan Nieder
2010-03-15 8:20 ` Junio C Hamano
2010-03-15 8:32 ` Jonathan Nieder
2010-03-15 7:56 ` [PATCH 05/10] merge_file(): add comment explaining behavior wrt conflict style Jonathan Nieder
2010-03-15 8:00 ` [PATCH 06/10] merge_trees(): add ancestor label parameter for diff3-style output Jonathan Nieder
2010-03-15 8:00 ` [PATCH 07/10] tests: document format of conflicts from checkout -m Jonathan Nieder
2010-03-15 8:01 ` [PATCH 08/10] checkout -m --conflict=diff3: add a label for ancestor Jonathan Nieder
2010-03-15 8:05 ` [PATCH 09/10] cherry-pick: " Jonathan Nieder
2010-03-15 8:07 ` [PATCH 10/10] merge-recursive: " Jonathan Nieder
2010-03-15 8:29 ` Junio C Hamano
2010-03-15 13:18 ` Stefan Monnier
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=20100308045454.GA22672@progeny.tock \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=monnier@iro.umontreal.ca \
/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).