Skip to content

Commit

Permalink
survey: add config settings for large_item_vec
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Hostetler <jeffhostetler@github.com>
  • Loading branch information
jeffhostetler committed May 15, 2024
1 parent 5a8f516 commit 5a52c6e
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 3 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.
25 changes: 22 additions & 3 deletions builtin/survey.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,28 @@ static int survey_load_config_cb(const char *var, const char *value,
return 0;
}

/*
* TODO Check for other survey-specific key/value pairs.
*/
if (!strcmp(var, "survey.showcommitparents")) {
survey_opts.show_largest_commits_by_nr_parents = git_config_ulong(var, value, ctx->kvi);
return 0;
}
if (!strcmp(var, "survey.showcommitsizes")) {
survey_opts.show_largest_commits_by_size_bytes = git_config_ulong(var, value, ctx->kvi);
return 0;
}

if (!strcmp(var, "survey.showtreeentries")) {
survey_opts.show_largest_trees_by_nr_entries = git_config_ulong(var, value, ctx->kvi);
return 0;
}
if (!strcmp(var, "survey.showtreesizes")) {
survey_opts.show_largest_trees_by_size_bytes = git_config_ulong(var, value, ctx->kvi);
return 0;
}

if (!strcmp(var, "survey.showblobsizes")) {
survey_opts.show_largest_blobs_by_size_bytes = git_config_ulong(var, value, ctx->kvi);
return 0;
}

return git_default_config(var, value, ctx, pvoid);
}
Expand Down

0 comments on commit 5a52c6e

Please sign in to comment.