]> git.ipfire.org Git - thirdparty/git.git/commit
scalar-diagnose: move functionality to common location
authorVictoria Dye <vdye@github.com>
Fri, 12 Aug 2022 20:10:13 +0000 (20:10 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 12 Aug 2022 20:20:02 +0000 (13:20 -0700)
commitbb2c34956ad4fab1e7619327219fb5a5a49f571b
treed1fbc44065b00dae27bc784b5cf9b61f106b713f
parent435a2535b72aa0e3a2e152841fe79c5b65a6e8c0
scalar-diagnose: move functionality to common location

Move the core functionality of 'scalar diagnose' into a new 'diagnose.[c,h]'
library to prepare for new callers in the main Git tree generating
diagnostic archives. These callers will be introduced in subsequent patches.

While this patch appears large, it is mostly made up of moving code out of
'scalar.c' and into 'diagnose.c'. Specifically, the functions

- dir_file_stats_objects()
- dir_file_stats()
- count_files()
- loose_objs_stats()
- add_directory_to_archiver()

are all copied verbatim from 'scalar.c'. The 'create_diagnostics_archive()'
function is a mostly identical (partial) copy of 'cmd_diagnose()', with the
primary changes being that 'zip_path' is an input and "Enlistment root" is
corrected to "Repository root" in the archiver log.

Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
contrib/scalar/scalar.c
diagnose.c [new file with mode: 0644]
diagnose.h [new file with mode: 0644]