Skip to content

Commit

Permalink
Add the experimental git survey command to analyze (large) local repo…
Browse files Browse the repository at this point in the history
…sitories (#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/).
  • Loading branch information
dscho committed Oct 8, 2024
2 parents fae8d7d + 590936c commit 3d1112f
Show file tree
Hide file tree
Showing 4 changed files with 988 additions and 16 deletions.
33 changes: 33 additions & 0 deletions Documentation/config/survey.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,44 @@ survey.*::
background with these options.
+
--
survey.namerev::
Boolean to show/hide `git name-rev` information for each
reported commit and the containing commit of each
reported tree and blob.
verbose::
This boolean value implies the `--[no-]verbose` option.
progress::
This boolean value implies the `--[no-]progress` option.
top::
This integer value implies `--top=<N>`, specifying the
number of entries in the detail tables.
showBlobSizes::
A non-negative integer value. Requests details on the
<n> largest file blobs by size in bytes. Provides a
default value for `--blob-sizes=<n>` in
linkgit:git-survey[1].
showCommitParents::
A non-negative integer value. Requests details on the
<n> commits with the most number of parents. Provides a
default value for `--commit-parents=<n>` in
linkgit:git-survey[1].
showCommitSizes::
A non-negative integer value. Requests details on the
<n> largest commits by size in bytes. Generally, these
are the commits with the largest commit messages.
Provides a default value for `--commit-sizes=<n>` in
linkgit:git-survey[1].
showTreeEntries::
A non-negative integer value. Requests details on the
<n> trees (directories) with the most number of entries
(files and subdirectories). Provides a default value
for `--tree-entries=<n>` in linkgit:git-survey[1].
showTreeSizes::
A non-negative integer value. Requests details on the
<n> largest trees (directories) by size in bytes. This
will set will usually be equal to the
`survey.showTreeEntries` set, but may be skewed by very
long file or subdirectory entry names. Provides a
default value for `--tree-sizes=<n>` in
linkgit:git-survey[1].
--
35 changes: 35 additions & 0 deletions Documentation/git-survey.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ OPTIONS
--progress::
Show progress. This is automatically enabled when interactive.

--[no-]name-rev::
Print `git name-rev` output for each commit, tree, and blob.
Defaults to true.

Ref Selection
~~~~~~~~~~~~~

Expand Down Expand Up @@ -59,6 +63,32 @@ only refs for the given options are added.
--other::
Add notes (`refs/notes/`) and stashes (`refs/stash/`) to the set.

Large Item Selection
~~~~~~~~~~~~~~~~~~~~

The following options control the optional display of large items under
various dimensions of scale. The OID of the largest `n` objects will be
displayed in reverse sorted order. For each, `n` defaults to 10.

--commit-parents::
Shows the OIDs of the commits with the most parent commits.

--commit-sizes::
Shows the OIDs of the largest commits by size in bytes. This is
usually the ones with the largest commit messages.

--tree-entries::
Shows the OIDs of the trees with the most number of entries. These
are the directories with the most number of files or subdirectories.

--tree-sizes::
Shows the OIDs of the largest trees by size in bytes. This set
will usually be the same as the vector of number of entries unless
skewed by very long entry names.

--blob-sizes::
Shows the OIDs of the largest blobs by size in bytes.

OUTPUT
------

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

CONFIGURATION
-------------

include::config/survey.txt[]

GIT
---
Part of the linkgit:git[1] suite
Loading

0 comments on commit 3d1112f

Please sign in to comment.