mirror of
https://github.com/git/git.git
synced 2024-11-14 13:13:01 +01:00
Mirror of https://github.com/git/git
7df7c019c2
This adds a new form of overview diffstat output, doing something that I have occasionally ended up doing manually (and badly, because it's actually pretty nasty to do), and that I think is very useful for an project like the kernel that has a fairly deep and well-separated directory structure with semantic meaning. What I mean by that is that it's often interesting to see exactly which sub-directories are impacted by a patch, and to what degree - even if you don't perhaps care so much about the individual files themselves. What makes the concept more interesting is that the "impact" is often hierarchical: in the kernel, for example, something could either have a very localized impact to "fs/ext3/" and then it's interesting to see that such a patch changes mostly that subdirectory, but you could have another patch that changes some generic VFS-layer issue which affects _many_ subdirectories that are all under "fs/", but none - or perhaps just a couple of them - of the individual filesystems are interesting in themselves. So what commonly happens is that you may have big changes in a specific sub-subdirectory, but still also significant separate changes to the subdirectory leading up to that - maybe you have significant VFS-level changes, but *also* changes under that VFS layer in the NFS-specific directories, for example. In that case, you do want the low-level parts that are significant to show up, but then the insignificant ones should show up as under the more generic top-level directory. This patch shows all of that with "--dirstat". The output can be either something simple like commit 81772fe... Author: Thomas Gleixner <tglx@linutronix.de> Date: Sun Feb 10 23:57:36 2008 +0100 x86: remove over noisy debug printk pageattr-test.c contains a noisy debug printk that people reported. The condition under which it prints (randomly tapping into a mem_map[] hole and not being able to c_p_a() there) is valid behavior and not interesting to report. Remove it. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> 100.0% arch/x86/mm/ or something much more complex like commit e231c2e... Author: David Howells <dhowells@redhat.com> Date: Thu Feb 7 00:15:26 2008 -0800 Convert ERR_PTR(PTR_ERR(p)) instances to ERR_CAST(p) 20.5% crypto/ 7.6% fs/afs/ 7.6% fs/fuse/ 7.6% fs/gfs2/ 5.1% fs/jffs2/ 5.1% fs/nfs/ 5.1% fs/nfsd/ 7.6% fs/reiserfs/ 15.3% fs/ 7.6% net/rxrpc/ 10.2% security/keys/ where that latter example is an example of significant work in some individual fs/*/ subdirectories (like the patches to reiserfs accounting for 7.6% of the whole), but then discounting those individual filesystems, there's also 15.3% other "random" things that weren't worth reporting on their oen left over under fs/ in general (either in that directory itself, or in subdirectories of fs/ that didn't have enough changes to be reported individually). I'd like to stress that the "15.3% fs/" mentioned above is the stuff that is under fs/ but that was _not_ significant enough to report on its own. So the above does _not_ mean that 15.3% of the work was under fs/ per se, because that 15.3% does *not* include the already-reported 7.6% of afs, 7.6% of fuse etc. If you want to enable "cumulative" directory statistics, you can use the "--cumulative" flag, which adds up percentages recursively even when they have been already reported for a sub-directory. That cumulative output is disabled if *all* of the changes in one subdirectory come from a deeper subdirectory, to avoid repeating subdirectories all the way to the root. For an example of the cumulative reporting, the above commit becomes commit e231c2e... Author: David Howells <dhowells@redhat.com> Date: Thu Feb 7 00:15:26 2008 -0800 Convert ERR_PTR(PTR_ERR(p)) instances to ERR_CAST(p) 20.5% crypto/ 7.6% fs/afs/ 7.6% fs/fuse/ 7.6% fs/gfs2/ 5.1% fs/jffs2/ 5.1% fs/nfs/ 5.1% fs/nfsd/ 7.6% fs/reiserfs/ 61.5% fs/ 7.6% net/rxrpc/ 10.2% security/keys/ in which the commit percentages now obviously add up to much more than 100%: now the changes that were already reported for the sub-directories under fs/ are then cumulatively included in the whole percentage of fs/ (ie now shows 61.5% as opposed to the 15.3% without the cumulative reporting). The default reporting limit has been arbitrarily set at 3%, which seems to be a pretty good cut-off, but you can specify the cut-off manually by giving it as an option parameter (eg "--dirstat=5" makes the cut-off be at 5% instead) NOTE! The percentages are purely about the total lines added and removed, not anything smarter (or dumber) than that. Also note that you should not generally expect things to add up to 100%: not only does it round down, we don't report leftover scraps (they add up to the top-level change count, but we don't even bother reporting that, it only reports subdirectories). Quite frankly, as a top-level manager this is really convenient for me, but it's going to be very boring for git itself since there are few subdirectories. Also, don't expect things to make tons of sense if you combine this with "-M" and there are cross-directory renames etc. But even for git itself, you can get some fun statistics. Try out git log --dirstat and see the occasional mentions of things like Documentation/, git-gui/, gitweb/ and gitk-git/. Or try out something like git diff --dirstat v1.5.0..v1.5.4 which does kind of git an overview that shows *something*. But in general, the output is more exciting for big projects with deeper structure, and doing a git diff --dirstat v2.6.24..v2.6.25-rc1 on the kernel is what I actually wrote this for! Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com> |
||
---|---|---|
arm | ||
compat | ||
contrib | ||
Documentation | ||
git-gui | ||
gitk-git | ||
gitweb | ||
mozilla-sha1 | ||
perl | ||
ppc | ||
t | ||
templates | ||
xdiff | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
alloc.c | ||
archive-tar.c | ||
archive-zip.c | ||
archive.c | ||
archive.h | ||
attr.c | ||
attr.h | ||
base85.c | ||
blob.c | ||
blob.h | ||
builtin-add.c | ||
builtin-annotate.c | ||
builtin-apply.c | ||
builtin-archive.c | ||
builtin-blame.c | ||
builtin-branch.c | ||
builtin-bundle.c | ||
builtin-cat-file.c | ||
builtin-check-attr.c | ||
builtin-check-ref-format.c | ||
builtin-checkout-index.c | ||
builtin-clean.c | ||
builtin-commit-tree.c | ||
builtin-commit.c | ||
builtin-config.c | ||
builtin-count-objects.c | ||
builtin-describe.c | ||
builtin-diff-files.c | ||
builtin-diff-index.c | ||
builtin-diff-tree.c | ||
builtin-diff.c | ||
builtin-fast-export.c | ||
builtin-fetch--tool.c | ||
builtin-fetch-pack.c | ||
builtin-fetch.c | ||
builtin-fmt-merge-msg.c | ||
builtin-for-each-ref.c | ||
builtin-fsck.c | ||
builtin-gc.c | ||
builtin-grep.c | ||
builtin-http-fetch.c | ||
builtin-init-db.c | ||
builtin-log.c | ||
builtin-ls-files.c | ||
builtin-ls-remote.c | ||
builtin-ls-tree.c | ||
builtin-mailinfo.c | ||
builtin-mailsplit.c | ||
builtin-merge-base.c | ||
builtin-merge-file.c | ||
builtin-merge-ours.c | ||
builtin-mv.c | ||
builtin-name-rev.c | ||
builtin-pack-objects.c | ||
builtin-pack-refs.c | ||
builtin-prune-packed.c | ||
builtin-prune.c | ||
builtin-push.c | ||
builtin-read-tree.c | ||
builtin-reflog.c | ||
builtin-rerere.c | ||
builtin-reset.c | ||
builtin-rev-list.c | ||
builtin-rev-parse.c | ||
builtin-revert.c | ||
builtin-rm.c | ||
builtin-send-pack.c | ||
builtin-shortlog.c | ||
builtin-show-branch.c | ||
builtin-show-ref.c | ||
builtin-stripspace.c | ||
builtin-symbolic-ref.c | ||
builtin-tag.c | ||
builtin-tar-tree.c | ||
builtin-unpack-objects.c | ||
builtin-update-index.c | ||
builtin-update-ref.c | ||
builtin-upload-archive.c | ||
builtin-verify-pack.c | ||
builtin-verify-tag.c | ||
builtin-write-tree.c | ||
builtin.h | ||
bundle.c | ||
bundle.h | ||
cache-tree.c | ||
cache-tree.h | ||
cache.h | ||
check-builtins.sh | ||
check-racy.c | ||
color.c | ||
color.h | ||
combine-diff.c | ||
command-list.txt | ||
commit.c | ||
commit.h | ||
config.c | ||
config.mak.in | ||
configure.ac | ||
connect.c | ||
convert.c | ||
copy.c | ||
COPYING | ||
csum-file.c | ||
csum-file.h | ||
ctype.c | ||
daemon.c | ||
date.c | ||
decorate.c | ||
decorate.h | ||
delta.h | ||
diff-delta.c | ||
diff-lib.c | ||
diff.c | ||
diff.h | ||
diffcore-break.c | ||
diffcore-delta.c | ||
diffcore-order.c | ||
diffcore-pickaxe.c | ||
diffcore-rename.c | ||
diffcore.h | ||
dir.c | ||
dir.h | ||
dump-cache-tree.c | ||
entry.c | ||
environment.c | ||
exec_cmd.c | ||
exec_cmd.h | ||
fast-import.c | ||
fetch-pack.h | ||
fixup-builtins | ||
generate-cmdlist.sh | ||
git-add--interactive.perl | ||
git-am.sh | ||
git-archimport.perl | ||
git-bisect.sh | ||
git-checkout.sh | ||
git-clone.sh | ||
git-compat-util.h | ||
git-cvsexportcommit.perl | ||
git-cvsimport.perl | ||
git-cvsserver.perl | ||
git-filter-branch.sh | ||
git-help--browse.sh | ||
git-instaweb.sh | ||
git-lost-found.sh | ||
git-merge-octopus.sh | ||
git-merge-one-file.sh | ||
git-merge-resolve.sh | ||
git-merge-stupid.sh | ||
git-merge.sh | ||
git-mergetool.sh | ||
git-parse-remote.sh | ||
git-pull.sh | ||
git-quiltimport.sh | ||
git-rebase--interactive.sh | ||
git-rebase.sh | ||
git-relink.perl | ||
git-remote.perl | ||
git-repack.sh | ||
git-request-pull.sh | ||
git-send-email.perl | ||
git-sh-setup.sh | ||
git-stash.sh | ||
git-submodule.sh | ||
git-svn.perl | ||
GIT-VERSION-GEN | ||
git.c | ||
git.spec.in | ||
grep.c | ||
grep.h | ||
hash-object.c | ||
hash.c | ||
hash.h | ||
help.c | ||
http-push.c | ||
http-walker.c | ||
http.c | ||
http.h | ||
ident.c | ||
imap-send.c | ||
index-pack.c | ||
INSTALL | ||
interpolate.c | ||
interpolate.h | ||
list-objects.c | ||
list-objects.h | ||
lockfile.c | ||
log-tree.c | ||
log-tree.h | ||
mailmap.c | ||
mailmap.h | ||
Makefile | ||
match-trees.c | ||
merge-file.c | ||
merge-index.c | ||
merge-recursive.c | ||
merge-tree.c | ||
mktag.c | ||
mktree.c | ||
object-refs.c | ||
object.c | ||
object.h | ||
pack-check.c | ||
pack-redundant.c | ||
pack-write.c | ||
pack.h | ||
pager.c | ||
parse-options.c | ||
parse-options.h | ||
patch-delta.c | ||
patch-id.c | ||
patch-ids.c | ||
patch-ids.h | ||
path-list.c | ||
path-list.h | ||
path.c | ||
pkt-line.c | ||
pkt-line.h | ||
pretty.c | ||
progress.c | ||
progress.h | ||
quote.c | ||
quote.h | ||
reachable.c | ||
reachable.h | ||
read-cache.c | ||
README | ||
receive-pack.c | ||
reflog-walk.c | ||
reflog-walk.h | ||
refs.c | ||
refs.h | ||
RelNotes | ||
remote.c | ||
remote.h | ||
revision.c | ||
revision.h | ||
run-command.c | ||
run-command.h | ||
send-pack.h | ||
server-info.c | ||
setup.c | ||
sha1_file.c | ||
sha1_name.c | ||
shallow.c | ||
shell.c | ||
show-index.c | ||
sideband.c | ||
sideband.h | ||
strbuf.c | ||
strbuf.h | ||
symlinks.c | ||
tag.c | ||
tag.h | ||
tar.h | ||
test-absolute-path.c | ||
test-chmtime.c | ||
test-date.c | ||
test-delta.c | ||
test-genrandom.c | ||
test-match-trees.c | ||
test-parse-options.c | ||
test-sha1.c | ||
test-sha1.sh | ||
trace.c | ||
transport.c | ||
transport.h | ||
tree-diff.c | ||
tree-walk.c | ||
tree-walk.h | ||
tree.c | ||
tree.h | ||
unpack-file.c | ||
unpack-trees.c | ||
unpack-trees.h | ||
update-server-info.c | ||
upload-pack.c | ||
usage.c | ||
utf8.c | ||
utf8.h | ||
var.c | ||
walker.c | ||
walker.h | ||
write_or_die.c | ||
ws.c | ||
wt-status.c | ||
wt-status.h | ||
xdiff-interface.c | ||
xdiff-interface.h |
//////////////////////////////////////////////////////////////// GIT - the stupid content tracker //////////////////////////////////////////////////////////////// "git" can mean anything, depending on your mood. - random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronunciation of "get" may or may not be relevant. - stupid. contemptible and despicable. simple. Take your pick from the dictionary of slang. - "global information tracker": you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room. - "goddamn idiotic truckload of sh*t": when it breaks Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals. Git is an Open Source project covered by the GNU General Public License. It was originally written by Linus Torvalds with help of a group of hackers around the net. It is currently maintained by Junio C Hamano. Please read the file INSTALL for installation instructions. See Documentation/tutorial.txt to get started, then see Documentation/everyday.txt for a useful minimum set of commands, and "man git-commandname" for documentation of each command. CVS users may also want to read Documentation/cvs-migration.txt. Many Git online resources are accessible from http://git.or.cz/ including full documentation and Git related tools. The user discussion and development of Git take place on the Git mailing list -- everyone is welcome to post bug reports, feature requests, comments and patches to git@vger.kernel.org. To subscribe to the list, send an email with just "subscribe git" in the body to majordomo@vger.kernel.org. The mailing list archives are available at http://marc.theaimsgroup.com/?l=git and other archival sites. The messages titled "A note from the maintainer", "What's in git.git (stable)" and "What's cooking in git.git (topics)" and the discussion following them on the mailing list give a good reference for project status, development direction and remaining tasks.