{"thread":{"id":"23642","subject":"seeing a combined diff (no-conflict files) before committing a merge","startedAt":"2010-04-29T12:13:47Z","lastAt":"2010-04-29T12:13:47Z","messageCount":1,"participants":["Sitaram Chamarty"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"140654","messageId":"r2k2e24e5b91004290513j4e5e2ebm1163a5c8fa1fdf8d@mail.gmail.com","threadId":"23642","inReplyTo":null,"subject":"seeing a combined diff (no-conflict files) before committing a merge","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2010-04-29T12:13:47Z","receivedAt":"2010-04-29T12:13:47Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"I saw the thread at\nhttp://kerneltrap.org/mailarchive/git/2010/3/18/25850, but there\ndoesn't seem to have been any resolution or further discussion.\n\nI am thinking of two possible solutions:\n\n(1) is there a way we can \"simulate\" a conflict by putting back stage\n1/2/3 files, for a successfully merged file, into the index so \"git\ndiff\" will work\n\n(2) is there some way to just pass along 3 files names (parent1,\nparent2, and merged) and it would show the combined diff output.\n\nOf course, I came up with this shell script (see below sig), but is\nthere a better way?  It seems like a horrible kludge!\n\nThanks,\n\n-- \nSitaram\n\n\n#!/bin/bash\n\nexport TEMPDIR=$(mktemp -d)\ntrap \"/bin/rm -rf $TEMPDIR\" 0\nexport GIT_INDEX_FILE=$TEMPDIR/index\n\n[[ -n $1                ]] || { echo I need a filename;    exit 1; }\n[[ -f $1                ]] || { echo I need a filename;    exit 1; }\n[[ -f .git/MERGE_HEAD   ]] || { echo no MERGE_HEAD;        exit 1; }\n[[ -f .git/ORIG_HEAD    ]] || { echo no ORIG_HEAD;         exit 1; }\n\ngit add $1\nfake_commit=$(echo fake commit to view combined diff of $1 | git\ncommit-tree $(git write-tree) -p ORIG_HEAD -p MERGE_HEAD)\ngit log -p -c -1 $fake_commit -- $1\n"}]}