Skip to content

Commit

Permalink
survey: add vector of largest objects for various scaling dimensions
Browse files Browse the repository at this point in the history
Create `struct large_item` and `struct large_item_vec` to capture the
n largest commits, trees, and blobs under various scaling dimensions,
such as size in bytes, number of commit parents, or number of entries
in a tree.

Each of these have a command line option to set them independently.

Signed-off-by: Jeff Hostetler <[email protected]>
  • Loading branch information
jeffhostetler authored and dscho committed Jul 17, 2024
1 parent 9897239 commit d90ba6a
Show file tree
Hide file tree
Showing 4 changed files with 304 additions and 10 deletions.
2 changes: 2 additions & 0 deletions Documentation/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@ include::config/status.txt[]

include::config/submodule.txt[]

include::config/survey.txt[]

include::config/tag.txt[]

include::config/tar.txt[]
Expand Down
36 changes: 36 additions & 0 deletions Documentation/config/survey.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
survey.progress::
Boolean to show/hide progress information. Defaults to
true when interactive (stderr is bound to a TTY).

survey.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].

survey.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].

survey.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].

survey.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].

survey.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].

survey.verbose::
Boolean to show/hide verbose output. Default to false.
31 changes: 31 additions & 0 deletions Documentation/git-survey.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,43 @@ 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
------

By default, `git survey` will print information about the repository in a
human-readable format that includes overviews and tables.

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

include::config/survey.txt[]

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

0 comments on commit d90ba6a

Please sign in to comment.