ReleaseNotes.txt and merge conflicts

Lubomir I. Ivanov neolit123 at gmail.com
Mon Nov 27 17:13:58 PST 2017


On 28 November 2017 at 02:53, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
> On 28 November 2017 at 02:42, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
>> On 28 November 2017 at 02:07, Thiago Macieira <thiago at macieira.org> wrote:
>>> On Monday, 27 November 2017 15:18:19 PST Lubomir I. Ivanov wrote:
>>>> > Isn’t this what we are looking for:
>>>> >
>>>> > http://krlmlr.github.io/using-gitattributes-to-avoid-merge-conflicts/
>>>>
>>>> i think, yes. that's exactly what we are looking for.
>>>> i wonder if it would work with the current ReleaseNotes.txt layout
>>>> where lines are inserted at the bottom of a new release and on top of
>>>> old ones. i guess i can test it.
>>>
>>> Since we're using GitHub itself to do the merges, can you confirm that it does
>>> respect this .gitattributes attribute?
>>>
>>
>> i've just tried it a couple of times and it seems that it doesn't
>> support the `merge=union` attribute.
>> the github UI still gives "Can’t automatically merge".
>>
>
> i wrote that too fast,
>
> it seems that it doesn't like the layout of our ReleaseNotes or maybe
> it's something more specific.
> i got "merge=union" working with github when adding text at the top of
> the same file from two different merges / PRs.
>
> will investigate more.
>

.gitattributes
/ReleaseNotes.txt -text merge=union

so it seems that it doesn't like the layout of your file:
https://github.com/Subsurface-divelog/subsurface/blob/f39e9001862f0550bc126d5fa0cd57a16657f755/ReleaseNotes/ReleaseNotes.txt

if one adds on this line (per our layout) or at the bottom of the file:
https://github.com/Subsurface-divelog/subsurface/blob/f39e9001862f0550bc126d5fa0cd57a16657f755/ReleaseNotes/ReleaseNotes.txt#L27

instead of line 1:
https://github.com/Subsurface-divelog/subsurface/blob/f39e9001862f0550bc126d5fa0cd57a16657f755/ReleaseNotes/ReleaseNotes.txt#L1

it does't work and it creates a merge conflict.
so it only works if adding on top of the file...

to not have to change the layout of ReleaseNotes.txt, we can create a
new file called ReleaseNotesStub.txt (not a good name)
and make changes to it, where we instruct commits to add release notes
on line 1.

but i'm not sure how well it would work even if only adding on top of the file.

lubomir
--


More information about the subsurface mailing list