Code

git-pull: allow pulling into an empty repository
[git.git] / t / t4013-diff-various.sh
index 802e0ba01d62c66071dbcad7c8df21f8ba09cb13..71c454356fbbcd5f67bdfc0b6ef7785fa8b712c1 100755 (executable)
@@ -7,6 +7,9 @@ test_description='Various diff formatting options'
 
 . ./test-lib.sh
 
+LF='
+'
+
 test_expect_success setup '
 
        GIT_AUTHOR_DATE="2006-06-26 00:00:00 +0000" &&
@@ -31,7 +34,7 @@ test_expect_success setup '
        for i in C D; do echo $i; done >>dir/sub &&
        rm -f file2 &&
        git update-index --remove file0 file2 dir/sub &&
-       git commit -m Second &&
+       git commit -m "Second${LF}${LF}This is the second commit." &&
 
        GIT_AUTHOR_DATE="2006-06-26 00:02:00 +0000" &&
        GIT_COMMITTER_DATE="2006-06-26 00:02:00 +0000" &&
@@ -70,7 +73,7 @@ test_expect_success setup '
        for i in 1 2; do echo $i; done >>dir/sub &&
        git update-index file0 dir/sub &&
 
-       EDITOR=: VISUAL=: git commit --amend &&
+       git commit --amend &&
        git show-branch
 '
 
@@ -85,6 +88,7 @@ test_expect_success setup '
 +*+ [initial] Initial
 EOF
 
+V=`git version | sed -e 's/^git version //' -e 's/\./\\./g'`
 while read cmd
 do
        case "$cmd" in
@@ -99,7 +103,9 @@ do
        test_expect_success "git $cmd" '
                {
                        echo "\$ git $cmd"
-                       git $cmd
+                       git $cmd |
+                       sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
+                           -e "s/^\\( *boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
                        echo "\$"
                } >"$actual" &&
                if test -f "$expect"
@@ -137,7 +143,10 @@ diff-tree --pretty --summary initial
 diff-tree --pretty --stat --summary initial
 diff-tree --pretty --root -p initial
 diff-tree --pretty --root --stat initial
-#diff-tree --pretty --root --summary initial
+# improved by Timo's patch
+diff-tree --pretty --root --summary initial
+# improved by Timo's patch
+diff-tree --pretty --root --summary -r initial
 diff-tree --pretty --root --stat --summary initial
 diff-tree --pretty --patch-with-stat initial
 diff-tree --pretty --root --patch-with-stat initial
@@ -149,6 +158,7 @@ diff-tree --pretty=oneline --root initial
 diff-tree --pretty=oneline -p initial
 diff-tree --pretty=oneline --root -p initial
 diff-tree --pretty=oneline --patch-with-stat initial
+# improved by Timo's patch
 diff-tree --pretty=oneline --root --patch-with-stat initial
 diff-tree --pretty=oneline --patch-with-raw initial
 diff-tree --pretty=oneline --root --patch-with-raw initial
@@ -163,6 +173,20 @@ diff-tree -p -m master
 diff-tree -c master
 diff-tree -c --abbrev master
 diff-tree --cc master
+# stat only should show the diffstat with the first parent
+diff-tree -c --stat master
+diff-tree --cc --stat master
+diff-tree -c --stat --summary master
+diff-tree --cc --stat --summary master
+# stat summary should show the diffstat and summary with the first parent
+diff-tree -c --stat --summary side
+diff-tree --cc --stat --summary side
+# improved by Timo's patch
+diff-tree --cc --patch-with-stat master
+# improved by Timo's patch
+diff-tree --cc --patch-with-stat --summary master
+# this is correct
+diff-tree --cc --patch-with-stat --summary side
 
 log master
 log -p master
@@ -170,8 +194,13 @@ log --root master
 log --root -p master
 log --patch-with-stat master
 log --root --patch-with-stat master
-#log --root --patch-with-stat --summary master
+log --root --patch-with-stat --summary master
+# improved by Timo's patch
+log --root -c --patch-with-stat --summary master
+# improved by Timo's patch
+log --root --cc --patch-with-stat --summary master
 log -SF master
+log -SF -p master
 
 whatchanged master
 whatchanged -p master
@@ -180,10 +209,17 @@ whatchanged --root -p master
 whatchanged --patch-with-stat master
 whatchanged --root --patch-with-stat master
 whatchanged --root --patch-with-stat --summary master
+# improved by Timo's patch
+whatchanged --root -c --patch-with-stat --summary master
+# improved by Timo's patch
+whatchanged --root --cc --patch-with-stat --summary master
 whatchanged -SF master
+whatchanged -SF -p master
 
 log --patch-with-stat master -- dir/
 whatchanged --patch-with-stat master -- dir/
+log --patch-with-stat --summary master -- dir/
+whatchanged --patch-with-stat --summary master -- dir/
 
 show initial
 show --root initial
@@ -195,8 +231,22 @@ show --patch-with-stat side
 show --patch-with-raw side
 show --patch-with-stat --summary side
 
-
-
+format-patch --stdout initial..side
+format-patch --stdout initial..master^
+format-patch --stdout initial..master
+format-patch --attach --stdout initial..side
+format-patch --attach --stdout initial..master^
+format-patch --attach --stdout initial..master
+
+diff --abbrev initial..side
+diff -r initial..side
+diff --stat initial..side
+diff -r --stat initial..side
+diff initial..side
+diff --patch-with-stat initial..side
+diff --patch-with-raw initial..side
+diff --patch-with-stat -r initial..side
+diff --patch-with-raw -r initial..side
 EOF
 
 test_done