# Conflict-free merging (i.e. concat) of conflicting branches?

5 messages from 2008-11-16 to 2008-11-16. Participants: Richard Hartmann, Samuel Tardieu, Junio C Hamano.
Thread: https://gitlist.dev/t/16350

## Richard Hartmann, 2008-11-16 13:50

Subject: Conflict-free merging (i.e. concat) of conflicting branches?
Message-ID: <2d460de70811160550g75e50e00gb50d3b2045c460af@mail.gmail.com>
URL: https://gitlist.dev/e/2d460de70811160550g75e50e00gb50d3b2045c460af%40mail.gmail.com

```
Please keep the CC intact if possible.

Hi all,

the vim_extended repo, a collection of patchsets against Vim,
allows users to merge different patchsets on top of a current
vanilla Vim. To keep track of which patches are merged, we
would want to use a special variable designated by Vim for
this purpose.

For example, branch a would have file foo with line 100:

$patches .= " with_patch_a";

branch b would have file foo with line 100:

$patches .= " with_patch_b";

etc, etc.

The question is if there is a way to to merge these
branches in a way that is conflict-free and includes
all lines. Obviously, the order of the lines is irrelevant
and can be random.


Thanks for all thoughts,
Richard

```

## Samuel Tardieu, 2008-11-16 14:19

Subject: Re: Conflict-free merging (i.e. concat) of conflicting branches?
Message-ID: <2008-11-16-15-19-47+trackit+sam@rfc1149.net>
URL: https://gitlist.dev/e/2008-11-16-15-19-47%2Btrackit%2Bsam%40rfc1149.net
In-Reply-To: <2d460de70811160550g75e50e00gb50d3b2045c460af@mail.gmail.com>

```
>>>>> "Richard" == Richard Hartmann <richih.mailinglist@gmail.com> writes:

Richard> The question is if there is a way to to merge these branches
Richard> in a way that is conflict-free and includes all
Richard> lines. Obviously, the order of the lines is irrelevant and
Richard> can be random.

You can use a custom merge driver especially designed for this case.
See gitattributes(5) man page for an explanation of how it works.

  Sam
-- 
Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/

```

## Junio C Hamano, 2008-11-16 16:28

Subject: Re: Conflict-free merging (i.e. concat) of conflicting branches?
Message-ID: <7viqqn4ouo.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7viqqn4ouo.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <2d460de70811160550g75e50e00gb50d3b2045c460af@mail.gmail.com>

```
"Richard Hartmann" <richih.mailinglist@gmail.com> writes:

> The question is if there is a way to to merge these
> branches in a way that is conflict-free and includes
> all lines. Obviously, the order of the lines is irrelevant
> and can be random.

gitattributes(5) and look for "union"?

```

## Richard Hartmann, 2008-11-16 21:43

Subject: Re: Conflict-free merging (i.e. concat) of conflicting branches?
Message-ID: <2d460de70811161343w52a9a4deo7c8d9bb155514de0@mail.gmail.com>
URL: https://gitlist.dev/e/2d460de70811161343w52a9a4deo7c8d9bb155514de0%40mail.gmail.com
In-Reply-To: <2008-11-16-15-19-47+trackit+sam@rfc1149.net>

```
On Sun, Nov 16, 2008 at 15:19, Samuel Tardieu <sam@rfc1149.net> wrote:

> You can use a custom merge driver especially designed for this case.
> See gitattributes(5) man page for an explanation of how it works.

Thanks.


Richard

```

## Richard Hartmann, 2008-11-16 21:44

Subject: Re: Conflict-free merging (i.e. concat) of conflicting branches?
Message-ID: <2d460de70811161344n58cfb045n79b567493fef6a90@mail.gmail.com>
URL: https://gitlist.dev/e/2d460de70811161344n58cfb045n79b567493fef6a90%40mail.gmail.com
In-Reply-To: <7viqqn4ouo.fsf@gitster.siamese.dyndns.org>

```
On Sun, Nov 16, 2008 at 17:28, Junio C Hamano <gitster@pobox.com> wrote:

> gitattributes(5) and look for "union"?

Thanks.


Richard

```
