{"thread":{"id":"19392","subject":"Merging a branch when I don't want conflicts","startedAt":"2009-05-18T02:30:46Z","lastAt":"2009-05-18T23:53:54Z","messageCount":8,"participants":["Geoff Russell","Johannes Sixt","Nanako Shiraishi","Tay Ray Chuan","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"114148","messageId":"93c3eada0905171930m36765d4fued9c2efdc57e51a4@mail.gmail.com","threadId":"19392","inReplyTo":null,"subject":"Merging a branch when I don't want conflicts","fromName":"Geoff Russell","fromEmail":"geoffrey.russell@gmail.com","sentAt":"2009-05-18T02:30:46Z","receivedAt":"2009-05-18T02:30:46Z","isPatch":false,"sender":{"key":"geoffrey.russell@gmail.com","avatar":"https://gravatar.com/avatar/c30f497ccfa6bf06d86f30bd2ba092a2dd124c61c6bc902f7cb5c3f6486947de?d=mp&s=160"},"body":"How do I merge a branch X into my master and tell git that whenever there\nis a conflict, the file on X should prevail?  This is for a scripted\napplication.\n\nCheers,\nGeoff\n"},{"id":"114156","messageId":"4A10FDC6.2040706@viscovery.net","threadId":"19392","inReplyTo":"93c3eada0905171930m36765d4fued9c2efdc57e51a4@mail.gmail.com","subject":"Re: Merging a branch when I don't want conflicts","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-05-18T06:18:46Z","receivedAt":"2009-05-18T06:18:46Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Geoff Russell schrieb:\n> How do I merge a branch X into my master and tell git that whenever there\n> is a conflict, the file on X should prevail?  This is for a scripted\n> application.\n\nI assume you talk about file-level (content) merges.\n\nThere is no such tool, and the reason is that what you try to do here does\nnot make sense *in general*. It must be a very special kind of project\nwhere you can blindly trust one side over the other if there are\nconflicts, and that you can additionally trust non-conflicting content merges.\n\nThe best you can do is perhaps to pipe conflicting files through\n\n    sed -e '/^<<<<<<</,/^=======/d' -e '/^>>>>>>>/d'\n\n-- Hannes\n"},{"id":"114161","messageId":"93c3eada0905180105n641614eodb0469dceca20bc9@mail.gmail.com","threadId":"19392","inReplyTo":"4A10FDC6.2040706@viscovery.net","subject":"Re: Merging a branch when I don't want conflicts","fromName":"Geoff Russell","fromEmail":"geoffrey.russell@gmail.com","sentAt":"2009-05-18T08:05:46Z","receivedAt":"2009-05-18T08:05:46Z","isPatch":false,"sender":{"key":"geoffrey.russell@gmail.com","avatar":"https://gravatar.com/avatar/c30f497ccfa6bf06d86f30bd2ba092a2dd124c61c6bc902f7cb5c3f6486947de?d=mp&s=160"},"body":"On 5/18/09, Johannes Sixt <j.sixt@viscovery.net> wrote:\n> Geoff Russell schrieb:\n>\n> > How do I merge a branch X into my master and tell git that whenever there\n>  > is a conflict, the file on X should prevail?  This is for a scripted\n>  > application.\n>\n>\n> I assume you talk about file-level (content) merges.\n\nYes.\n\n>\n>  There is no such tool, and the reason is that what you try to do here does\n>  not make sense *in general*. It must be a very special kind of project\n>  where you can blindly trust one side over the other if there are\n>  conflicts, and that you can additionally trust non-conflicting content merges.\n\nThe file is data coming out of an interactive program which reads\nthe entire file, edits and then writes the entire file at which point\nthis file is correct\nand all previous versions are obsolete.  I don't really want a merge\nat all, but just\nwant to replace the file in the master with the version on the branch.\n\nThanks anyway.\n\nCheers,\nGeoff.\n\n>\n>  The best you can do is perhaps to pipe conflicting files through\n>\n>     sed -e '/^<<<<<<</,/^=======/d' -e '/^>>>>>>>/d'\n>\n>  -- Hannes\n>\n>\n\n\n-- \n6 Fifth Ave,\nSt Morris, S.A. 5068\nAustralia\nPh: 041 8805 184 / 08 8332 5069\n"},{"id":"114169","messageId":"4A112404.6060004@viscovery.net","threadId":"19392","inReplyTo":"93c3eada0905180105n641614eodb0469dceca20bc9@mail.gmail.com","subject":"Re: Merging a branch when I don't want conflicts","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-05-18T09:01:56Z","receivedAt":"2009-05-18T09:01:56Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Geoff Russell schrieb:\n> The file is data coming out of an interactive program which reads\n> the entire file, edits and then writes the entire file at which point\n> this file is correct\n> and all previous versions are obsolete.  I don't really want a merge\n> at all, but just\n> want to replace the file in the master with the version on the branch.\n\nAh, so finally you say what you mean ;)\n\nYou can define a custom merge driver that always returns the content of\nthe second branch. See 'man gitattributes'.\n\n-- Hannes\n"},{"id":"114174","messageId":"20090518194548.6117@nanako3.lavabit.com","threadId":"19392","inReplyTo":"4A10FDC6.2040706@viscovery.net","subject":"Re: Merging a branch when I don't want conflicts","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2009-05-18T10:45:48Z","receivedAt":"2009-05-18T10:45:48Z","isPatch":false,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Quoting Johannes Sixt <j.sixt@viscovery.net>:\n\n> Geoff Russell schrieb:\n>> How do I merge a branch X into my master and tell git that whenever there\n>> is a conflict, the file on X should prevail?  This is for a scripted\n>> application.\n>\n> I assume you talk about file-level (content) merges.\n>\n> There is no such tool, and the reason is that what you try to do here does\n> not make sense *in general*. It must be a very special kind of project\n> where you can blindly trust one side over the other if there are\n> conflicts, and that you can additionally trust non-conflicting content merges.\n>\n> The best you can do is perhaps to pipe conflicting files through\n>\n>     sed -e '/^<<<<<<</,/^=======/d' -e '/^>>>>>>>/d'\n>\n> -- Hannes\n\nI think -Xours enhancement that was developed long time ago\n\n    http://thread.gmane.org/gmane.comp.version-control.git/76650/focus=89021\n\nshould help Geoff's use case.\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"},{"id":"114189","messageId":"be6fef0d0905180857y538b2c4y7208faa147a57601@mail.gmail.com","threadId":"19392","inReplyTo":"20090518194548.6117@nanako3.lavabit.com","subject":"Re: Merging a branch when I don't want conflicts","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-05-18T15:57:54Z","receivedAt":"2009-05-18T15:57:54Z","isPatch":false,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Mon, May 18, 2009 at 6:45 PM, Nanako Shiraishi <nanako3@lavabit.com> wrote:\n> I think -Xours enhancement that was developed long time ago\n\nI think this is now called -s ours/--strategy=ours:\n\nhttp://www.kernel.org/pub/software/scm/git/docs/git-merge.html\n\n-- \nCheers,\nRay Chuan\n"},{"id":"114191","messageId":"7v8wkucrnn.fsf@alter.siamese.dyndns.org","threadId":"19392","inReplyTo":"be6fef0d0905180857y538b2c4y7208faa147a57601@mail.gmail.com","subject":"Re: Merging a branch when I don't want conflicts","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-18T16:17:00Z","receivedAt":"2009-05-18T16:17:00Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Tay Ray Chuan <rctay89@gmail.com> writes:\n\n> Hi,\n>\n> On Mon, May 18, 2009 at 6:45 PM, Nanako Shiraishi <nanako3@lavabit.com> wrote:\n>> I think -Xours enhancement that was developed long time ago\n>\n> I think this is now called -s ours/--strategy=ours:\n>\n> http://www.kernel.org/pub/software/scm/git/docs/git-merge.html\n\nRead it again.  -Xours is very different from -s ours.\n"},{"id":"114216","messageId":"93c3eada0905181653r2694550djd2e0f75de22c156d@mail.gmail.com","threadId":"19392","inReplyTo":"4A112404.6060004@viscovery.net","subject":"Re: Merging a branch when I don't want conflicts","fromName":"Geoff Russell","fromEmail":"geoffrey.russell@gmail.com","sentAt":"2009-05-18T23:53:54Z","receivedAt":"2009-05-18T23:53:54Z","isPatch":false,"sender":{"key":"geoffrey.russell@gmail.com","avatar":"https://gravatar.com/avatar/c30f497ccfa6bf06d86f30bd2ba092a2dd124c61c6bc902f7cb5c3f6486947de?d=mp&s=160"},"body":"On Mon, May 18, 2009 at 6:31 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:\n> Geoff Russell schrieb:\n>> The file is data coming out of an interactive program which reads\n>> the entire file, edits and then writes the entire file at which point\n>> this file is correct\n>> and all previous versions are obsolete.  I don't really want a merge\n>> at all, but just\n>> want to replace the file in the master with the version on the branch.\n>\n> Ah, so finally you say what you mean ;)\n>\n> You can define a custom merge driver that always returns the content of\n> the second branch. See 'man gitattributes'.\n>\n> -- Hannes\n>\n\nSorry for the confusion. A custom merge driver will work fine ... but I\nwill also rethink carefully  what I am doing.\n\nCheers,\nGeoff.\n"}]}