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

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

From
Christian Couder <christian.couder@gmail.com>
Date
May 5, 2022, 10:48 UTC
Message-ID
<CAP8UFD0V6scSD8LuUiRQ0BWmG2mFATVFNQ2DgwaWFp6bigBkZw@mail.gmail.com>
In-Reply-To
<xmqqzgjxnz73.fsf@gitster.g>
On Wed, May 4, 2022 at 4:34 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Christian Couder <christian.couder@gmail.com> writes:
Show 15 quoted lines
> > I am Ok with just "http.resolve". I think using "curlopt" is perhaps
> > going into too many details about the implementation of the feature,
> > which could theoretically change if we ever decided to use something
> > other than curl.
>
> You may want to step back a bit and rethink.
>
> Even if we decide to rewrite that part of the system not to depend
> on cURL, end-user facing documented interface, i.e. how the mappings
> are given to the system, will stay with us, and it is clear that it
> was modeled after CURLOPT_RESOLVE---well, it was stolen from them
> verbatim ;-).
>
> So we may wean ourselves off of cURL, but CURLOPT_RESOLVE will stay
> with us for this particular feature.

Yeah, the CURLOPT_RESOLVE format will stay with us, so Ok, I will rename it "http.curloptResolve" in the next iteration then.

Show 26 quoted lines
> >> I am wondering if we want to mention the expected use case here
> >> as well, something like
> >>
> >>     This is designed to be used primarily from the command line
> >>     configuration variable override, e.g.
> >>
> >>         $ git -c http.resolve=example.com:443:127.0.0.1 \
> >>             clone https://example.com/user/project.git
> >>
> >> perhaps?  Not a suggestion, but soliciting thoughts.
> >
> > I am also interested in others' thoughts about this. If no one thinks
> > that a config option could be useful, I am Ok with making it a
> > "--resolve" command line option that can be passed to any Git command
> > similar to "-c <name>=<value>":
> >
> > git --resolve=... <command> [<args>]
>
> Absolutely not.
>
> "git [push|fetch|clone|ls-remote] --dns-pre-resolve=..." that is
> *NOT* git wide, but is only for transport commands might be a
> possibility, but even then, you'd need to invent a way to do the
> same for non cURL transports (we want to be able to pin the IP when
> going over SSH to a certain host, for the same reason) if we promote
> it to an officially supported command line option.

Ok with renaming and implementing it only in transport commands. I don't want, and I don't think it should be necessary, to invent a way to do the same for non cURL transports though. I think it should be Ok with the doc saying that the option has only been implemented for HTTP(S) yet and will have no effect when other transports are used.

If there is a simple way to do the same thing for ssh, then I might take a look at it later. For "file" or bundle transports, I don't think it makes sense, and the "git" transport is not used much in big hosting services where this feature is likely to be used.

Show 5 quoted lines
> Unless we do that, it is probably better to leave it as an obscure
> configuration meant to help server operators.  At least, with the
> name of the configuration variable prefixed with http.*, we have a
> valid excuse when somebody complains "the feature does not do
> anything for git:// transport".

I am happy with leaving it as an obscure configuration meant to help server operators. So I will just rename it "http.curloptResolve" in the next iteration.

Thanks!
Previous: Junio C HamanoNext: Carlo Marcelo Arenas Belón
Message 5 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.