Subject: gitweb/gitk: empty merge diffs

From: Lea Wiemann <[email-masked]>
Date: Sun, 29 Jun 2008 17:57:57 +0200

I'm trying to get the diff of a merge ("git diff master^1 master") with 
gitk and gitweb, but both of them only show empty diffs (you can try 
yourself using the test script below).

Gitk doesn't seem to allow me to view the merge diff at all.

Gitweb only shows "Trivial merge" in the commitdiff view.  In the commit 
view, I can get the merge diff I want by clicking the "diff" link behind 
the first parent.

Why is this a "trivial merge", and what's the reason for gitweb not 
displaying the diff to the first parent in the commitdiff view?  I'm 
kinda confused here.

===== Graph: =====

*   master      merge mybranch into master
|\
| * mybranch    change file2 on mybranch
| * mybranch~1  change file2 on mybranch
* | master~1    change file1 on master
* | master~2    change file1 on master
|/
* mybranch~2    initial commit

===== Script to set up the repository: =====

rm -rf test-repo.tmp
mkdir test-repo.tmp
cd test-repo.tmp

git init

echo File 1 > file1
echo File 2 > file2
git add file1 file2
git commit -m 'initial commit'

git branch mybranch

echo Addition to file 1 >> file1
git commit -a -m 'change file1 on master'
echo Another addition to file 1 >> file1
git commit -a -m 'change file1 on master'

git checkout mybranch
echo Addition to file 2 >> file2
git commit -a -m 'change file2 on mybranch'
echo Another addition to file 2 >> file2
git commit -a -m 'change file2 on mybranch'

git checkout master
git merge 'merge mybranch into master' HEAD mybranch