Skip to content

Commit bac2805

Browse files
committed
Add the experimental git survey command to analyze (large) local repositories (#667)
This command is inspired by [`git sizer`](https://github.com/github/git-sizer), having the advantage of being much closer to the internals of Git. The intention is to provide a built-in command that can be used to analyze large repositories for performance and scaling problems, for growth over time, and to correlate with other measurements (in particular with Trace2 data collected e.g. via https://github.com/git-ecosystem/trace2receiver/).
2 parents f8714b5 + a622d50 commit bac2805

File tree

4 files changed

+988
-15
lines changed

4 files changed

+988
-15
lines changed

Documentation/config/survey.adoc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,44 @@ survey.*::
44
background with these options.
55
+
66
--
7+
survey.namerev::
8+
Boolean to show/hide `git name-rev` information for each
9+
reported commit and the containing commit of each
10+
reported tree and blob.
711
verbose::
812
This boolean value implies the `--[no-]verbose` option.
913
progress::
1014
This boolean value implies the `--[no-]progress` option.
1115
top::
1216
This integer value implies `--top=<N>`, specifying the
1317
number of entries in the detail tables.
18+
showBlobSizes::
19+
A non-negative integer value. Requests details on the
20+
<n> largest file blobs by size in bytes. Provides a
21+
default value for `--blob-sizes=<n>` in
22+
linkgit:git-survey[1].
23+
showCommitParents::
24+
A non-negative integer value. Requests details on the
25+
<n> commits with the most number of parents. Provides a
26+
default value for `--commit-parents=<n>` in
27+
linkgit:git-survey[1].
28+
showCommitSizes::
29+
A non-negative integer value. Requests details on the
30+
<n> largest commits by size in bytes. Generally, these
31+
are the commits with the largest commit messages.
32+
Provides a default value for `--commit-sizes=<n>` in
33+
linkgit:git-survey[1].
34+
showTreeEntries::
35+
A non-negative integer value. Requests details on the
36+
<n> trees (directories) with the most number of entries
37+
(files and subdirectories). Provides a default value
38+
for `--tree-entries=<n>` in linkgit:git-survey[1].
39+
showTreeSizes::
40+
A non-negative integer value. Requests details on the
41+
<n> largest trees (directories) by size in bytes. This
42+
will set will usually be equal to the
43+
`survey.showTreeEntries` set, but may be skewed by very
44+
long file or subdirectory entry names. Provides a
45+
default value for `--tree-sizes=<n>` in
46+
linkgit:git-survey[1].
1447
--

Documentation/git-survey.adoc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ OPTIONS
3232
--progress::
3333
Show progress. This is automatically enabled when interactive.
3434

35+
--name-rev::
36+
--no-name-rev::
37+
Print `git name-rev` output for each commit, tree, and blob.
38+
Defaults to true.
39+
3540
Ref Selection
3641
~~~~~~~~~~~~~
3742

@@ -59,6 +64,32 @@ only refs for the given options are added.
5964
--other::
6065
Add notes (`refs/notes/`) and stashes (`refs/stash/`) to the set.
6166

67+
Large Item Selection
68+
~~~~~~~~~~~~~~~~~~~~
69+
70+
The following options control the optional display of large items under
71+
various dimensions of scale. The OID of the largest `n` objects will be
72+
displayed in reverse sorted order. For each, `n` defaults to 10.
73+
74+
--commit-parents::
75+
Shows the OIDs of the commits with the most parent commits.
76+
77+
--commit-sizes::
78+
Shows the OIDs of the largest commits by size in bytes. This is
79+
usually the ones with the largest commit messages.
80+
81+
--tree-entries::
82+
Shows the OIDs of the trees with the most number of entries. These
83+
are the directories with the most number of files or subdirectories.
84+
85+
--tree-sizes::
86+
Shows the OIDs of the largest trees by size in bytes. This set
87+
will usually be the same as the vector of number of entries unless
88+
skewed by very long entry names.
89+
90+
--blob-sizes::
91+
Shows the OIDs of the largest blobs by size in bytes.
92+
6293
OUTPUT
6394
------
6495

@@ -78,6 +109,11 @@ Reachable Object Summary
78109
The reachable object summary shows the total number of each kind of Git
79110
object, including tags, commits, trees, and blobs.
80111

112+
CONFIGURATION
113+
-------------
114+
115+
include::config/survey.adoc[]
116+
81117
GIT
82118
---
83119
Part of the linkgit:git[1] suite

0 commit comments

Comments
 (0)