git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG] git pull ignores pull.autostash=true configuration when used with --git-dir and --work-tree flags on a bare repository

From
Lidong Yan <yldhome2d2@gmail.com>
Date
Jul 16, 2025, 01:39 UTC
Message-ID
<6AEC3113-D687-42E0-B6D0-DF62FA1A9A8B@gmail.com>
In-Reply-To
<xmqqa555gp1i.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 18 quoted lines
> 
> Lidong Yan <yldhome2d2@gmail.com> writes:
> 
>> Bryan Lee <hi@looping.me> 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 <key, value>.

Or end-user could provide a .gitconfigspec and `git config verify` will load .gitconfigspec to verify whether there exists some invalid config <k, v> pair.

- Lidong
Previous: Junio C HamanoNext: Johannes Sixt
Message 7 of 23 in “[BUG] git pull ignores pull.autostash=true configuration when used with --git-dir and --work-tree flags on a bare repository”
  1. Bryan LeeJul 15, 2025
  2. Lidong YanJul 15, 2025
  3. Bryan LeeJul 15, 2025
  4. Bryan LeeJul 15, 2025
  5. Lidong YanJul 15, 2025
  6. Junio C HamanoJul 15, 2025
  7. Lidong YanJul 16, 2025
  8. Johannes SixtJul 16, 2025
  9. Lidong YanJul 16, 2025
  10. Junio C HamanoJul 16, 2025
  11. pull: add pull.autoStash config optionLidong Yan, Jul 17, 2025
  12. Eric SunshineJul 17, 2025
  13. Lidong YanJul 17, 2025
  14. Junio C HamanoJul 17, 2025
  15. Lidong YanJul 17, 2025
  16. Junio C HamanoJul 17, 2025
  17. Junio C HamanoJul 17, 2025
  18. pull: add pull.autoStash config optionLidong Yan, Jul 18, 2025
  19. Junio C HamanoJul 18, 2025
  20. Lidong YanJul 19, 2025
  21. pull: add pull.autoStash config optionLidong Yan, Jul 20, 2025
  22. Junio C HamanoJul 21, 2025
  23. Ben KnobleJul 17, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.