diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-01-22 16:08:01 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-22 16:08:01 -0800 |
commit | 67bc7407211d26de518811dafc2c1cf2e6124709 (patch) | |
tree | 6fffca8665145d1f3164abce6d980f8c537e1343 /t | |
parent | Merge branch 'nd/ls-files-sparse-fix' (diff) | |
parent | Fix "log --oneline" not to show notes (diff) | |
download | tgif-67bc7407211d26de518811dafc2c1cf2e6124709.tar.xz |
Merge branch 'jc/maint-limit-note-output'
* 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-x | t/t3301-notes.sh | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh index 1e34f4836f..5d9604b815 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 |