{"thread":{"id":"18477","subject":"Merge format documented?","startedAt":"2009-03-23T03:19:49Z","lastAt":"2009-03-27T16:05:31Z","messageCount":6,"participants":["Andreas Gruenbacher","Junio C Hamano","Johannes Sixt","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"108994","messageId":"200903230419.50000.agruen@suse.de","threadId":"18477","inReplyTo":null,"subject":"Merge format documented?","fromName":"Andreas Gruenbacher","fromEmail":"agruen@suse.de","sentAt":"2009-03-23T03:19:49Z","receivedAt":"2009-03-23T03:19:49Z","isPatch":false,"sender":{"key":"agruen@suse.de","avatar":null},"body":"Hello,\n\nis the format that git normally uses for indicating merge conflicts in files \n(the <<< === >>> markers) documented somewhere?  How exactly does it differ \nfrom the diff3 format (<<< ||| === >>>)?  Diff3's -m mode seems to come close \nto what git does, except that git doesn't produce the ||| section:\n\n\t$ seq 1 7 > a\n\t$ seq 1 7 | sed -e 's/4/4b/' > b\n\t$ seq 1 7 | sed -e 's/3/3c/' > c\n\t$ diff3 -m c a b\n\t> 1\n\t> 2\n\t> <<<<<<< c\n\t> 3c\n\t> 4\n\t> ||||||| a\n\t> 3\n\t> 4\n\t> =======\n\t> 3\n\t> 4b\n\t> >>>>>>> b\n\t> 5\n\t> 6\n\t> 7\n\nGit's output in this case is:\n\n\t> 1\n\t> 2\n\t> <<<<<<< this-branch\n\t> 3c\n\t> 4\n\t> =======\n\t> 3\n\t> 4b\n\t> >>>>>>> merged-branch\n\t> 5\n\t> 6\n\t> 7\n\nDoes git ever output a ||| section?\n\nThanks,\nAndreas\n"},{"id":"108997","messageId":"7vtz5k99tr.fsf@gitster.siamese.dyndns.org","threadId":"18477","inReplyTo":"200903230419.50000.agruen@suse.de","subject":"Re: Merge format documented?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-23T03:50:24Z","receivedAt":"2009-03-23T03:50:24Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Gruenbacher <agruen@suse.de> writes:\n\n> is the format that git normally uses for indicating merge conflicts in files \n> (the <<< === >>> markers) documented somewhere?  How exactly does it differ \n> from the diff3 format (<<< ||| === >>>)?  Diff3's -m mode seems to come close \n> to what git does, except that git doesn't produce the ||| section:\n\nIt is an imitation of output from \"merge\" program of RCS suite Paul you\nknow maintains ;-)  Recent versions of git supports merge.conflictstyle\nconfiguration variable and --conflict option in 'git-checkout' to write\nthe conflicts out in a format that is an imitation of \"diff3 -m\" output.\n\nAs far as I know, neither \"git\" format is documented anywhere, but I\ndidn't find an official format specification of the \"upstream\" formats,\nand that is why I keep saying \"imitation\" in the above paragraph ;-)\n"},{"id":"109005","messageId":"200903230818.20044.agruen@suse.de","threadId":"18477","inReplyTo":"7vtz5k99tr.fsf@gitster.siamese.dyndns.org","subject":"Re: Merge format documented?","fromName":"Andreas Gruenbacher","fromEmail":"agruen@suse.de","sentAt":"2009-03-23T07:18:19Z","receivedAt":"2009-03-23T07:18:19Z","isPatch":false,"sender":{"key":"agruen@suse.de","avatar":null},"body":"On Monday, 23 March 2009 4:50:24 Junio C Hamano wrote:\n> Andreas Gruenbacher <agruen@suse.de> writes:\n> > is the format that git normally uses for indicating merge conflicts in\n> > files (the <<< === >>> markers) documented somewhere?  How exactly does\n> > it differ from the diff3 format (<<< ||| === >>>)?  Diff3's -m mode seems\n> > to come close to what git does, except that git doesn't produce the |||\n> > section:\n>\n> It is an imitation of output from \"merge\" program of RCS suite Paul you\n> know maintains ;-)\n\nSo it's the same format except that diff3's ||| section isn't shown. I was \nwondering if there are any additional tricks.\n\nPatch should support that too, even from the more limited information it has.\n\n> Recent versions of git supports merge.conflictstyle \n> configuration variable and --conflict option in 'git-checkout' to write\n> the conflicts out in a format that is an imitation of \"diff3 -m\" output.\n>\n> As far as I know, neither \"git\" format is documented anywhere, but I\n> didn't find an official format specification of the \"upstream\" formats,\n> and that is why I keep saying \"imitation\" in the above paragraph ;-)\n\nThe diff info pages describe the diff3 format; that may be enough \ndocumentation:\n\n  info -f diff -n \"Marking Conflicts\"\n\nThanks,\nAndreas\n"},{"id":"109006","messageId":"7viqm08ymb.fsf@gitster.siamese.dyndns.org","threadId":"18477","inReplyTo":"200903230818.20044.agruen@suse.de","subject":"Re: Merge format documented?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-23T07:52:28Z","receivedAt":"2009-03-23T07:52:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Gruenbacher <agruen@suse.de> writes:\n\n> On Monday, 23 March 2009 4:50:24 Junio C Hamano wrote:\n>> Andreas Gruenbacher <agruen@suse.de> writes:\n>> > is the format that git normally uses for indicating merge conflicts in\n>> > files (the <<< === >>> markers) documented somewhere?  How exactly does\n>> > it differ from the diff3 format (<<< ||| === >>>)?  Diff3's -m mode seems\n>> > to come close to what git does, except that git doesn't produce the |||\n>> > section:\n>>\n>> It is an imitation of output from \"merge\" program of RCS suite Paul you\n>> know maintains ;-)\n>\n> So it's the same format except that diff3's ||| section isn't shown. I was \n> wondering if there are any additional tricks.\n\nNo additional tricks.\n\nAs far as I can remember, the format was not really chosen, but simply\nfell out as a natural consequence of using \"merge\" rather than \"diff3\" as\na merge backend (we originally used to invoke \"merge\" from RCS suite\ninstead of performing file-level merges ourselves), but we could say we\nchose \"merge\" over \"diff3 -m\" because the output format should be more\nfamiliar than the diff3-m format with |||, especially to anybody who came\nfrom subversion or CVS background.\n"},{"id":"109023","messageId":"49C75393.3030700@viscovery.net","threadId":"18477","inReplyTo":"7viqm08ymb.fsf@gitster.siamese.dyndns.org","subject":"Re: Merge format documented?","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-03-23T09:17:07Z","receivedAt":"2009-03-23T09:17:07Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Junio C Hamano schrieb:\n> Andreas Gruenbacher <agruen@suse.de> writes:\n> \n>> On Monday, 23 March 2009 4:50:24 Junio C Hamano wrote:\n>>> Andreas Gruenbacher <agruen@suse.de> writes:\n>>>> is the format that git normally uses for indicating merge conflicts in\n>>>> files (the <<< === >>> markers) documented somewhere?  How exactly does\n>>>> it differ from the diff3 format (<<< ||| === >>>)?  Diff3's -m mode seems\n>>>> to come close to what git does, except that git doesn't produce the |||\n>>>> section:\n>>> It is an imitation of output from \"merge\" program of RCS suite Paul you\n>>> know maintains ;-)\n>> So it's the same format except that diff3's ||| section isn't shown. I was \n>> wondering if there are any additional tricks.\n> \n> No additional tricks.\n\nI think there's one additional trick: git moves common parts of the\nconflict section outside of the conflict markers, and it even splits the\nsections into two if there are common parts between two conflicting lines.\n\n(But that doesn't change how the conflict markers look.)\n\n-- Hannes\n"},{"id":"109658","messageId":"m3y6ur0x4m.fsf@localhost.localdomain","threadId":"18477","inReplyTo":"200903230419.50000.agruen@suse.de","subject":"Re: Merge format documented?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-03-27T16:05:31Z","receivedAt":"2009-03-27T16:05:31Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Andreas Gruenbacher <agruen@suse.de> writes:\n\n> Hello,\n> \n> is the format that git normally uses for indicating merge conflicts in files \n> (the <<< === >>> markers) documented somewhere?  How exactly does it differ \n> from the diff3 format (<<< ||| === >>>)?  Diff3's -m mode seems to come close \n> to what git does, except that git doesn't produce the ||| section:\n\nIt is rcmerge / merge from RCS / CVS output format (and I think it is\nalso format used for other VCS), and IIRC it is equivalent to \"diff3\n-E\" format\n\n> Does git ever output a ||| section?\n\nYou can ask for it with merge.conflictstyle configuration variable, or\n--conflict=<style> option to git-checkout.\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"}]}