Git fork

t4013: test new output from diff --abbrev --raw

Use newly-introduced finely-grained control to teach the diff-family to
honor the new environment GIT_PRINT_SHA1_ELLIPSIS and remove the
ellipses when it is not set.

Mentored-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ann T Ropea <bedhanger@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Ann T Ropea and committed by
Junio C Hamano
c2f1d398 7cb6ac1e

+253 -1
+15 -1
t/t4013-diff-various.sh
··· 140 140 expect="$TEST_DIRECTORY/t4013/diff.$test" 141 141 actual="$pfx-diff.$test" 142 142 143 - test_expect_success "git $cmd" ' 143 + test_expect_success "git $cmd # magic is ${magic:-"(not used)"}" ' 144 144 { 145 145 echo "$ git $cmd" 146 146 case "$magic" in ··· 175 175 diff-tree -r --abbrev=4 initial 176 176 diff-tree --root initial 177 177 diff-tree --root --abbrev initial 178 + :noellipses diff-tree --root --abbrev initial 178 179 diff-tree --root -r initial 179 180 diff-tree --root -r --abbrev initial 181 + :noellipses diff-tree --root -r --abbrev initial 180 182 diff-tree --root -r --abbrev=4 initial 183 + :noellipses diff-tree --root -r --abbrev=4 initial 181 184 diff-tree -p initial 182 185 diff-tree --root -p initial 183 186 diff-tree --patch-with-stat initial ··· 226 229 diff-tree -p -m master 227 230 diff-tree -c master 228 231 diff-tree -c --abbrev master 232 + :noellipses diff-tree -c --abbrev master 229 233 diff-tree --cc master 230 234 # stat only should show the diffstat with the first parent 231 235 diff-tree -c --stat master ··· 272 276 rev-list --children HEAD 273 277 274 278 whatchanged master 279 + :noellipses whatchanged master 275 280 whatchanged -p master 276 281 whatchanged --root master 282 + :noellipses whatchanged --root master 277 283 whatchanged --root -p master 278 284 whatchanged --patch-with-stat master 279 285 whatchanged --root --patch-with-stat master ··· 283 289 # improved by Timo's patch 284 290 whatchanged --root --cc --patch-with-stat --summary master 285 291 whatchanged -SF master 292 + :noellipses whatchanged -SF master 286 293 whatchanged -SF -p master 287 294 288 295 log --patch-with-stat master -- dir/ ··· 301 308 show --stat --summary side 302 309 show --patch-with-stat side 303 310 show --patch-with-raw side 311 + :noellipses show --patch-with-raw side 304 312 show --patch-with-stat --summary side 305 313 306 314 format-patch --stdout initial..side ··· 328 336 diff initial..side 329 337 diff --patch-with-stat initial..side 330 338 diff --patch-with-raw initial..side 339 + :noellipses diff --patch-with-raw initial..side 331 340 diff --patch-with-stat -r initial..side 332 341 diff --patch-with-raw -r initial..side 342 + :noellipses diff --patch-with-raw -r initial..side 333 343 diff --name-status dir2 dir 334 344 diff --no-index --name-status dir2 dir 335 345 diff --no-index --name-status -- dir2 dir ··· 342 352 diff --dirstat-by-file initial rearrange 343 353 # No-index --abbrev and --no-abbrev 344 354 diff --raw initial 355 + :noellipses diff --raw initial 345 356 diff --raw --abbrev=4 initial 357 + :noellipses diff --raw --abbrev=4 initial 346 358 diff --raw --no-abbrev initial 347 359 diff --no-index --raw dir2 dir 360 + :noellipses diff --no-index --raw dir2 dir 348 361 diff --no-index --raw --abbrev=4 dir2 dir 362 + :noellipses diff --no-index --raw --abbrev=4 dir2 dir 349 363 diff --no-index --raw --no-abbrev dir2 dir 350 364 EOF 351 365
+6
t/t4013/diff.noellipses-diff-tree_--root_--abbrev_initial
··· 1 + $ git diff-tree --root --abbrev initial 2 + 444ac553ac7612cc88969031b02b3767fb8a353a 3 + :000000 040000 0000000 da7a33f A dir 4 + :000000 100644 0000000 01e79c3 A file0 5 + :000000 100644 0000000 01e79c3 A file2 6 + $
+6
t/t4013/diff.noellipses-diff-tree_--root_-r_--abbrev=4_initial
··· 1 + $ git diff-tree --root -r --abbrev=4 initial 2 + 444ac553ac7612cc88969031b02b3767fb8a353a 3 + :000000 100644 0000 35d2 A dir/sub 4 + :000000 100644 0000 01e7 A file0 5 + :000000 100644 0000 01e7 A file2 6 + $
+6
t/t4013/diff.noellipses-diff-tree_--root_-r_--abbrev_initial
··· 1 + $ git diff-tree --root -r --abbrev initial 2 + 444ac553ac7612cc88969031b02b3767fb8a353a 3 + :000000 100644 0000000 35d242b A dir/sub 4 + :000000 100644 0000000 01e79c3 A file0 5 + :000000 100644 0000000 01e79c3 A file2 6 + $
+5
t/t4013/diff.noellipses-diff-tree_-c_--abbrev_master
··· 1 + $ git diff-tree -c --abbrev master 2 + 59d314ad6f356dd08601a4cd5e530381da3e3c64 3 + ::100644 100644 100644 cead32e 7289e35 992913c MM dir/sub 4 + ::100644 100644 100644 b414108 f4615da 10a8a9f MM file0 5 + $
+3
t/t4013/diff.noellipses-diff_--no-index_--raw_--abbrev=4_dir2_dir
··· 1 + $ git diff --no-index --raw --abbrev=4 dir2 dir 2 + :000000 100644 0000 0000 A dir/sub 3 + $
+3
t/t4013/diff.noellipses-diff_--no-index_--raw_dir2_dir
··· 1 + $ git diff --no-index --raw dir2 dir 2 + :000000 100644 0000000 0000000 A dir/sub 3 + $
+36
t/t4013/diff.noellipses-diff_--patch-with-raw_-r_initial..side
··· 1 + $ git diff --patch-with-raw -r initial..side 2 + :100644 100644 35d242b 7289e35 M dir/sub 3 + :100644 100644 01e79c3 f4615da M file0 4 + :000000 100644 0000000 7289e35 A file3 5 + 6 + diff --git a/dir/sub b/dir/sub 7 + index 35d242b..7289e35 100644 8 + --- a/dir/sub 9 + +++ b/dir/sub 10 + @@ -1,2 +1,4 @@ 11 + A 12 + B 13 + +1 14 + +2 15 + diff --git a/file0 b/file0 16 + index 01e79c3..f4615da 100644 17 + --- a/file0 18 + +++ b/file0 19 + @@ -1,3 +1,6 @@ 20 + 1 21 + 2 22 + 3 23 + +A 24 + +B 25 + +C 26 + diff --git a/file3 b/file3 27 + new file mode 100644 28 + index 0000000..7289e35 29 + --- /dev/null 30 + +++ b/file3 31 + @@ -0,0 +1,4 @@ 32 + +A 33 + +B 34 + +1 35 + +2 36 + $
+36
t/t4013/diff.noellipses-diff_--patch-with-raw_initial..side
··· 1 + $ git diff --patch-with-raw initial..side 2 + :100644 100644 35d242b 7289e35 M dir/sub 3 + :100644 100644 01e79c3 f4615da M file0 4 + :000000 100644 0000000 7289e35 A file3 5 + 6 + diff --git a/dir/sub b/dir/sub 7 + index 35d242b..7289e35 100644 8 + --- a/dir/sub 9 + +++ b/dir/sub 10 + @@ -1,2 +1,4 @@ 11 + A 12 + B 13 + +1 14 + +2 15 + diff --git a/file0 b/file0 16 + index 01e79c3..f4615da 100644 17 + --- a/file0 18 + +++ b/file0 19 + @@ -1,3 +1,6 @@ 20 + 1 21 + 2 22 + 3 23 + +A 24 + +B 25 + +C 26 + diff --git a/file3 b/file3 27 + new file mode 100644 28 + index 0000000..7289e35 29 + --- /dev/null 30 + +++ b/file3 31 + @@ -0,0 +1,4 @@ 32 + +A 33 + +B 34 + +1 35 + +2 36 + $
+6
t/t4013/diff.noellipses-diff_--raw_--abbrev=4_initial
··· 1 + $ git diff --raw --abbrev=4 initial 2 + :100644 100644 35d2 9929 M dir/sub 3 + :100644 100644 01e7 10a8 M file0 4 + :000000 100644 0000 b1e6 A file1 5 + :100644 000000 01e7 0000 D file2 6 + $
+6
t/t4013/diff.noellipses-diff_--raw_initial
··· 1 + $ git diff --raw initial 2 + :100644 100644 35d242b 992913c M dir/sub 3 + :100644 100644 01e79c3 10a8a9f M file0 4 + :000000 100644 0000000 b1e6722 A file1 5 + :100644 000000 01e79c3 0000000 D file2 6 + $
+42
t/t4013/diff.noellipses-show_--patch-with-raw_side
··· 1 + $ git show --patch-with-raw side 2 + commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a 3 + Author: A U Thor <author@example.com> 4 + Date: Mon Jun 26 00:03:00 2006 +0000 5 + 6 + Side 7 + 8 + :100644 100644 35d242b 7289e35 M dir/sub 9 + :100644 100644 01e79c3 f4615da M file0 10 + :000000 100644 0000000 7289e35 A file3 11 + 12 + diff --git a/dir/sub b/dir/sub 13 + index 35d242b..7289e35 100644 14 + --- a/dir/sub 15 + +++ b/dir/sub 16 + @@ -1,2 +1,4 @@ 17 + A 18 + B 19 + +1 20 + +2 21 + diff --git a/file0 b/file0 22 + index 01e79c3..f4615da 100644 23 + --- a/file0 24 + +++ b/file0 25 + @@ -1,3 +1,6 @@ 26 + 1 27 + 2 28 + 3 29 + +A 30 + +B 31 + +C 32 + diff --git a/file3 b/file3 33 + new file mode 100644 34 + index 0000000..7289e35 35 + --- /dev/null 36 + +++ b/file3 37 + @@ -0,0 +1,4 @@ 38 + +A 39 + +B 40 + +1 41 + +2 42 + $
+42
t/t4013/diff.noellipses-whatchanged_--root_master
··· 1 + $ git whatchanged --root master 2 + commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a 3 + Author: A U Thor <author@example.com> 4 + Date: Mon Jun 26 00:03:00 2006 +0000 5 + 6 + Side 7 + 8 + :100644 100644 35d242b 7289e35 M dir/sub 9 + :100644 100644 01e79c3 f4615da M file0 10 + :000000 100644 0000000 7289e35 A file3 11 + 12 + commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 13 + Author: A U Thor <author@example.com> 14 + Date: Mon Jun 26 00:02:00 2006 +0000 15 + 16 + Third 17 + 18 + :100644 100644 8422d40 cead32e M dir/sub 19 + :000000 100644 0000000 b1e6722 A file1 20 + 21 + commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 22 + Author: A U Thor <author@example.com> 23 + Date: Mon Jun 26 00:01:00 2006 +0000 24 + 25 + Second 26 + 27 + This is the second commit. 28 + 29 + :100644 100644 35d242b 8422d40 M dir/sub 30 + :100644 100644 01e79c3 b414108 M file0 31 + :100644 000000 01e79c3 0000000 D file2 32 + 33 + commit 444ac553ac7612cc88969031b02b3767fb8a353a 34 + Author: A U Thor <author@example.com> 35 + Date: Mon Jun 26 00:00:00 2006 +0000 36 + 37 + Initial 38 + 39 + :000000 100644 0000000 35d242b A dir/sub 40 + :000000 100644 0000000 01e79c3 A file0 41 + :000000 100644 0000000 01e79c3 A file2 42 + $
+9
t/t4013/diff.noellipses-whatchanged_-SF_master
··· 1 + $ git whatchanged -SF master 2 + commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 3 + Author: A U Thor <author@example.com> 4 + Date: Mon Jun 26 00:02:00 2006 +0000 5 + 6 + Third 7 + 8 + :100644 100644 8422d40 cead32e M dir/sub 9 + $
+32
t/t4013/diff.noellipses-whatchanged_master
··· 1 + $ git whatchanged master 2 + commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a 3 + Author: A U Thor <author@example.com> 4 + Date: Mon Jun 26 00:03:00 2006 +0000 5 + 6 + Side 7 + 8 + :100644 100644 35d242b 7289e35 M dir/sub 9 + :100644 100644 01e79c3 f4615da M file0 10 + :000000 100644 0000000 7289e35 A file3 11 + 12 + commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 13 + Author: A U Thor <author@example.com> 14 + Date: Mon Jun 26 00:02:00 2006 +0000 15 + 16 + Third 17 + 18 + :100644 100644 8422d40 cead32e M dir/sub 19 + :000000 100644 0000000 b1e6722 A file1 20 + 21 + commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 22 + Author: A U Thor <author@example.com> 23 + Date: Mon Jun 26 00:01:00 2006 +0000 24 + 25 + Second 26 + 27 + This is the second commit. 28 + 29 + :100644 100644 35d242b 8422d40 M dir/sub 30 + :100644 100644 01e79c3 b414108 M file0 31 + :100644 000000 01e79c3 0000000 D file2 32 + $