threads / discuss / 53952

Git union issue

Subject: Git union issue

## tl;dr

3 messages between Jul 30, 2020 and Jul 31, 2020.

replies: 2people: 3as markdown or json

Bram Huenaerts· Jul 30, 2020, 18:29 UTC · lore
Goodafternoon, 
while trying to reduce conflicts on a changelog file, i tried eliminating conflicts using the .gitattributes with union defined for the CHANGELOG_UPCOMING.md file. I included the steps to come to this very strange issue. In the enclosed PDF, I tried to specify all the commands so it is easy to reproduce this strange issue which I hope is not a works as designed.
In case still something not clear. I’m happy to assist.
Kind regards,
Bram Huenaerts
brian m. carlson· Jul 31, 2020, 01:05 UTC · re: Bram Huenaerts · lore

Re: Git union issue

On 2020-07-30 at 18:29:10, Bram Huenaerts wrote:
Show 8 quoted lines
> Goodafternoon,
> 
> while trying to reduce conflicts on a changelog file, i tried
> eliminating conflicts using the .gitattributes with union defined for
> the CHANGELOG_UPCOMING.md file. I included the steps to come to this
> very strange issue. In the enclosed PDF, I tried to specify all the
> commands so it is easy to reproduce this strange issue which I hope is
> not a works as designed.

In general, folks on this list much prefer it if you include your text in the body of the message as plain text instead of using PDFs. You may get more responses in the future if you include the text inline, since folks will be more likely to read your message. (I was personally surprised to see the list accepted PDFs; I did not think it would.)

I'm not an expert on the merge machinery and especially not on the union algorithm, but I believe what you're seeing here is due to using a merge-based rebase. In this case, your rebase is removing lines a and b on one side, but the other side has y, a, and b. Instead of a conflict, you're getting the union: y, a, and b. If you have an empty set of feature lines on one side, and a set with some items on the other, then the union is the latter set.

I agree this is not especially useful and probably not what you wanted. The documentation does state, "Do not use this if you do not understand the implications," implying that it's tricky to understand, so I'm not surprised that it's confusing or has unexpected behavior.

Of course, someone with more familiarity with the merge machinery or this option may have a better explanation for this than I do, or possibly a patch if I've misunderstood and this option is broken. Hopefully some such person will chime in.

-- 
brian m. carlson: Houston, Texas, US
Junio C Hamano· Jul 31, 2020, 02:12 UTC · re: brian m. carlson · lore

Re: Git union issue

"brian m. carlson" <sandals@crustytoothpaste.net> writes:
> folks will be more likely to read your message.  (I was personally
> surprised to see the list accepted PDFs; I did not think it would.)

I am surprised too, and immediately after I saw *.pdf attachment, I discarded the message to the trash, thinking it is a phishing attempt or something similar.

← back to recent threads