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 12, 2022, 11:55 UTC
Message-ID
<CAPUEsphmN+1FVdQSX3GoRYQBh33XdR+nN-WAPZdtZmMsBAfazg@mail.gmail.com>
In-Reply-To
<CAP8UFD2F=5RsB_WVOHKmzJsD9UJgZ2YM_yreTur2_huAAJ=+Vw@mail.gmail.com>

On Thu, May 12, 2022 at 1:30 AM Christian Couder <christian.couder@gmail.com> wrote:

Show 11 quoted lines
> On Tue, May 10, 2022 at 8:20 PM Carlo Arenas <carenas@gmail.com> wrote:
> > 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 would be Ok to add an advice message or another kind of message
> telling users that the IP used is based on the config variable. It
> could break scripts parsing Git's output though (even if it's bad
> practice to do so).

Only if they added that config option, which is an obscure one that nobody should be using anyway, so very unlikely, right? I also think that breaking my script could be avoided by turning off the advice (as suggested previously), and I MIGHT want to have my script broken if I picked up this config by mistake.

> So we would need to decide the kind of message and
> its content. Suggestions welcome.
I am not good at wording those, but I would think something innocuous like :
  "curl override detected to point name %s to %s instead of using DNS"
Show 8 quoted lines
> > 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.
>
> Yeah, maybe. On the other hand GIT_CURL_VERBOSE might already be the
> canonical way to debug this and might already tell about this.

of course, but that is mostly used when debugging HTTP issues, not when your DNS seems to have gone nuts, and you are looking at your screen in disbelief because the code you were working on before lunch and having released is now suddenly in production.

Show 17 quoted lines
> Yeah, it does:
>
> <= Recv header:
> == Info: Connection #0 to host gitbogusexamplehost.com left intact
> == Info: RESOLVE gitbogusexamplehost.com:5551 is - old addresses discarded!
> == Info: Added gitbogusexamplehost.com:5551:127.0.0.1 to DNS cache
> == Info: Couldn't find host gitbogusexamplehost.com in the .netrc
> file; using defaults
> == Info: Found bundle for host gitbogusexamplehost.com: 0x5556d2bd1340
> [serially]
> == Info: Can not multiplex, even if we wanted to!
> == Info: Re-using existing connection! (#0) with host gitbogusexamplehost.com
> == Info: Connected to gitbogusexamplehost.com (127.0.0.1) port 5551 (#0)
>
> I agree it might not be very clear that it's because
> "http.curloptResolve" is used though. But maybe we could output a more
> explicit warning message only if GIT_CURL_VERBOSE is set.

As I pointed in my example I can see this being useful also for some web developing which are mostly concerned about JavaScript and might not be aware of the OSI layer stack and how to get an HTTP packet dump, so I would think better done even when GIT_CURL_VERBOSE is not set.

Show 5 quoted lines
> > 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.
>
> Do you mean that those folks might like a config option ;-)

Yes, and I think it is not THAT of an obscure config option if it even has documentation as well ;)

Carlo
Previous: Christian CouderNext: Patrick Steinhardt
Message 16 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.