From: Lidong Yan Date: Wed, 16 Jul 2025 01:39:53 GMT Subject: Re: [BUG] git pull ignores pull.autostash=true configuration when used with --git-dir and --work-tree flags on a bare repository Message-ID: <6AEC3113-D687-42E0-B6D0-DF62FA1A9A8B@gmail.com> In-Reply-To: Junio C Hamano writes: > > Lidong Yan writes: > >> Bryan Lee wrote: >>> >>> Would it be worthwhile to: >>> 1. Add a warning when users set non-existent configuration keys? >>> 2. Or at least document common misconceptions like `pull.autostash` in >>> the git-config man page? >> >> I think adding a subcommand like ‘git config verify’ might be a way to >> solve this problem. > > Yes, but I do not know if it is feasible. > > There always are end-user or third-party defined keys that are not > known to us, and we cannot tell if an unknown variable is such a > end-user defined one or a typo of a known one. For every git_xxx_config(), we could add a register function like git_xxx_config_register(), which looks like: int git_xxx_config_register() { struct key_ent ent; register_bool_key("key1"); register_int_key("key2”); register_date_key("key3”); ent.key = “key4”; ent.desp = “key4_desp"; ent.verify_fn = &verify_key4_value; register_key(ent); } And then end-user could define their own register function as well so that they could also use `git config verify` to verify their own config . Or end-user could provide a .gitconfigspec and `git config verify` will load .gitconfigspec to verify whether there exists some invalid config pair. - Lidong