{"thread":{"id":"37989","subject":"Merge without marking conflicts in working tree","startedAt":"2014-11-17T22:38:36Z","lastAt":"2014-11-17T23:20:29Z","messageCount":3,"participants":["Aaron Schrab","Junio C Hamano","Andreas Schwab"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"252009","messageId":"20141117223836.GH615@pug.qqx.org","threadId":"37989","inReplyTo":null,"subject":"Merge without marking conflicts in working tree","fromName":"Aaron Schrab","fromEmail":"aaron@schrab.com","sentAt":"2014-11-17T22:38:36Z","receivedAt":"2014-11-17T22:38:36Z","isPatch":false,"sender":{"key":"aaron@schrab.com","avatar":"https://avatars.githubusercontent.com/u/39620?v=4"},"body":"Is there a way to do a merge but only record conflicts in the index, not \nupdate the working versions of files with conflict markers?\n\nLike many people, I use git to manage configuration files for my shell, \neditor, git itself, and a number of other things.  The vast majority of \ntimes that I update things no conflicts are occur and everything just \nworks, so I'd like to avoid extra work in this case.  But occasionally a \nconflict will occur, and if it's in a file that will be read while \ntrying to resolve the conflict this can make things more difficult.\n\nI'd like to find a way to have the conflict recorded in just the index \nwithout touching the working tree.  I could then use my usual tools to \nresolve the conflict without the errors caused by the conflict markers.  \nI generally use vim+fugitive to resolve conflicts anyway, and typically \nthe first step I take is to replace the working-tree version with the \nmerge-base version, completely ignoring any conflict markers.\n\nIf there isn't currently a way to do this, I was thinking of \nimplementing something like an \"ours\" value for merge.conflictstyle \nconfiguration.\n"},{"id":"252012","messageId":"xmqqzjbpwh35.fsf@gitster.dls.corp.google.com","threadId":"37989","inReplyTo":"20141117223836.GH615@pug.qqx.org","subject":"Re: Merge without marking conflicts in working tree","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-11-17T23:19:26Z","receivedAt":"2014-11-17T23:19:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Aaron Schrab <aaron@schrab.com> writes:\n\n> Is there a way to do a merge but only record conflicts in the index,\n> not update the working versions of files with conflict markers?\n\nNot with Porcelain, but \"read-tree -m <ancestor> <ours> <theirs>\"\nshould give you something close to it.\n\n\"merge-recursive\" is probably beyond salvaging and coaxing --cached\noption (i.e. tell a command that usually works both on the index and\non the working tree to only work on the index) into it would be too\nmessy to think about.  Restructuring it so that it first computes\nthe end result only in the index and then optionally allows it to\ncheck out to the working tree has been something I've wanted to do\nfor a long time, but there is only limited amount of time in a day\nand the list is never dormant, so... X-<.\n"},{"id":"252013","messageId":"87sihhza6a.fsf@igel.home","threadId":"37989","inReplyTo":"20141117223836.GH615@pug.qqx.org","subject":"Re: Merge without marking conflicts in working tree","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2014-11-17T23:20:29Z","receivedAt":"2014-11-17T23:20:29Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Aaron Schrab <aaron@schrab.com> writes:\n\n> Is there a way to do a merge but only record conflicts in the index, not\n> update the working versions of files with conflict markers?\n>\n> Like many people, I use git to manage configuration files for my shell,\n> editor, git itself, and a number of other things.  The vast majority of\n> times that I update things no conflicts are occur and everything just\n> works, so I'd like to avoid extra work in this case.  But occasionally a\n> conflict will occur, and if it's in a file that will be read while trying\n> to resolve the conflict this can make things more difficult.\n\nYou could perform the merge in a separate working directory.  The only\nextra step required is a checkout to deploy the new revision, which\ncould be triggered automatically by a hook.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"}]}