git-commit-vandalism/Documentation
Johan Herland 1c57a627bf New --dirstat=lines mode, doing dirstat analysis based on diffstat
This patch adds an alternative implementation of show_dirstat(), called
show_dirstat_by_line(), which uses the more expensive diffstat analysis
(as opposed to show_dirstat()'s own (relatively inexpensive) analysis)
to derive the numbers from which the --dirstat output is computed.

The alternative implementation is controlled by the new "lines" parameter
to the --dirstat option (or the diff.dirstat config variable).

For binary files, the diffstat analysis counts bytes instead of lines,
so to prevent binary files from dominating the dirstat results, the
byte counts for binary files are divided by 64 before being compared to
their textual/line-based counterparts. This is a stupid and ugly - but
very cheap - heuristic.

In linux-2.6.git, running the three different --dirstat modes:

  time git diff v2.6.20..v2.6.30 --dirstat=changes > /dev/null
vs.
  time git diff v2.6.20..v2.6.30 --dirstat=lines > /dev/null
vs.
  time git diff v2.6.20..v2.6.30 --dirstat=files > /dev/null

yields the following average runtimes on my machine:

 - "changes" (default): ~6.0 s
 - "lines":             ~9.6 s
 - "files":             ~0.1 s

So, as expected, there's a considerable performance hit (~60%) by going
through the full diffstat analysis as compared to the default "changes"
analysis (obviously, "files" is much faster than both). As such, the
"lines" mode is probably only useful if you really need the --dirstat
numbers to be consistent with the numbers returned from the other
--*stat options.

The patch also includes documentation and tests for the new dirstat mode.

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-29 11:22:55 -07:00
..
howto Documentation/merge subtree How-To: fix typo 2011-02-09 14:03:51 -08:00
pt_BR
RelNotes Start 1.7.6 cycle 2011-04-27 12:09:04 -07:00
technical Merge branch 'nd/index-doc' into maint 2011-04-01 16:23:55 -07:00
.gitattributes
.gitignore
asciidoc.conf Merge branch 'jc/maint-doc-em-dash' 2010-09-03 09:43:42 -07:00
blame-options.txt
build-docdep.perl
cat-texi.perl
cmd-list.perl
CodingGuidelines CodingGuidelines: downcase placeholders in usage messages 2011-02-15 11:53:00 -08:00
config.txt Merge branch 'mz/rebase' 2011-04-28 14:11:39 -07:00
date-formats.txt
diff-config.txt New --dirstat=lines mode, doing dirstat analysis based on diffstat 2011-04-29 11:22:55 -07:00
diff-format.txt
diff-generate-patch.txt diff format documentation: clarify --cc and -c 2011-03-08 14:44:07 -08:00
diff-options.txt New --dirstat=lines mode, doing dirstat analysis based on diffstat 2011-04-29 11:22:55 -07:00
docbook-xsl.css
docbook.xsl Documentation: set a !DOCTYPE for user manual 2010-08-20 10:53:56 -07:00
everyday.txt everyday.txt: change "tracking branch" to "remote-tracking branch" 2010-11-03 09:19:10 -07:00
fetch-options.txt fetch/pull: Don't recurse into a submodule when commits are already present 2011-03-09 13:10:35 -08:00
fix-texi.perl
git-add.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-am.txt Merge branch 'maint' 2011-03-22 14:56:13 -07:00
git-annotate.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-apply.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-archimport.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-archive.txt Merge branch 'maint' 2011-04-14 12:26:45 -07:00
git-bisect-lk2009.txt Documentation: remove stray backslashes from "Fighting regressions" article 2010-08-20 14:16:51 -07:00
git-bisect.txt Merge branch 'mg/doc-bisect-tweak-worktree' into maint 2011-04-01 16:23:15 -07:00
git-blame.txt blame: add --abbrev command line option and make it honor core.abbrev 2011-04-05 20:08:41 -07:00
git-branch.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-bundle.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-cat-file.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-check-attr.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-check-ref-format.txt Documentation: gitrevisions is in section 7 2010-10-13 19:10:55 -07:00
git-checkout-index.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-checkout.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-cherry-pick.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-cherry.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-citool.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-clean.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-clone.txt init, clone: support --separate-git-dir for .git file 2011-03-19 21:48:19 -07:00
git-commit-tree.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-commit.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-config.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-count-objects.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-cvsexportcommit.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-cvsimport.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-cvsserver.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-daemon.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-describe.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-diff-files.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-diff-index.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-diff-tree.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-diff.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-difftool.txt Merge branch 'ss/mergetool--lib' 2011-03-19 23:24:27 -07:00
git-fast-export.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-fast-import.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-fetch-pack.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-fetch.txt remove doubled words, e.g., s/to to/to/, and fix related typos 2011-04-13 11:59:11 -07:00
git-filter-branch.txt Merge branch 'maint' 2011-04-01 17:45:59 -07:00
git-fmt-merge-msg.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-for-each-ref.txt Add Author and Documentation sections to git-for-each-ref.txt 2011-03-09 12:22:15 -08:00
git-format-patch.txt format-patch: document --quiet option 2011-04-12 12:50:32 -07:00
git-fsck-objects.txt doc: add missing git footers 2011-03-11 10:59:16 -05:00
git-fsck.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-gc.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-get-tar-commit-id.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-grep.txt grep: allow -E and -n to be turned on by default via configuration 2011-03-30 13:17:07 -07:00
git-gui.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-hash-object.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-help.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-http-backend.txt
git-http-fetch.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-http-push.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-imap-send.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-index-pack.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-init-db.txt doc: add missing git footers 2011-03-11 10:59:16 -05:00
git-init.txt init, clone: support --separate-git-dir for .git file 2011-03-19 21:48:19 -07:00
git-instaweb.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-log.txt Merge branch 'mg/rev-list-n-reverse-doc' 2011-03-19 23:25:32 -07:00
git-lost-found.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-ls-files.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-ls-remote.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-ls-tree.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-mailinfo.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-mailsplit.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-merge-base.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-merge-file.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-merge-index.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-merge-one-file.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-merge-tree.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-merge.txt Merge branch 'jc/merge-sans-branch' 2011-04-01 17:57:16 -07:00
git-mergetool--lib.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-mergetool.txt Merge branch 'ss/mergetool--lib' 2011-03-19 23:24:27 -07:00
git-mktag.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-mktree.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-mv.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-name-rev.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-notes.txt Provide 'git notes get-ref' to easily retrieve current notes ref 2010-11-17 13:23:55 -08:00
git-pack-objects.txt remove doubled words, e.g., s/to to/to/, and fix related typos 2011-04-13 11:59:11 -07:00
git-pack-redundant.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-pack-refs.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-parse-remote.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-patch-id.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-peek-remote.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-prune-packed.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-prune.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-pull.txt Merge branch 'jl/submodule-fetch-on-demand' 2011-04-04 15:02:01 -07:00
git-push.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-quiltimport.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-read-tree.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-rebase.txt Merge branch 'mz/rebase' 2011-04-28 14:11:39 -07:00
git-receive-pack.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-reflog.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-relink.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-remote-ext.txt Make <identifier> lowercase in Documentation 2011-02-17 11:49:54 -08:00
git-remote-fd.txt Fix typos in the documentation 2011-01-04 11:23:42 -08:00
git-remote-helpers.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-remote.txt Merge branch 'jk/maint-remote-mirror-safer' 2011-04-06 10:38:14 -07:00
git-repack.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-replace.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-repo-config.txt doc: add missing git footers 2011-03-11 10:59:16 -05:00
git-request-pull.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-rerere.txt Merge branch 'js/rerere-forget-always-take-pathspec' 2011-03-19 23:24:48 -07:00
git-reset.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-rev-list.txt Merge branch 'mg/rev-list-n-parents' 2011-03-26 20:13:17 -07:00
git-rev-parse.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-revert.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-rm.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-send-email.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-send-pack.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-sh-setup.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-shell.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-shortlog.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-show-branch.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-show-index.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-show-ref.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-show.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-stage.txt doc: add missing git footers 2011-03-11 10:59:16 -05:00
git-stash.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-status.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-stripspace.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-submodule.txt Merge branch 'nm/maint-conflicted-submodule-entries' 2011-04-04 03:41:24 -07:00
git-svn.txt Merge branch 'mh/git-svn-automkdirs' 2011-04-27 11:36:41 -07:00
git-symbolic-ref.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-tag.txt Merge branch 'maint' 2011-03-28 14:17:17 -07:00
git-tar-tree.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-tools.txt
git-unpack-file.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-unpack-objects.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-update-index.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-update-ref.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-update-server-info.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-upload-archive.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-upload-pack.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-var.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-verify-pack.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-verify-tag.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-web--browse.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-whatchanged.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git-write-tree.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
git.txt Git 1.7.5 2011-04-23 23:36:32 -07:00
gitattributes.txt docs: fix grammar in gitattributes.txt 2011-03-18 09:58:47 -07:00
gitcli.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
gitcore-tutorial.txt Documentation: gitrevisions is in section 7 2010-10-13 19:10:55 -07:00
gitcvs-migration.txt
gitdiffcore.txt gitdiffcore doc: update pickaxe description 2010-08-31 14:28:20 -07:00
gitglossary.txt
githooks.txt Documentation/githooks: post-rewrite-copy-notes never existed 2011-01-10 09:09:02 -08:00
gitignore.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
gitk.txt doc: drop author/documentation sections from most pages 2011-03-11 10:59:16 -05:00
gitmodules.txt Merge branch 'jl/submodule-fetch-on-demand' 2011-04-04 15:02:01 -07:00
gitrepository-layout.txt Documentation: spelling fixes 2010-07-20 16:59:17 -07:00
gitrevisions.txt Documentation: gitrevisions 2010-07-05 13:39:02 -07:00
gittutorial-2.txt Better "Changed but not updated" message in git-status 2010-11-03 09:18:58 -07:00
gittutorial.txt Change remote tracking to remote-tracking in non-trivial places 2010-11-03 09:19:08 -07:00
gitworkflows.txt
glossary-content.txt glossary: define pathspec 2011-02-03 13:22:58 -08:00
howto-index.sh
i18n.txt
install-doc-quick.sh
install-webdoc.sh install-webdoc: keep installed RelNotes-*.txt 2010-09-09 16:17:59 -07:00
mailmap.txt
Makefile docs: default to more modern toolset 2010-11-24 15:13:58 -08:00
manpage-1.72.xsl
manpage-base-url.xsl.in
manpage-base.xsl
manpage-bold-literal.xsl
manpage-normal.xsl
manpage-quote-apos.xsl
manpage-suppress-sp.xsl
merge-config.txt Merge branch 'jc/merge-sans-branch' 2011-04-01 17:57:16 -07:00
merge-options.txt merge: enable progress reporting for rename detection 2011-02-21 10:24:08 -08:00
merge-strategies.txt Merge branch 'kb/merge-recursive-rename-threshold' 2010-10-26 21:54:04 -07:00
pretty-formats.txt pretty: Introduce ' ' modifier to add space if non-empty 2010-06-16 14:45:09 -07:00
pretty-options.txt Remove stray quotes in --pretty and --format documentation 2010-10-08 12:31:07 -07:00
pull-fetch-param.txt
rev-list-options.txt Merge branch 'jc/rev-list-options-fix' 2011-04-04 10:55:38 -07:00
revisions.txt revisions.txt: language improvements 2011-04-04 16:43:57 -07:00
SubmittingPatches remove doubled words, e.g., s/to to/to/, and fix related typos 2011-04-13 11:59:11 -07:00
urls-remotes.txt
urls.txt Documentation: spelling fixes 2010-07-20 16:59:17 -07:00
user-manual.conf
user-manual.txt user-manual: remote-tracking can be checked out, with detached HEAD 2010-11-03 09:20:48 -07:00