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

Re: [PATCH v3] http: add custom hostname to IP address resolutions

From
Carlo Arenas <carenas@gmail.com>
Date
May 10, 2022, 18:20 UTC
Message-ID
<CAPUEsphA=q10wCsrf3AxR9fXz9HQHt374tDFoWBu++EPNDA-LA@mail.gmail.com>
In-Reply-To
<20220509153834.485871-1-chriscool@tuxfamily.org>

On Mon, May 9, 2022 at 8:38 AM Christian Couder <christian.couder@gmail.com> wrote:

Show 14 quoted lines
> diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh
> index f92c79c132..4a8dbb7eee 100755
> --- a/t/t5551-http-fetch-smart.sh
> +++ b/t/t5551-http-fetch-smart.sh
> @@ -567,4 +567,11 @@ test_expect_success 'client falls back from v2 to v0 to match server' '
>         grep symref=HEAD:refs/heads/ trace
>  '
>
> +test_expect_success 'passing hostname resolution information works' '
> +       BOGUS_HOST=gitbogusexamplehost.com &&
> +       BOGUS_HTTPD_URL=$HTTPD_PROTO://$BOGUS_HOST:$LIB_HTTPD_PORT &&
> +       test_must_fail git ls-remote "$BOGUS_HTTPD_URL/smart/repo.git" >/dev/null &&
> +       git -c "http.curloptResolve=$BOGUS_HOST:$LIB_HTTPD_PORT:127.0.0.1" ls-remote "$BOGUS_HTTPD_URL/smart/repo.git" >/dev/null
> +'

Is setting it up as a command line config option the way you expect to use this, and if so why not make it a full blown command line option with the previous caveats that were discussed before?

I also think it might be a little confusing (and probably warranted of an advice message) if git will decide based on a configuration somewhere in its resolution tree that the IP I am connecting is different than the one I expect it to use through the system configured resolution mechanism for such a thing.

I assume that if you want to use this frequently, having that advice disabled in your global config wouldn't be a hassle, but it might be useful to know that I am interacting with a potentially different IP when referring to some host by name in my local repo, maybe because I forgot to change that setting after some debugging.

I am sure all those folks that forget to edit their /etc/hosts after they are done with their local site versions might instead use this and then be happy to be warned about it later.

Carlo
Previous: Christian CouderNext: Christian Couder
Message 14 of 20 in “http: add custom hostname to IP address resolves”
  1. http: add custom hostname to IP address resolvesChristian Couder, May 2, 2022
  2. Junio C HamanoMay 2, 2022
  3. Christian CouderMay 4, 2022
  4. Junio C HamanoMay 4, 2022
  5. Christian CouderMay 5, 2022
  6. Carlo Marcelo Arenas BelónMay 5, 2022
  7. Christian CouderMay 9, 2022
  8. http: add custom hostname to IP address resolutionsChristian Couder, May 4, 2022
  9. Carlo Marcelo Arenas BelónMay 5, 2022
  10. Christian CouderMay 12, 2022
  11. Junio C HamanoMay 12, 2022
  12. Christian CouderMay 12, 2022
  13. http: add custom hostname to IP address resolutionsChristian Couder, May 9, 2022
  14. Carlo ArenasMay 10, 2022
  15. Christian CouderMay 12, 2022
  16. Carlo ArenasMay 12, 2022
  17. Patrick SteinhardtMay 12, 2022
  18. Carlo ArenasMay 12, 2022
  19. Junio C HamanoMay 12, 2022
  20. http: add custom hostname to IP address resolutionsChristian Couder, May 16, 2022

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.