{"thread":{"id":"23057","subject":"Not possible to see combined diff before committing a merge?","startedAt":"2010-03-18T06:21:40Z","lastAt":"2010-03-18T15:21:13Z","messageCount":3,"participants":["Jay Soffian","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"137072","messageId":"76718491003172321j2a184643o47ec3a712a3b0c12@mail.gmail.com","threadId":"23057","inReplyTo":null,"subject":"Not possible to see combined diff before committing a merge?","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2010-03-18T06:21:40Z","receivedAt":"2010-03-18T06:21:40Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"Am I missing something, or is there no way to see combined diff output\nafter completing merge resolution on a conflicted merge but before\ncommitting the merge?\n\n$ git diff --cc [-- path]\n\nworks fine _until_ you've added the file to the index, at which point\nyou're hosed.\n\nI think I want the combined diff between:\n\n- What's in the index\n- The first parent (ORIG_HEAD)\n- The second parent (MERGE_HEAD)\n\nAnd I don't think that's possible, sadly.\n\nj.\n"},{"id":"137076","messageId":"4BA1F880.2090100@drmicha.warpmail.net","threadId":"23057","inReplyTo":"76718491003172321j2a184643o47ec3a712a3b0c12@mail.gmail.com","subject":"Re: Not possible to see combined diff before committing a merge?","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-03-18T09:55:12Z","receivedAt":"2010-03-18T09:55:12Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Jay Soffian venit, vidit, dixit 18.03.2010 07:21:\n> Am I missing something, or is there no way to see combined diff output\n> after completing merge resolution on a conflicted merge but before\n> committing the merge?\n> \n> $ git diff --cc [-- path]\n> \n> works fine _until_ you've added the file to the index, at which point\n> you're hosed.\n> \n> I think I want the combined diff between:\n> \n> - What's in the index\n> - The first parent (ORIG_HEAD)\n> - The second parent (MERGE_HEAD)\n> \n> And I don't think that's possible, sadly.\n\nThe obvious attempt \"git diff --cc --cached\" does not work,\nunfortunately, because the add cleared out the other stages from the index.\n\nThe funny thing is that after committing, git show will give you the\ncombined diff (again).\n\nI guess that proves, again, that there can't be a symbolic ref like\nINDEX because it just doesn't behave like one.\n\nIf there are no conflicted files left you could do a throw-away commit\nwith a temp index, but that looks ugly. Do we have a way of specifying a\n3-way diff for some git diff --cc incarnation, i.e. pretending two\ncommits to be the parents and a third (or index) to be the merge result?\n\nJunio would probably say that by adding the merge resolution you declare\nthat you're not interested in that part of the merge any more ;)\n\nMichael\n"},{"id":"137100","messageId":"76718491003180821x777df87j245d134e32ec90dc@mail.gmail.com","threadId":"23057","inReplyTo":"4BA1F880.2090100@drmicha.warpmail.net","subject":"Re: Not possible to see combined diff before committing a merge?","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2010-03-18T15:21:13Z","receivedAt":"2010-03-18T15:21:13Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Thu, Mar 18, 2010 at 5:55 AM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> If there are no conflicted files left you could do a throw-away commit\n> with a temp index, but that looks ugly. Do we have a way of specifying a\n> 3-way diff for some git diff --cc incarnation, i.e. pretending two\n> commits to be the parents and a third (or index) to be the merge result?\n\nIt would seem that diff-index should take two <tree-ish>'s (it only\ntakes one) to support this.\n\n> Junio would probably say that by adding the merge resolution you declare\n> that you're not interested in that part of the merge any more ;)\n\nThe use case is that I use mergetool when I have merges with very\nlarge conflicted regions that are too difficult to visualize using the\nmerge and/or diff3 conflict style. But because these conflict\nresolutions are so difficult, I often want to look at the merge\nresolution in combined-diff style before committing.\n\nThe way I would have to do this today is:\n\n- git mergetool <path>\n- save the result in my visual merge tool and quit\n- in a separate shell, use git diff to see the 3-way diff\n- in the first shell, answer mergetool's prompt that it's okay to use the result\n\nHmm, maybe there should be an option for whether mergetool\nautomatically add's the result for you.\n\nAnyway, what I've noticed is that I've become gun shy about using \"git\nadd\" myself during conflict resolution because as soon as I do, I lose\nsome functionality compared to the unmerged state.\n\nj.\n"}]}