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

Re: [PATCH v8 1/4] config: add support for http.<url>.* settings

From
Jeff King <peff@peff.net>
Date
Jul 24, 2013, 07:12 UTC
Message-ID
<20130724071226.GD30074@sigill.intra.peff.net>
In-Reply-To
<30e562871d9632141d612876db3147e@f74d39fa044aa309eaea14b9f57fe79>
On Mon, Jul 22, 2013 at 05:56:41AM -0700, Kyle J. McKay wrote:
Show 27 quoted lines
> +enum http_option_type {
> +	OPT_POST_BUFFER,
> +	OPT_MIN_SESSIONS,
> +	OPT_SSL_VERIFY,
> +	OPT_SSL_TRY,
> +	OPT_SSL_CERT,
> +	OPT_SSL_CAINFO,
> +	OPT_LOW_SPEED,
> +	OPT_LOW_TIME,
> +	OPT_NO_EPSV,
> +	OPT_HTTP_PROXY,
> +	OPT_COOKIE_FILE,
> +	OPT_USER_AGENT,
> +	OPT_PASSWD_REQ,
> +#ifdef USE_CURL_MULTI
> +	OPT_MAX_REQUESTS,
> +#endif
> +#if LIBCURL_VERSION_NUM >= 0x070903
> +	OPT_SSL_KEY,
> +#endif
> +#if LIBCURL_VERSION_NUM >= 0x070908
> +	OPT_SSL_CAPATH,
> +#endif
> +	OPT_MAX
> +};
> +
> +static size_t http_option_max_matched_len[OPT_MAX];

It's frustrating that we now have an extra spot to add new options to (e.g., somebody else is adding http.savecookies in another thread, and the merge will need to not just resolve the textual conflicts, but add it to this other list).

Might it be simpler to just keep a dynamic list indexed by option name (either a hash table, or a sorted string_list)? We only incur a lookup when we find an actual config entry, so the number of lookups (and entries) should be minuscule and not affect performance. And as a bonus, it lets us handle arbitrary keys if we want to allow "git config" to learn about url matching for user-specified keys.

-Peff
Previous: Kyle J. McKayNext: Kyle J. McKay
Message 3 of 19 in “config: add support for http.<url>.* settings”
  1. 0/4 config: add support for http.<url>.* settingsKyle J. McKay, Jul 22, 2013
  2. 1/4 config: add support for http.<url>.* settingsKyle J. McKay, Jul 22, 2013
  3. Jeff KingJul 24, 2013
  4. 2/4 config: improve support for http.<url>.* settingsKyle J. McKay, Jul 22, 2013
  5. 3/4 tests: add new test for the url_normalize functionKyle J. McKay, Jul 22, 2013
  6. Jeff KingJul 24, 2013
  7. Junio C HamanoJul 24, 2013
  8. Kyle J. McKayJul 24, 2013
  9. Kyle J. McKayJul 24, 2013
  10. Jeff KingJul 24, 2013
  11. 4/4 config: allow http.<url>.* any user matchingKyle J. McKay, Jul 22, 2013
  12. Junio C HamanoJul 22, 2013
  13. Kyle J. McKayJul 22, 2013
  14. Junio C HamanoJul 22, 2013
  15. Kyle J. McKayJul 22, 2013
  16. Junio C HamanoJul 22, 2013
  17. Jeff KingJul 24, 2013
  18. Junio C HamanoJul 24, 2013
  19. Jeff KingJul 24, 2013

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.