aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-03-05 15:41:43 -0800
committerJunio C Hamano <gitster@pobox.com>2009-03-05 15:41:43 -0800
commit458eaf5bf895c2df8e0ef81a4c9606d179082e68 (patch)
tree650130c954c3e7fc5a123106b845b9813d1ed1c3 /t
parent3535dbb3d10cb2782dfbb77c07f2f7d9c44bd41f (diff)
parent72de29c24f50dccc5f045a7756bb0b47e34a7a8e (diff)
downloadgit-458eaf5bf895c2df8e0ef81a4c9606d179082e68.tar.gz
git-458eaf5bf895c2df8e0ef81a4c9606d179082e68.tar.xz
Merge branch 'ns/pretty-format'
* ns/pretty-format: bash completion: add --format= and --oneline options for "git log" Add tests for git log --pretty, --format and --oneline. Add --oneline that is a synonym to "--pretty=oneline --abbrev-commit" Give short-hands to --pretty=tformat:%formatstring Add --format that is a synonym to --pretty
Diffstat (limited to 't')
-rwxr-xr-xt/t4202-log.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 7b976ee36..6d43459dd 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -37,6 +37,46 @@ test_expect_success setup '
'
+printf "sixth\nfifth\nfourth\nthird\nsecond\ninitial" > expect
+test_expect_success 'pretty' '
+
+ git log --pretty="format:%s" > actual &&
+ test_cmp expect actual
+'
+
+printf "sixth\nfifth\nfourth\nthird\nsecond\ninitial\n" > expect
+test_expect_success 'pretty (tformat)' '
+
+ git log --pretty="tformat:%s" > actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'pretty (shortcut)' '
+
+ git log --pretty="%s" > actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'format' '
+
+ git log --format="%s" > actual &&
+ test_cmp expect actual
+'
+
+cat > expect << EOF
+804a787 sixth
+394ef78 fifth
+5d31159 fourth
+2fbe8c0 third
+f7dab8e second
+3a2fdcb initial
+EOF
+test_expect_success 'oneline' '
+
+ git log --oneline > actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'diff-filter=A' '
actual=$(git log --pretty="format:%s" --diff-filter=A HEAD) &&