git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Adilson de Almeida Junior <adilson.smem@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Merge behavior with merge.conflictStyle diff3
Date: Tue, 18 Dec 2018 13:01:59 -0500	[thread overview]
Message-ID: <20181218180158.GC31070@sigill.intra.peff.net> (raw)
In-Reply-To: <CAKmxmfosaExDYNyoaNg2teHMzsu3JJ3bqiLhrAaUt0Jt473Phw@mail.gmail.com>

On Tue, Dec 18, 2018 at 03:34:20PM -0200, Adilson de Almeida Junior wrote:

> I guess, most times the second behavior is the expected: two conflict
> hunks, not only the divvergent pieces (this case, the second line) of
> them. By the doc:
> 
> merge.conflictStyle
> 
>     Specify the style in which conflicted hunks are written out to
> working tree files upon merge. The default is "merge", which shows a
> [[[[[[[ conflict marker, changes made by one side, a ======= marker,
> changes made by the other side, and then a ]]]]]]] marker. An
> alternate style, "diff3", adds a ||||||| marker and the original text
> before the ======= marker.
> 
> I replaced the 'lower than' and 'greater than' symbols by 'open n
> close square brackets' to avoid antivirus.
> 
> Is this a bug, or something I missunderstood from git docs?

This is the expected behavior. There's some philosophical discussion
about the correct thing to do here in this thread (that message and its
replies, but the whole thread is an interesting read):

  https://public-inbox.org/git/7vvc94p8hb.fsf@alter.siamese.dyndns.org/

Note that there is a patch in that thread to implement "zdiff3", which
does what you want. I've been rebasing it and running with it for
several years now. You can get my rebased version by fetching:

  https://github.com/peff/git ukk/zdiff3

But note that I think it may have a subtle bug, as I have once or twice
over the years seen it cause a segfault.

-Peff

      reply	other threads:[~2018-12-18 18:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18 17:34 Merge behavior with merge.conflictStyle diff3 Adilson de Almeida Junior
2018-12-18 18:01 ` Jeff King [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181218180158.GC31070@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=adilson.smem@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).