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

Re: [PATCH v8 4/4] config: allow http.<url>.* any user matching

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 24, 2013, 15:00 UTC
Message-ID
<7vfvv46m0q.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130724064258.GA30074@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 39 quoted lines
>   1. The explanation and special-casing of username is a little
>      complicated to explain.
>
>   2. The behavior for resolving the value when faced with multiple
>      possibilities is completely unlike the rest of the config system
>      (both dropping last-one-wins, and unlike the URL matching for
>      credentials).
>
> I think we can decide that (2) is worth it if your semantics are more
> flexible in practice. It would be nice to see real-world feedback on how
> people use it before setting the behavior in stone, but there's sort of
> a chicken and egg problem there.
>
> For (1), I wonder if the explanation would be simpler if the precedences
> of each sub-part were simply laid out. That is, would it be correct to
> say something like:
>
>   For a config key to match a URL, each element of the config key (if
>   present) is compared to that of the URL, in the following order:
>
>     1. Protocol (e.g., `https` in `https://example.com/`). This field
>        must match exactly between the config key and the URL.
>
>     2. Host/domain name (e.g., `example.com` in `https://example.com/`).
>        This field must match exactly between the config key and the URL.
>
>     3. Path (e.g., `repo.git` in `https://example.com/repo.git`). This
>        field is prefix-matched by slash-delimited path elements, so that
>        config key `foo/` matches URL `foo/bar`. Longer matches take
>        precedence (so `foo/bar`, if it exists, is a better match than
>        just `foo/`).
>
>     4. Username (e.g., `user` in `https://user@example.com/repo.git`).
>
>   The list above is ordered by decreasing precedence; a URL that matches
>   a config key's path is preferred to one that matches its username.
>
> I don't know if that is more or less clear of an explanation. It makes
> more sense to me, but that is probably because I wrote it. 

The above reads very clearly to me, too. We may want to add that the Username, if exists on the configuration key name, must match exactly to the one in the URL the variable is queried for (i.e. anonymous requests never match configuration for a specific user).

Previous: Jeff KingNext: Jeff King
Message 18 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.