aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-02-05 10:59:05 -0800
committerJunio C Hamano <gitster@pobox.com>2010-02-05 10:59:05 -0800
commitb401a12a2c49d3f3e81e356782d9ca49aaa97faa (patch)
tree3c08d47265838d7b13ae8e2649835159077a6f0c /t
parent3325cea0f7ef7355f6806b2fc88acdb2e27785ac (diff)
parent7dccadf363f9d9ff564ad34117266b2d557a2bc8 (diff)
downloadgit-b401a12a2c49d3f3e81e356782d9ca49aaa97faa.tar.gz
git-b401a12a2c49d3f3e81e356782d9ca49aaa97faa.tar.xz
Merge branch 'jc/maint-limit-note-output' into maint
* jc/maint-limit-note-output: Fix "log --oneline" not to show notes Fix "log" family not to be too agressive about showing notes
Diffstat (limited to 't')
-rwxr-xr-xt/t3301-notes.sh59
1 files changed, 59 insertions, 0 deletions
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index 1e34f4836..5d9604b81 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -147,4 +147,63 @@ test_expect_success 'show -m and -F notes' '
test_cmp expect-m-and-F output
'
+cat >expect << EOF
+commit 15023535574ded8b1a89052b32673f84cf9582b8
+tree e070e3af51011e47b183c33adf9736736a525709
+parent 1584215f1d29c65e99c6c6848626553fdd07fd75
+author A U Thor <author@example.com> 1112912173 -0700
+committer C O Mitter <committer@example.com> 1112912173 -0700
+
+ 4th
+EOF
+test_expect_success 'git log --pretty=raw does not show notes' '
+ git log -1 --pretty=raw >output &&
+ test_cmp expect output
+'
+
+cat >>expect <<EOF
+
+Notes:
+ spam
+$whitespace
+ xyzzy
+$whitespace
+ foo
+ bar
+ baz
+EOF
+test_expect_success 'git log --show-notes' '
+ git log -1 --pretty=raw --show-notes >output &&
+ test_cmp expect output
+'
+
+test_expect_success 'git log --no-notes' '
+ git log -1 --no-notes >output &&
+ ! grep spam output
+'
+
+test_expect_success 'git format-patch does not show notes' '
+ git format-patch -1 --stdout >output &&
+ ! grep spam output
+'
+
+test_expect_success 'git format-patch --show-notes does show notes' '
+ git format-patch --show-notes -1 --stdout >output &&
+ grep spam output
+'
+
+for pretty in \
+ "" --pretty --pretty=raw --pretty=short --pretty=medium \
+ --pretty=full --pretty=fuller --pretty=format:%s --oneline
+do
+ case "$pretty" in
+ "") p= not= negate="" ;;
+ ?*) p="$pretty" not=" not" negate="!" ;;
+ esac
+ test_expect_success "git show $pretty does$not show notes" '
+ git show $p >output &&
+ eval "$negate grep spam output"
+ '
+done
+
test_done