From: Sitaram Chamarty <sitaramc@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: seeing a combined diff (no-conflict files) before committing a merge
Date: Thu, 29 Apr 2010 17:43:47 +0530 [thread overview]
Message-ID: <r2k2e24e5b91004290513j4e5e2ebm1163a5c8fa1fdf8d@mail.gmail.com> (raw)
I saw the thread at
http://kerneltrap.org/mailarchive/git/2010/3/18/25850, but there
doesn't seem to have been any resolution or further discussion.
I am thinking of two possible solutions:
(1) is there a way we can "simulate" a conflict by putting back stage
1/2/3 files, for a successfully merged file, into the index so "git
diff" will work
(2) is there some way to just pass along 3 files names (parent1,
parent2, and merged) and it would show the combined diff output.
Of course, I came up with this shell script (see below sig), but is
there a better way? It seems like a horrible kludge!
Thanks,
--
Sitaram
#!/bin/bash
export TEMPDIR=$(mktemp -d)
trap "/bin/rm -rf $TEMPDIR" 0
export GIT_INDEX_FILE=$TEMPDIR/index
[[ -n $1 ]] || { echo I need a filename; exit 1; }
[[ -f $1 ]] || { echo I need a filename; exit 1; }
[[ -f .git/MERGE_HEAD ]] || { echo no MERGE_HEAD; exit 1; }
[[ -f .git/ORIG_HEAD ]] || { echo no ORIG_HEAD; exit 1; }
git add $1
fake_commit=$(echo fake commit to view combined diff of $1 | git
commit-tree $(git write-tree) -p ORIG_HEAD -p MERGE_HEAD)
git log -p -c -1 $fake_commit -- $1
reply other threads:[~2010-04-30 20:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=r2k2e24e5b91004290513j4e5e2ebm1163a5c8fa1fdf8d@mail.gmail.com \
--to=sitaramc@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).