Nguyễn Thái Ngọc Duy  <pclo...@gmail.com> writes:

>  int git_config_include(const char *var, const char *value, void *data)
>  {
>       struct config_include_data *inc = data;
> +     const char *cond, *key;
> +     int cond_len;
>       int ret;
>  
>       /*
> @@ -185,6 +271,12 @@ int git_config_include(const char *var, const char 
> *value, void *data)
>  
>       if (!strcmp(var, "include.path"))
>               ret = handle_path_include(value, inc);
> +
> +     if (!parse_config_key(var, "includeif", &cond, &cond_len, &key) &&
> +         (cond && include_condition_is_true(cond, cond_len)) &&
> +         !strcmp(key, "path"))
> +             ret = handle_path_include(value, inc);
> +
>       return ret;
>  }

So "includeif.path" (misspelled one without any condition) falls
through to "return ret" and gives the value we got from inc->fn().
I am OK with that (i.e. "missing condition is false").

Or we can make it go to handle_path_include(), effectively making
the "include.path" a short-hand for "includeIf.path".  I am also OK
with that (i.e. "missing condition is true").

Or we could even have "include.[<condition>.]path" without
"includeIf"?  I am not sure if it is a bad idea that paints
ourselves in a corner, but somehow I find it tempting.

Reply via email to