git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phillip Susi <psusi@cfl.rr.com>
To: git@vger.kernel.org
Subject: log -p hides changes in merge commit
Date: Thu, 06 Jan 2011 12:07:10 -0500	[thread overview]
Message-ID: <4D25F6BE.7010300@cfl.rr.com> (raw)

git log -p never shows a diff for merge commits.  It is nice that it
does not show a giant diff that is the sum of all of the changes being
merged, but any manual changes made on top of the merge are also lost
from view, and this is not good.  Here is a reproduction recipe:

git init
echo foo > a
git add a
git commit -m "added a"
git branch other
git checkout other
echo bar > b
git add b
git commit -m "added b"
git checkout master
git merge other
git log -p

At this point there is no diff shown in the log output.  This is fine
since there were no changes needed to complete the merge, and the
addition of b is already documented in the merged commit.  The problem
is that if you add --no-merge to the git merge, and then:

echo bart > a
git add a
git commit

Now in addition to merging b, you have modified a, but git log -p still
shows no diff, effectively hiding the fact that you snuck in a
modification to a during the merge.

It seems that adding -c or --cc to the log correctly shows the change to
a, but why is this not shown by default?

             reply	other threads:[~2011-01-06 17:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-06 17:07 Phillip Susi [this message]
2011-01-06 19:43 ` log -p hides changes in merge commit Junio C Hamano
2011-01-06 20:50   ` Phillip Susi
2011-01-06 21:04     ` Jonathan Nieder
2011-01-07 19:27       ` Phillip Susi
2011-01-07 20:27         ` Junio C Hamano

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=4D25F6BE.7010300@cfl.rr.com \
    --to=psusi@cfl.rr.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).