Commit 2ff3a80
Teach --dirstat not to completely ignore rearranged lines within a file
Currently, the --dirstat analysis ignores when lines within a file are
rearranged, because the "damage" calculated by show_dirstat() is 0.
However, if the object name has changed, we already know that there is
some damage, and it is unintuitive to claim there is _no_ damage.
Teach show_dirstat() to assign a minimum amount of damage (== 1) to
entries for which the analysis otherwise yields zero damage, to still
represent that these files are changed, instead of saying that there
is no change.
Also, skip --dirstat analysis when the object names are the same (e.g. for
a pure file rename).
Signed-off-by: Johan Herland <[email protected]>
Acked-by: Linus Torvalds <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 0133dab commit 2ff3a80
File tree
4 files changed
+21
-5
lines changed- Documentation
- t
- t4013
4 files changed
+21
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
| 77 | + | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1548 | 1548 | | |
1549 | 1549 | | |
1550 | 1550 | | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
1551 | 1561 | | |
1552 | 1562 | | |
1553 | 1563 | | |
| |||
1556 | 1566 | | |
1557 | 1567 | | |
1558 | 1568 | | |
1559 | | - | |
| 1569 | + | |
1560 | 1570 | | |
1561 | 1571 | | |
1562 | 1572 | | |
| |||
1583 | 1593 | | |
1584 | 1594 | | |
1585 | 1595 | | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
1586 | 1601 | | |
1587 | 1602 | | |
| 1603 | + | |
| 1604 | + | |
1588 | 1605 | | |
1589 | 1606 | | |
1590 | 1607 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
304 | 303 | | |
305 | | - | |
306 | 304 | | |
307 | 305 | | |
308 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
0 commit comments