Commit 15f3dba
committed
Merge branch 'add-i-fixes'
While re-implementing `git add -i` and `git add -p` in C, I tried to
make sure that there is test coverage for all of the features I convert
from Perl to C, to give me some confidence in the correctness from
running the test suite both with `GIT_TEST_ADD_I_USE_BUILTIN=true` and
with `GIT_TEST_ADD_I_USE_BUILTIN=false`.
However, I discovered that there are a couple of gaps. This patch series
intends to close them.
The first patch might actually not be considered a gap by some: it
basically removes the need for the `TTY` prerequisite in the `git add
-i` tests to verify that the output is colored all right. This change is
rather crucial for me, though: on Windows, where the conversion to a
built-in shows the most obvious benefits, there are no pseudo terminals
(yet), therefore `git.exe` cannot work with them (even if the MSYS2 Perl
interpreter used by Git for Windows knows about some sort of pty
emulation). And I *really* wanted to make sure that the colors work on
Windows, as I personally get a lot out of those color cues.
The patch series ends by addressing two issues that are not exactly
covering testing gaps:
- While adding a test case, I noticed that `git add -p` exited with
*success* when it could not even generate a diff. This is so obviously
wrong that I had to fix it right away (I noticed, actually, because my
in-progress built-in `git add -p` failed, and the Perl version did
not), and I used the same test case to verify that this is fixed once
and for all.
- While working on covering those test gaps, I noticed a problem in an
early version of the built-in version of `git add -p` where the `git
apply --allow-overlap` mode failed to work properly, for little
reason, and I fixed it real quick.
It would seem that the `--allow-overlap` function is not only
purposefully under-documented, but also purposefully under-tested,
probably to discourage its use. I do not quite understand what I
perceive to be Junio's aversion to that option, but I did not feel
like I should put up a battle here, so I did not accompany this fix
with a new test script.
In the end, the built-in version of `git add -p` does not use the
`--allow-overlap` function at all, anyway. Which should make everybody
a lot happier.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>File tree
3 files changed
+94
-11
lines changed- t
3 files changed
+94
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2676 | 2676 | | |
2677 | 2677 | | |
2678 | 2678 | | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
2679 | 2689 | | |
2680 | 2690 | | |
2681 | 2691 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
| |||
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
213 | | - | |
| 215 | + | |
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
| |||
1103 | 1105 | | |
1104 | 1106 | | |
1105 | 1107 | | |
1106 | | - | |
| 1108 | + | |
1107 | 1109 | | |
1108 | 1110 | | |
1109 | 1111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
26 | 37 | | |
27 | 38 | | |
28 | 39 | | |
| |||
94 | 105 | | |
95 | 106 | | |
96 | 107 | | |
97 | | - | |
98 | 108 | | |
99 | 109 | | |
100 | 110 | | |
| |||
263 | 273 | | |
264 | 274 | | |
265 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
266 | 305 | | |
267 | 306 | | |
268 | 307 | | |
| |||
403 | 442 | | |
404 | 443 | | |
405 | 444 | | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
406 | 467 | | |
407 | 468 | | |
408 | 469 | | |
| |||
429 | 490 | | |
430 | 491 | | |
431 | 492 | | |
432 | | - | |
| 493 | + | |
433 | 494 | | |
434 | 495 | | |
435 | 496 | | |
436 | | - | |
| 497 | + | |
437 | 498 | | |
438 | 499 | | |
439 | 500 | | |
440 | 501 | | |
441 | 502 | | |
442 | 503 | | |
443 | | - | |
| 504 | + | |
444 | 505 | | |
445 | 506 | | |
446 | 507 | | |
447 | 508 | | |
448 | | - | |
| 509 | + | |
449 | 510 | | |
450 | 511 | | |
451 | 512 | | |
452 | 513 | | |
453 | 514 | | |
454 | 515 | | |
455 | | - | |
| 516 | + | |
456 | 517 | | |
457 | 518 | | |
458 | 519 | | |
459 | 520 | | |
460 | | - | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
461 | 532 | | |
462 | 533 | | |
463 | 534 | | |
| |||
658 | 729 | | |
659 | 730 | | |
660 | 731 | | |
661 | | - | |
| 732 | + | |
662 | 733 | | |
663 | 734 | | |
664 | 735 | | |
| |||
0 commit comments