From 204f01a2f734fddab95b09123b04b1305620e7b6 Mon Sep 17 00:00:00 2001 From: Johan Herland Date: Mon, 11 Apr 2011 00:48:50 +0200 Subject: --dirstat: Describe non-obvious differences relative to --stat or regular diff Also add a testcase documenting the current behavior. Improved-by: Junio C Hamano Signed-off-by: Johan Herland Acked-by: Linus Torvalds Signed-off-by: Junio C Hamano --- t/t4013/diff.diff_--dirstat_initial_rearrange | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 t/t4013/diff.diff_--dirstat_initial_rearrange (limited to 't/t4013/diff.diff_--dirstat_initial_rearrange') diff --git a/t/t4013/diff.diff_--dirstat_initial_rearrange b/t/t4013/diff.diff_--dirstat_initial_rearrange new file mode 100644 index 0000000000..fb2e17dd2e --- /dev/null +++ b/t/t4013/diff.diff_--dirstat_initial_rearrange @@ -0,0 +1,2 @@ +$ git diff --dirstat initial rearrange +$ -- cgit v1.2.3 From 2ff3a80334115797b8446909655e536f43900bc5 Mon Sep 17 00:00:00 2001 From: Johan Herland Date: Mon, 11 Apr 2011 00:48:52 +0200 Subject: 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 Acked-by: Linus Torvalds Signed-off-by: Junio C Hamano --- t/t4013/diff.diff_--dirstat_initial_rearrange | 1 + 1 file changed, 1 insertion(+) (limited to 't/t4013/diff.diff_--dirstat_initial_rearrange') diff --git a/t/t4013/diff.diff_--dirstat_initial_rearrange b/t/t4013/diff.diff_--dirstat_initial_rearrange index fb2e17dd2e..5fb02c13bc 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/ $ -- cgit v1.2.3