git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* log -p hides changes in merge commit
@ 2011-01-06 17:07 Phillip Susi
  2011-01-06 19:43 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Phillip Susi @ 2011-01-06 17:07 UTC (permalink / raw)
  To: git

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?

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-01-07 20:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-06 17:07 log -p hides changes in merge commit Phillip Susi
2011-01-06 19:43 ` 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

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).