{"thread":{"id":"64517","subject":"[PATCH] config: mark otherise unused function as file-scope static","startedAt":"2025-11-20T19:32:47Z","lastAt":"2025-11-20T23:02:04Z","messageCount":4,"participants":["Junio C Hamano","Ramsay Jones","brian m. carlson","Kristoffer Haugsbakk"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"531072","messageId":"xmqqtsyo7b4y.fsf@gitster.g","threadId":"64517","inReplyTo":null,"subject":"[PATCH] config: mark otherise unused function as file-scope static","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-11-20T19:32:45Z","receivedAt":"2025-11-20T19:32:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"git_configset_get_pathname() is only used once inside config.c; we do\nnot have to expose it as a public function.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * Not related to anything in particular, but something I noticed\n   while I was in the vicinity.\n\n config.c | 2 +-\n config.h | 1 -\n 2 files changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/config.c b/config.c\nindex d55882c649..1738c0cb0d 100644\n--- a/config.c\n+++ b/config.c\n@@ -1954,7 +1954,7 @@ int git_configset_get_maybe_bool(struct config_set *set, const char *key, int *d\n \t\treturn 1;\n }\n \n-int git_configset_get_pathname(struct config_set *set, const char *key, char **dest)\n+static int git_configset_get_pathname(struct config_set *set, const char *key, char **dest)\n {\n \tconst char *value;\n \tif (!git_configset_get_value(set, key, &value, NULL))\ndiff --git a/config.h b/config.h\nindex 19c87fc0bc..ba426a960a 100644\n--- a/config.h\n+++ b/config.h\n@@ -564,7 +564,6 @@ int git_configset_get_ulong(struct config_set *cs, const char *key, unsigned lon\n int git_configset_get_bool(struct config_set *cs, const char *key, int *dest);\n int git_configset_get_bool_or_int(struct config_set *cs, const char *key, int *is_bool, int *dest);\n int git_configset_get_maybe_bool(struct config_set *cs, const char *key, int *dest);\n-int git_configset_get_pathname(struct config_set *cs, const char *key, char **dest);\n \n /**\n  * Run only the discover part of the repo_config_get_*() functions\n-- \n2.52.0-101-g4c43c53c49\n\n"},{"id":"531081","messageId":"e67ee4f6-9516-4561-b9f4-06e9049ff2ba@ramsayjones.plus.com","threadId":"64517","inReplyTo":"xmqqtsyo7b4y.fsf@gitster.g","subject":"Re: [PATCH] config: mark otherise unused function as file-scope static","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-11-20T21:15:57Z","receivedAt":"2025-11-20T21:16:06Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 20/11/2025 7:32 pm, Junio C Hamano wrote:\n> git_configset_get_pathname() is only used once inside config.c; we do\n> not have to expose it as a public function.\n> \n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n> \n>  * Not related to anything in particular, but something I noticed\n>    while I was in the vicinity.\n> \n>  config.c | 2 +-\n>  config.h | 1 -\n>  2 files changed, 1 insertion(+), 2 deletions(-)\n> \n\nSimilarly, not related to anything, but ...\n\nI have been meaning (for years and years) to look at all of the symbols\nthat my 'static-check.pl' script produces to see if any of them can be\ntreated similarly. Note that there are a few ('sc' for master branch,\n'nsc' for next branch and 'ssc' for seen branch):\n\n  $ wc -l sc nsc ssc\n    102 sc\n    102 nsc\n    120 ssc\n    324 total\n  $ \n\nThe symbols from config.o:\n\n  $ grep config.o sc\n  config.o\t- git_config_from_parameters\n  config.o\t- git_configset_get_bool_or_int\n  config.o\t- git_configset_get_int\n  config.o\t- git_configset_get_maybe_bool\n  config.o\t- git_configset_get_pathname\n  config.o\t- git_configset_get_string\n  config.o\t- git_configset_get_ulong\n  config.o\t- git_die_config_linenr\n  config.o\t- repo_config_copy_section_in_file\n  config.o\t- repo_config_get_bool_or_int\n  config.o\t- repo_config_set_multivar_in_file\n  $ \n\nNote that the 'seen' branch add quite a few new symbols:\n\n  $ diff nsc ssc\n  0a1,2\n  > add-interactive.o\t- clear_add_i_state\n  > add-interactive.o\t- init_add_i_state\n  38a41,44\n  > hash.o\t- git_hash_alloc\n  > hash.o\t- git_hash_free\n  > hash.o\t- git_hash_init\n  > hash.o\t- hash_algo_ptr_by_number\n  52a59\n  > packfile.o\t- mark_bad_packed_object\n  54d60\n  < packfile.o\t- packfile_store_close\n  84a91\n  > setup.o\t- check_repository_format\n  85a93\n  > setup.o\t- setup_git_env\n  99a108,117\n  > trailer.o\t- blank_line_before_trailer_block\n  > trailer.o\t- format_trailers\n  > trailer.o\t- free_trailers\n  > trailer.o\t- parse_trailers\n  > trailer.o\t- parse_trailers_from_command_line_args\n  > trailer.o\t- parse_trailers_from_config\n  > trailer.o\t- process_trailers_lists\n  > trailer.o\t- trailer_block_end\n  > trailer.o\t- trailer_block_release\n  > trailer.o\t- trailer_block_start\n  $ \n \n\nATB,\nRamsay Jones\n\n \n"},{"id":"531088","messageId":"aR-V45lWv6kYSe5b@fruit.crustytoothpaste.net","threadId":"64517","inReplyTo":"e67ee4f6-9516-4561-b9f4-06e9049ff2ba@ramsayjones.plus.com","subject":"Re: [PATCH] config: mark otherise unused function as file-scope static","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2025-11-20T22:27:47Z","receivedAt":"2025-11-20T22:27:49Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2025-11-20 at 21:15:57, Ramsay Jones wrote:\n>   $ diff nsc ssc\n>   0a1,2\n>   > add-interactive.o\t- clear_add_i_state\n>   > add-interactive.o\t- init_add_i_state\n>   38a41,44\n>   > hash.o\t- git_hash_alloc\n>   > hash.o\t- git_hash_free\n>   > hash.o\t- git_hash_init\n>   > hash.o\t- hash_algo_ptr_by_number\n\nThese are called from Rust code so they must be public.  They may not be\nused elsewhere in your branch if you have not compiled with Rust,\nthough.\n-- \nbrian m. carlson (they/them)\nToronto, Ontario, CA\n"},{"id":"531091","messageId":"df6a2498-a03c-4392-8091-50220db5f108@app.fastmail.com","threadId":"64517","inReplyTo":"xmqqtsyo7b4y.fsf@gitster.g","subject":"Re: [PATCH] config: mark otherise unused function as file-scope static","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2025-11-20T23:01:43Z","receivedAt":"2025-11-20T23:02:04Z","isPatch":true,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"> config: mark otherise unused function as file-scope static\n\ns/otherise/otherwise/\n\n-- \nKristoffer Haugsbakk\n"}]}