{"thread":{"id":"62064","subject":"How do git recognize conflicts?","startedAt":"2024-09-05T14:10:59Z","lastAt":"2024-09-06T08:36:17Z","messageCount":4,"participants":["KwonHyun Kim","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"502238","messageId":"CADLV-7K-D8ydFfeojv7EuhxBqKWsVYLofXJji+Y5rUTA8JEQ7w@mail.gmail.com","threadId":"62064","inReplyTo":null,"subject":"How do git recognize conflicts?","fromName":"KwonHyun Kim","fromEmail":"kwonhyun.kim@gmail.com","sentAt":"2024-09-05T14:10:46Z","receivedAt":"2024-09-05T14:10:59Z","isPatch":false,"sender":{"key":"kwonhyun.kim@gmail.com","avatar":null},"body":" Hi, there.\n\n At first, I thought it's determined by line.\n\n But as I experimented, it does not look so.\n\n Here's what I experimented\n\n merge-base ====\n\n hi all\n\n branch BrA ===\n\n hi everyone\n\n branch BrB ===\n\n hi all\n good to see you\n\n when I merge BrB from BrA, I get conflicts.\n\n but the first line is only changed in BrA,\n and BrB added a line so there is no reason to have a conflict...\n that's what i think\n\n and I wonder the algorithm how git recognizes the conflict... or how\ngit automerges...\n I searched internet, git documentation but to no avail.\n\n Thank you in advance\n\n KwH Kim\n"},{"id":"502257","messageId":"cbc0019a-682a-4cec-8a06-24b12060a692@kdbg.org","threadId":"62064","inReplyTo":"CADLV-7K-D8ydFfeojv7EuhxBqKWsVYLofXJji+Y5rUTA8JEQ7w@mail.gmail.com","subject":"Re: How do git recognize conflicts?","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2024-09-05T16:39:23Z","receivedAt":"2024-09-05T16:39:28Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 05.09.24 um 16:10 schrieb KwonHyun Kim:\n>  Hi, there.\n> \n>  At first, I thought it's determined by line.\n> \n>  But as I experimented, it does not look so.\n> \n>  Here's what I experimented\n> \n>  merge-base ====\n> \n>  hi all\n> \n>  branch BrA ===\n> \n>  hi everyone\n> \n>  branch BrB ===\n> \n>  hi all\n>  good to see you\n> \n>  when I merge BrB from BrA, I get conflicts.\n> \n>  but the first line is only changed in BrA,\n>  and BrB added a line so there is no reason to have a conflict...\n>  that's what i think\n\nIf the changes in the two branches are in adjacent lines, then that is\nconsidered a conflict as well.\n\n-- Hannes\n\n"},{"id":"502307","messageId":"39f85eac-c6af-444a-a514-ad7172748350@kdbg.org","threadId":"62064","inReplyTo":"CADLV-7K7uumH+ikT6B2H39XR-eX21xBzUSNbeyVv2wM2q1e=QQ@mail.gmail.com","subject":"Re: How do git recognize conflicts?","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2024-09-06T07:03:24Z","receivedAt":"2024-09-06T07:03:34Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Please use \"Reply to all\" on this mailing list and please do not top-post.\n\nAm 06.09.24 um 07:09 schrieb KwonHyun Kim:\n>   Thank you for the answer,\n> \n>   Is there any other exceptions from line-by-line change?\n> \n>   Can I ask you of any reference?\n\nAnother \"exception\" would be a modify-delete conflict, i.e., where one\nside modifies the file and the other deletes it.\n\nApart from that, you would have to dig into the source code.\n\n-- Hannes\n\n> \n> -- KwH Kim\n> \n> 2024년 9월 6일 (금) 오전 1:39, Johannes Sixt <j6t@kdbg.org>님이 작성:\n> \n>>\n>> Am 05.09.24 um 16:10 schrieb KwonHyun Kim:\n>>>  Hi, there.\n>>>\n>>>  At first, I thought it's determined by line.\n>>>\n>>>  But as I experimented, it does not look so.\n>>>\n>>>  Here's what I experimented\n>>>\n>>>  merge-base ====\n>>>\n>>>  hi all\n>>>\n>>>  branch BrA ===\n>>>\n>>>  hi everyone\n>>>\n>>>  branch BrB ===\n>>>\n>>>  hi all\n>>>  good to see you\n>>>\n>>>  when I merge BrB from BrA, I get conflicts.\n>>>\n>>>  but the first line is only changed in BrA,\n>>>  and BrB added a line so there is no reason to have a conflict...\n>>>  that's what i think\n>>\n>> If the changes in the two branches are in adjacent lines, then that is\n>> considered a conflict as well.\n>>\n>> -- Hannes\n>>\n\n"},{"id":"502311","messageId":"CADLV-7+YxrXX4iOA6dHMtv3gGxyy9FBbzCDQ2SkjejkyGe2iKQ@mail.gmail.com","threadId":"62064","inReplyTo":"39f85eac-c6af-444a-a514-ad7172748350@kdbg.org","subject":"Re: How do git recognize conflicts?","fromName":"KwonHyun Kim","fromEmail":"kwonhyun.kim@gmail.com","sentAt":"2024-09-06T08:36:05Z","receivedAt":"2024-09-06T08:36:17Z","isPatch":false,"sender":{"key":"kwonhyun.kim@gmail.com","avatar":null},"body":"  Sure, I am replying to all,\n\n  Anyhow, modify-delete conflict seems to be a legitimate conflict to me...\n\n  How come it is an exception to line-by-line conflicts(conflict only\nwhen the same line is modified by both)?\n\n  In one version some lines are modified and in the other version all\nare deleted\n\n  -- KwH Kim\n\n\n2024년 9월 6일 (금) 오후 4:03, Johannes Sixt <j6t@kdbg.org>님이 작성:\n>\n> Please use \"Reply to all\" on this mailing list and please do not top-post.\n>\n> Am 06.09.24 um 07:09 schrieb KwonHyun Kim:\n> >   Thank you for the answer,\n> >\n> >   Is there any other exceptions from line-by-line change?\n> >\n> >   Can I ask you of any reference?\n>\n> Another \"exception\" would be a modify-delete conflict, i.e., where one\n> side modifies the file and the other deletes it.\n>\n> Apart from that, you would have to dig into the source code.\n>\n> -- Hannes\n>\n> >\n> > -- KwH Kim\n> >\n> > 2024년 9월 6일 (금) 오전 1:39, Johannes Sixt <j6t@kdbg.org>님이 작성:\n> >\n> >>\n> >> Am 05.09.24 um 16:10 schrieb KwonHyun Kim:\n> >>>  Hi, there.\n> >>>\n> >>>  At first, I thought it's determined by line.\n> >>>\n> >>>  But as I experimented, it does not look so.\n> >>>\n> >>>  Here's what I experimented\n> >>>\n> >>>  merge-base ====\n> >>>\n> >>>  hi all\n> >>>\n> >>>  branch BrA ===\n> >>>\n> >>>  hi everyone\n> >>>\n> >>>  branch BrB ===\n> >>>\n> >>>  hi all\n> >>>  good to see you\n> >>>\n> >>>  when I merge BrB from BrA, I get conflicts.\n> >>>\n> >>>  but the first line is only changed in BrA,\n> >>>  and BrB added a line so there is no reason to have a conflict...\n> >>>  that's what i think\n> >>\n> >> If the changes in the two branches are in adjacent lines, then that is\n> >> considered a conflict as well.\n> >>\n> >> -- Hannes\n> >>\n>\n"}]}