public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: Bert Wesarg <bert.wesarg@googlemail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH, stage1] Better error recovery for merge-conflict markers
Date: Wed, 10 Feb 2016 17:42:00 -0000	[thread overview]
Message-ID: <1455126155.18873.30.camel@redhat.com> (raw)
In-Reply-To: <CAKPyHN1z1C6Vw3t9+CgejT+nVMSrTk8Dx5C=cnTzNqA6htx4PQ@mail.gmail.com>

On Mon, 2016-02-08 at 10:07 +0100, Bert Wesarg wrote:
> David,
> 
> On Thu, Apr 9, 2015 at 10:29 AM, Bert Wesarg <
> bert.wesarg@googlemail.com> wrote:
> > Hi David,
> > 
> > > Various tools that operate on source code files will inject
> > > markers
> > > into them when an unfixable conflict occurs in a merger.
> > > 
> > > There appears to be no blessed standard for these conflict
> > > markers,
> > > but an ad-hoc convention is for 7 '<' , '=', or '>' characters at
> > > the start of a line, followed optionally by a space and optional
> > > text
> > > 
> > > e.g.:
> > > <<<<<<< HEAD
> > > extern int some_var;
> > > =======
> > > extern short some_var;
> > > > > > > > > > Some other branch
> > > 
> > > This convention is followed by GNU patch:
> > >   http://git.savannah.gnu.org/cgit/patch.git/tree/src/merge.c
> > > by git:
> > > 
> > > http://git.kernel.org/cgit/git/git.git/tree/Documentation/merge-c
> > > onfig.txt
> > > and by various other tools.
> > 
> > 
> > if you read both of these tools carefully, you will notice an
> > alternative
> > conflict style (named 'diff3' in both of them), that includes a
> > third
> > section, the common pre-image. Here is an example:
> > 
> > <<<<<<< HEAD
> > extern int some_var;
> > > > > > > > > merge base
> > extern int var;
> > =======
> > extern short var;
> > > > > > > > > 
> > > > > > > > > Some other branch
> > 
> > 
> > Additionally, git supports a custom conflict-marker-size to change
> > the
> > default of 7 on a per file name (the conflict-marker-size
> > attribute). So it
> > may be worthwhile to support other sizes than 7 in this patch too.
> 
> you never commentewd on my mail, but I saw this now in trunk. I can
> only repeat myself here.

Thanks.  FWIW I did read your mail, and it was a factor in me proposing
this alternate implementation which would be more flexible:
https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01515.html
but that implementation had the drawback of not working with .i files
from -save-temps, so we went with the original approach.

  reply	other threads:[~2016-02-10 17:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20 15:38 David Malcolm
2015-03-20 17:50 ` Joseph Myers
2015-04-17 21:47   ` David Malcolm
2015-05-07 21:56     ` Joseph Myers
2015-04-09  8:29 ` Bert Wesarg
2016-02-08  9:07   ` Bert Wesarg
2016-02-10 17:42     ` David Malcolm [this message]
2015-03-20 18:09 Manuel López-Ibáñez

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=1455126155.18873.30.camel@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=bert.wesarg@googlemail.com \
    --cc=gcc-patches@gcc.gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).