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

[PATCH v6 0/6] http.<url>.<key> and friends

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 31, 2013, 19:26 UTC
Message-ID
<1375298768-7740-1-git-send-email-gitster@pobox.com>
This is my attempt to reroll Kyle's http.<url>.<key> series.

It adds a general <section>.<url>.<key> support at the infrastructure level and then rebuild http.<url>.<key> support on top of it. A useful side effect of doing it this way is that it avoids having to touch the two-name parser http_options() at all.

The same infrastructure is used to add "--get-urlmatch" mode to "git config", so that scripted Porcelains can use the same mechanism to ask for the value for <section>.<key> variable with a URL, and learn the value for <section>.<url>.<key> whose <url> part best matches the given URL. In a sense, the infrastructure makes <section>.<key> a "virtual" variable that is customized for URL.

 * Patch 1/6 is unchanged.
 * Patch 2/6 is to add only the two helpers url_normalize and
   match_urls from the original series by Kyle.
 * Patch 3/6 is the general <section>.<url>.<key> support.  The
   urlmatch_config_entry() wrapper can use existing two-name parser
   to implement "virtual" <section>.<key> variables.
 * Patch 4/6 is the rest of Kyle's http.<url>.<key> ported on top of
   the infrastructure.
 * Patch 5/6 is unchanged from the previous round.
 * Patch 6/6 teaches "--get-urlmatch" to "git config"; this time it
   adds tests and docs.
Junio C Hamano (4):
  http.c: fix parsing of http.sslCertPasswordProtected variable
  config: add generic callback shim to parse section.<url>.key
  builtin/config: refactor collect_config()
  config: "git config --get-urlmatch" parses section.<url>.key
Kyle J. McKay (2):
  config: add helper to normalize and match URLs
  config: parse http.<url>.<variable> using urlmatch
 .gitignore                   |   1 +
 Documentation/config.txt     |  44 ++++
 Documentation/git-config.txt |  29 +++
 Makefile                     |   7 +
 builtin/config.c             | 134 +++++++++--
 http.c                       |  16 +-
 t/.gitattributes             |   1 +
 t/t1300-repo-config.sh       |  25 ++
 t/t5200-url-normalize.sh     | 199 ++++++++++++++++
 t/t5200/README               | Bin 0 -> 644 bytes
 t/t5200/config-1             | Bin 0 -> 180 bytes
 t/t5200/config-2             | Bin 0 -> 80 bytes
 t/t5200/config-3             | Bin 0 -> 118 bytes
 t/t5200/url-1                | Bin 0 -> 20 bytes
 t/t5200/url-10               | Bin 0 -> 23 bytes
 t/t5200/url-11               | Bin 0 -> 25 bytes
 t/t5200/url-2                | Bin 0 -> 20 bytes
 t/t5200/url-3                | Bin 0 -> 23 bytes
 t/t5200/url-4                | Bin 0 -> 23 bytes
 t/t5200/url-5                | Bin 0 -> 23 bytes
 t/t5200/url-6                | Bin 0 -> 23 bytes
 t/t5200/url-7                | Bin 0 -> 23 bytes
 t/t5200/url-8                | Bin 0 -> 23 bytes
 t/t5200/url-9                | Bin 0 -> 23 bytes
 test-url-normalize.c         | 137 +++++++++++
 urlmatch.c                   | 535 +++++++++++++++++++++++++++++++++++++++++++
 urlmatch.h                   |  54 +++++
 27 files changed, 1158 insertions(+), 24 deletions(-)
 create mode 100755 t/t5200-url-normalize.sh
 create mode 100644 t/t5200/README
 create mode 100644 t/t5200/config-1
 create mode 100644 t/t5200/config-2
 create mode 100644 t/t5200/config-3
 create mode 100644 t/t5200/url-1
 create mode 100644 t/t5200/url-10
 create mode 100644 t/t5200/url-11
 create mode 100644 t/t5200/url-2
 create mode 100644 t/t5200/url-3
 create mode 100644 t/t5200/url-4
 create mode 100644 t/t5200/url-5
 create mode 100644 t/t5200/url-6
 create mode 100644 t/t5200/url-7
 create mode 100644 t/t5200/url-8
 create mode 100644 t/t5200/url-9
 create mode 100644 test-url-normalize.c
 create mode 100644 urlmatch.c
 create mode 100644 urlmatch.h
-- 
1.8.4-rc0-153-g9820077
Next: Junio C Hamano
Message 1 of 23 in “http.<url>.<key> and friends”
  1. 0/6 http.<url>.<key> and friendsJunio C Hamano, Jul 31, 2013
  2. 1/6 http.c: fix parsing of http.sslCertPasswordProtected variableJunio C Hamano, Jul 31, 2013
  3. 2/6 config: add helper to normalize and match URLsJunio C Hamano, Jul 31, 2013
  4. Kyle J. McKayJul 31, 2013
  5. 0/2 http.<url>.<key> and friendsKyle J. McKay, Jul 31, 2013
  6. 2/4 config: add helper to normalize and match URLsKyle J. McKay, Jul 31, 2013
  7. 4/4 config: parse http.<url>.<variable> using urlmatchKyle J. McKay, Jul 31, 2013
  8. Junio C HamanoJul 31, 2013
  9. 4/6 config: parse http.<url>.<variable> using urlmatchKyle J. McKay, Jul 31, 2013
  10. 3/6 config: add generic callback wrapper to parse section.<url>.keyJunio C Hamano, Jul 31, 2013
  11. 4/6 config: parse http.<url>.<variable> using urlmatchJunio C Hamano, Jul 31, 2013
  12. Kyle J. McKayJul 31, 2013
  13. 5/6 builtin/config: refactor collect_config()Junio C Hamano, Jul 31, 2013
  14. 6/6 config: "git config --get-urlmatch" parses section.<url>.keyJunio C Hamano, Jul 31, 2013
  15. Jeff KingJul 31, 2013
  16. Kyle J. McKayJul 31, 2013
  17. Jeff KingJul 31, 2013
  18. Junio C HamanoAug 1, 2013
  19. Jeff KingAug 1, 2013
  20. 4/6 config: parse http.<url>.<variable> using urlmatchKyle J. McKay, Aug 5, 2013
  21. Junio C HamanoAug 5, 2013
  22. Kyle J. McKayAug 5, 2013
  23. Junio C HamanoJul 31, 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.