X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft3301-notes.sh;h=5d9604b8155401a2e345a69a5d030cffd7d16818;hb=3bfc45047654c7dd38b32033321228e97fc8f60e;hp=1e34f4836f4840b1cd30fdc635e56e50e4c669df;hpb=261fbda903762b9c47e4138312673ea25555d9e5;p=git.git 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 1112912173 -0700 +committer C O Mitter 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 <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