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

Bert

Reply via email to