Re: [PATCH] config: mark otherise unused function as file-scope static
- From
Ramsay Jones <ramsay@ramsayjones.plus.com>
- Date
- Nov 20, 2025, 21:15 UTC
- Message-ID
- <e67ee4f6-9516-4561-b9f4-06e9049ff2ba@ramsayjones.plus.com>
- In-Reply-To
- <xmqqtsyo7b4y.fsf@gitster.g>
On 20/11/2025 7:32 pm, Junio C Hamano wrote:
Show 13 quoted lines
> git_configset_get_pathname() is only used once inside config.c; we do > not have to expose it as a public function. > > Signed-off-by: Junio C Hamano <gitster@pobox.com> > --- > > * Not related to anything in particular, but something I noticed > while I was in the vicinity. > > config.c | 2 +- > config.h | 1 - > 2 files changed, 1 insertion(+), 2 deletions(-) >
Similarly, not related to anything, but ...
I have been meaning (for years and years) to look at all of the symbols that my 'static-check.pl' script produces to see if any of them can be treated similarly. Note that there are a few ('sc' for master branch, 'nsc' for next branch and 'ssc' for seen branch):
$ wc -l sc nsc ssc
102 sc
102 nsc
120 ssc
324 total
$ The symbols from config.o:
$ grep config.o sc config.o - git_config_from_parameters config.o - git_configset_get_bool_or_int config.o - git_configset_get_int config.o - git_configset_get_maybe_bool config.o - git_configset_get_pathname config.o - git_configset_get_string config.o - git_configset_get_ulong config.o - git_die_config_linenr config.o - repo_config_copy_section_in_file config.o - repo_config_get_bool_or_int config.o - repo_config_set_multivar_in_file $
Note that the 'seen' branch add quite a few new symbols:
$ diff nsc ssc 0a1,2 > add-interactive.o - clear_add_i_state > add-interactive.o - init_add_i_state 38a41,44 > hash.o - git_hash_alloc > hash.o - git_hash_free > hash.o - git_hash_init > hash.o - hash_algo_ptr_by_number 52a59 > packfile.o - mark_bad_packed_object 54d60 < packfile.o - packfile_store_close 84a91 > setup.o - check_repository_format 85a93 > setup.o - setup_git_env 99a108,117 > trailer.o - blank_line_before_trailer_block > trailer.o - format_trailers > trailer.o - free_trailers > trailer.o - parse_trailers > trailer.o - parse_trailers_from_command_line_args > trailer.o - parse_trailers_from_config > trailer.o - process_trailers_lists > trailer.o - trailer_block_end > trailer.o - trailer_block_release > trailer.o - trailer_block_start $
ATB, Ramsay Jones