3 # Copyright (c) 2007 Johannes E. Schindelin
6 test_description='Test commit notes index (expensive!)'
10 test_set_prereq NOT_EXPENSIVE
11 test -n "$GIT_NOTES_TIMING_TESTS" && test_set_prereq EXPENSIVE
12 test -x /usr/bin/time && test_set_prereq USR_BIN_TIME
20 while [ $nr -lt $number_of_commits ]; do
26 commit refs/heads/master
28 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
46 echo "N :$notemark :$mark" >> note_commit
50 commit refs/notes/commits
51 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
60 git fast-import --quiet &&
61 git config core.notesRef refs/notes/commits
67 git config core.notesRef refs/notes/commits &&
68 git log | grep "^ " > output &&
70 while [ $i -gt 0 ]; do
72 echo " note for commit #$i" &&
75 test_cmp expect output
78 cat > time_notes << \EOF
81 while [ $i -lt $2 ]; do
84 GIT_NOTES_REF=non-existing; export GIT_NOTES_REF
96 for mode in no-notes notes
99 /usr/bin/time "$SHELL_PATH" ../time_notes $mode $1
107 test_expect_success $pr 'setup / mkdir' '
112 test_expect_success $pr "setup $count" "create_repo $count"
114 test_expect_success $pr 'notes work' "test_notes $count"
116 test_expect_success USR_BIN_TIME,$pr 'notes timing with /usr/bin/time' "time_notes 100"
118 test_expect_success $pr 'teardown / cd ..' 'cd ..'
121 do_tests NOT_EXPENSIVE 10
122 for count in 100 1000 10000; do
123 do_tests EXPENSIVE $count