diff options
author | Johan Herland <johan@herland.net> | 2011-04-11 02:48:52 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-04-11 22:16:15 +0400 |
commit | 2ff3a80334115797b8446909655e536f43900bc5 (patch) | |
tree | c3c56eea112b1634548a490d4610d23d62c4fc1d /t/t4013 | |
parent | 0133dab75d8b15c559aa9df66134d72dce0e0476 (diff) |
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 <johan@herland.net>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013')
-rw-r--r-- | t/t4013/diff.diff_--dirstat_initial_rearrange | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/t/t4013/diff.diff_--dirstat_initial_rearrange b/t/t4013/diff.diff_--dirstat_initial_rearrange index fb2e17dd2e4..5fb02c13bc5 100644 --- a/t/t4013/diff.diff_--dirstat_initial_rearrange +++ b/t/t4013/diff.diff_--dirstat_initial_rearrange @@ -1,2 +1,3 @@ $ git diff --dirstat initial rearrange + 100.0% dir/ $ |