3 test_description='Test commit notes organized in subtrees'
12 commit refs/notes/commits
13 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
18 from refs/notes/commits^0
25 git log | grep "^ " > output &&
26 i=$number_of_commits &&
27 while [ $i -gt 0 ]; do
29 echo " note for commit #$i" &&
32 test_cmp expect output
35 test_expect_success "setup: create $number_of_commits commits" '
39 while [ $nr -lt $number_of_commits ]; do
43 commit refs/heads/master
44 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
59 commit refs/notes/commits
60 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
70 git fast-import --quiet &&
71 git config core.notesRef refs/notes/commits
77 nr=$number_of_commits &&
78 git rev-list refs/heads/master |
80 note_path=$(echo "$sha1" | sed "$1")
82 M 100644 inline $note_path
92 git fast-import --quiet
95 test_expect_success 'test notes in 2/38-fanout' 'test_sha1_based "s|^..|&/|"'
96 test_expect_success 'verify notes in 2/38-fanout' 'verify_notes'
98 test_expect_success 'test notes in 4/36-fanout' 'test_sha1_based "s|^....|&/|"'
99 test_expect_success 'verify notes in 4/36-fanout' 'verify_notes'
101 test_expect_success 'test notes in 2/2/36-fanout' 'test_sha1_based "s|^\(..\)\(..\)|\1/\2/|"'
102 test_expect_success 'verify notes in 2/2/36-fanout' 'verify_notes'
107 nr=$number_of_commits &&
108 git rev-list refs/heads/master |
110 first_note_path=$(echo "$sha1" | sed "$1")
111 second_note_path=$(echo "$sha1" | sed "$2")
113 M 100644 inline $second_note_path
118 M 100644 inline $first_note_path
128 git fast-import --quiet
131 test_expect_success 'test same notes in 4/36-fanout and 2/38-fanout' 'test_same_notes "s|^..|&/|" "s|^....|&/|"'
132 test_expect_success 'verify same notes in 4/36-fanout and 2/38-fanout' 'verify_notes'
134 test_expect_success 'test same notes in 2/38-fanout and 2/2/36-fanout' 'test_same_notes "s|^\(..\)\(..\)|\1/\2/|" "s|^..|&/|"'
135 test_expect_success 'verify same notes in 2/38-fanout and 2/2/36-fanout' 'verify_notes'
137 test_expect_success 'test same notes in 4/36-fanout and 2/2/36-fanout' 'test_same_notes "s|^\(..\)\(..\)|\1/\2/|" "s|^....|&/|"'
138 test_expect_success 'verify same notes in 4/36-fanout and 2/2/36-fanout' 'verify_notes'
140 test_concatenated_notes () {
143 nr=$number_of_commits &&
144 git rev-list refs/heads/master |
146 first_note_path=$(echo "$sha1" | sed "$1")
147 second_note_path=$(echo "$sha1" | sed "$2")
149 M 100644 inline $second_note_path
151 second note for commit #$nr
154 M 100644 inline $first_note_path
156 first note for commit #$nr
164 git fast-import --quiet
167 verify_concatenated_notes () {
168 git log | grep "^ " > output &&
169 i=$number_of_commits &&
170 while [ $i -gt 0 ]; do
171 echo " commit #$i" &&
172 echo " first note for commit #$i" &&
173 echo " second note for commit #$i" &&
176 test_cmp expect output
179 test_expect_success 'test notes in 4/36-fanout concatenated with 2/38-fanout' 'test_concatenated_notes "s|^..|&/|" "s|^....|&/|"'
180 test_expect_success 'verify notes in 4/36-fanout concatenated with 2/38-fanout' 'verify_concatenated_notes'
182 test_expect_success 'test notes in 2/38-fanout concatenated with 2/2/36-fanout' 'test_concatenated_notes "s|^\(..\)\(..\)|\1/\2/|" "s|^..|&/|"'
183 test_expect_success 'verify notes in 2/38-fanout concatenated with 2/2/36-fanout' 'verify_concatenated_notes'
185 test_expect_success 'test notes in 4/36-fanout concatenated with 2/2/36-fanout' 'test_concatenated_notes "s|^\(..\)\(..\)|\1/\2/|" "s|^....|&/|"'
186 test_expect_success 'verify notes in 4/36-fanout concatenated with 2/2/36-fanout' 'verify_concatenated_notes'