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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:
> 
> Lidong Yan <yldhome2d2@xxxxxxxxx> writes:
> 
>> Bryan Lee <hi@xxxxxxxxxx> 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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux