summaryrefslogtreecommitdiff
path: root/t/t4047-diff-dirstat.sh
AgeCommit message (Collapse)AuthorFilesLines
2011-04-29Refactor --dirstat parsing; deprecate --cumulative and --dirstat-by-fileLibravatar Johan Herland1-1/+122
Instead of having multiple interconnected dirstat-related options, teach the --dirstat option itself to accept all behavior modifiers as parameters. - Preserve the current --dirstat=<limit> (where <limit> is an integer specifying a cut-off percentage) - Add --dirstat=cumulative, replacing --cumulative - Add --dirstat=files, replacing --dirstat-by-file - Also add --dirstat=changes and --dirstat=noncumulative for specifying the current default behavior. These allow the user to reset other --dirstat parameters (e.g. 'cumulative' and 'files') occuring earlier on the command line. The deprecated options (--cumulative and --dirstat-by-file) are still functional, although they have been removed from the documentation. Allow multiple parameters to be separated by commas, e.g.: --dirstat=files,10,cumulative Update the documentation accordingly, and add testcases verifying the behavior of the new syntax. Improved-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-29Make --dirstat=0 output directories that contribute < 0.1% of changesLibravatar Johan Herland1-2/+2
The expected output from --dirstat=0, is to include any directory with changes, even if those changes contribute a minuscule portion of the total changes. However, currently, directories that contribute less than 0.1% are not included, since their 'permille' value is 0, and there is an 'if (permille)' check in gather_dirstat() that causes them to be ignored. This test is obviously intended to exclude directories that contribute no changes whatsoever, but in this case, it hits too broadly. The correct check is against 'this_dir' from which the permille is calculated. Only if this value is 0 does the directory truly contribute no changes, and should be skipped from the output. This patches fixes this issue, and updates corresponding testcases to expect the new behvaior. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-29Add several testcases for --dirstat and friendsLibravatar Johan Herland1-0/+585
Currently, t4013 is the only selftest that exercises the --dirstat machinery, but it only does a superficial verification of --dirstat's output. This patch adds a new selftest - t4047-diff-dirstat.sh - which prepares a commit containing: - unchanged files, changed files and files with rearranged lines - copied files, moved files, and unmoved files It then verifies the correct dirstat output for that commit in the following dirstat modes: - --dirstat - -X - --dirstat=0 - -X0 - --cumulative - --dirstat-by-file - (plus combinations of the above) Each of the above tests are also run with: - no rename detection - rename detection (-M) - expensive copy detection (-C -C) Improved-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>