cvsserver: Add some useful commandline options
[gitweb.git] / t / t4013-diff-various.sh
index 36658fb17df1c76c1550daa7282278a28fb4e5b1..8f4c29a6b5a263d6f18d95757b76ac55e9443068 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,6 +73,7 @@ test_expect_success setup '
        for i in 1 2; do echo $i; done >>dir/sub &&
        git update-index file0 dir/sub &&
 
+       git config log.showroot false &&
        git commit --amend &&
        git show-branch
 '
@@ -85,7 +89,7 @@ test_expect_success setup '
 +*+ [initial] Initial
 EOF
 
-V=`git version | sed -e 's/^git version //'`
+V=`git version | sed -e 's/^git version //' -e 's/\./\\./g'`
 while read cmd
 do
        case "$cmd" in
@@ -100,12 +104,14 @@ do
        test_expect_success "git $cmd" '
                {
                        echo "\$ git $cmd"
-                       git $cmd | sed -e "s/$V/g-i-t--v-e-r-s-i-o-n/"
+                       git $cmd |
+                       sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
+                           -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
                        echo "\$"
                } >"$actual" &&
                if test -f "$expect"
                then
-                       diff -u "$expect" "$actual" &&
+                       git diff "$expect" "$actual" &&
                        rm -f "$actual"
                else
                        # this is to help developing new tests.
@@ -232,6 +238,10 @@ format-patch --stdout initial..master
 format-patch --attach --stdout initial..side
 format-patch --attach --stdout initial..master^
 format-patch --attach --stdout initial..master
+format-patch --inline --stdout initial..side
+format-patch --inline --stdout initial..master^
+format-patch --inline --stdout initial..master
+format-patch --inline --stdout --subject-prefix=TESTCASE initial..master
 
 diff --abbrev initial..side
 diff -r initial..side