Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictoria Dye <vdye@github.com>2022-08-12 23:10:14 +0300
committerJunio C Hamano <gitster@pobox.com>2022-08-12 23:20:02 +0300
commit33cba726f03e1e06b10b85cf4a1cbd1017810486 (patch)
treecd8c7fdd2b4655f4226aede0429a715e630fc67c /diagnose.h
parentbb2c34956ad4fab1e7619327219fb5a5a49f571b (diff)
diagnose.c: add option to configure archive contents
Update 'create_diagnostics_archive()' to take an argument 'mode'. When archiving diagnostics for a repository, 'mode' is used to selectively include/exclude information based on its value. The initial options for 'mode' are: * DIAGNOSE_NONE: do not collect any diagnostics or create an archive (no-op). * DIAGNOSE_STATS: collect basic repository metadata (Git version, repo path, filesystem available space) as well as sizing and count statistics for the repository's objects and packfiles. * DIAGNOSE_ALL: collect basic repository metadata, sizing/count statistics, and copies of the '.git', '.git/hooks', '.git/info', '.git/logs', and '.git/objects/info' directories. These modes are introduced to provide users the option to collect diagnostics without the sensitive information included in copies of '.git' dir contents. At the moment, only 'scalar diagnose' uses 'create_diagnostics_archive()' (with a hardcoded 'DIAGNOSE_ALL' mode to match existing functionality), but more callers will be introduced in subsequent patches. Finally, refactor from a hardcoded set of 'add_directory_to_archiver()' calls to iterative invocations gated by 'DIAGNOSE_ALL'. This allows for easier future modification of the set of directories to archive and improves error reporting when 'add_directory_to_archiver()' fails. Helped-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Victoria Dye <vdye@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diagnose.h')
-rw-r--r--diagnose.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/diagnose.h b/diagnose.h
index 06dca69bda..998775857a 100644
--- a/diagnose.h
+++ b/diagnose.h
@@ -3,6 +3,12 @@
#include "strbuf.h"
-int create_diagnostics_archive(struct strbuf *zip_path);
+enum diagnose_mode {
+ DIAGNOSE_NONE,
+ DIAGNOSE_STATS,
+ DIAGNOSE_ALL
+};
+
+int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode);
#endif /* DIAGNOSE_H */