git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: git@vger.kernel.org
Cc: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: [PATCH/RFC 0/10] Add label for common ancestor to conflictstyle=diff3
Date: Mon, 15 Mar 2010 02:47:48 -0500	[thread overview]
Message-ID: <20100315074748.GA28827@progeny.tock> (raw)
In-Reply-To: <20100305221950.GB5083@progeny.tock>

Jonathan Nieder wrote:
> Stefan Monnier wrote [1]:

>> I can't live without conflictstyle=diff3m and I'm very happy it exists.
>> But it has a little problem: it uses "|||||||\n" as a separator for the
>> ancestor version of the text, whereas diff3 uses "||||||| <ancestorname>\n".
>> The difference is harmless for a human (tho the <ancestorname> can sometimes
>> be useful, assuming it's meaningful), but it makes some tools fail to
>> recognize the conflict markers properly.
>> So please add a " BASE" or " ANCESTOR" after the "|||||||".
>
> No opinion on this myself.

I changed my mind; it looked like a useful and fun thing to do, so
here it is.

The bad news is that sometimes the labels for the ancestor are kind of
pointless, as in “merged common ancestors” for merge-recursive.  I am
not planning to improve this soon.  I’d be thrilled if someone changes
it to something like “merge of ac76d, 8d7ca9, and 81873”.

This patch series adds a label for the common ancestor to various
places git outputs conflict hunks:

 <<<<<<< ours
 Text from the current branch
 ||||||| original
 Text from the merge base
 =======
 Text from the remote branch
 >>>>>>> theirs

I am hoping this output will be more self explanatory, especially in
cases where it is not completely obvious to a naïve user what the
common ancestor would be, such as cherry-pick.

This passes all tests here and I tried to find any untested in-tree
consumers of conflict hunks that would be affected to make sure it
would be safe.  I would like to see it get some testing on other
machines, especially by people using merge tools and other programs
that parse conflicts.

Thoughts?
Jonathan Nieder (10):
  xdl_merge(): add optional ancestor label to diff3-style output
  merge-file --diff3: add a label for ancestor
  ll_merge(): add ancestor label parameter for diff3-style output
  checkout --conflict=diff3: add a label for ancestor
  merge_file(): add comment explaining behavior wrt conflict style
  merge_trees(): add ancestor label parameter for diff3-style output
  tests: document format of conflicts from checkout -m
  checkout -m --conflict=diff3: add a label for ancestor
  cherry-pick: add a label for ancestor
  merge-recursive: add a label for ancestor

 builtin/checkout.c    |    3 +-
 builtin/merge-file.c  |    1 +
 builtin/revert.c      |    1 +
 ll-merge.c            |   20 ++++++++------
 ll-merge.h            |    2 +-
 merge-file.c          |    8 +++++-
 merge-recursive.c     |   12 ++++++--
 merge-recursive.h     |    1 +
 rerere.c              |    4 +-
 t/t6023-merge-file.sh |    2 +-
 t/t7201-co.sh         |   69 ++++++++++++++++++++++++++++++++++++++++++++----
 xdiff/xdiff.h         |    1 +
 xdiff/xmerge.c        |   16 ++++++++++-
 13 files changed, 114 insertions(+), 26 deletions(-)

[1] http://bugs.debian.org/572720

  parent reply	other threads:[~2010-03-15  7:47 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
2010-03-15  7:47   ` Jonathan Nieder [this message]
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=20100315074748.GA28827@progeny.tock \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --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).