All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] http.proxy: also mention https_proxy and all_proxy
@ 2012-03-03 14:50 Clemens Buchacher
  2012-03-03 17:42 ` Jeff King
  0 siblings, 1 reply; 8+ messages in thread
From: Clemens Buchacher @ 2012-03-03 14:50 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

The current wording of the http.proxy documentation suggests that
http_proxy is somehow equivalent to http.proxy. However, while
http.proxy (by the means of curl's CURLOPT_PROXY option) overrides the
proxy for both HTTP and HTTPS protocols, the http_proxy environment
variable is used only for HTTP. But since the docs mention only
http_proxy, a user might expect it to apply to all HTTP-like protocols.

Avoid any such misunderstanding by explicitly mentioning https_proxy and
all_proxy as well.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---

As you can maybe guess from the commit message, I was bitten by this
myself. I also found a couple of questions online where users were
expecting the http_proxy environment variable to apply to HTTPS as well.
Hopefully, this will prevent some confusion in the future.

Clemens

 Documentation/config.txt |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index abeb82b..7d197bb 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1258,9 +1258,10 @@ help.autocorrect::
 	This is the default.
 
 http.proxy::
-	Override the HTTP proxy, normally configured using the 'http_proxy'
-	environment variable (see linkgit:curl[1]).  This can be overridden
-	on a per-remote basis; see remote.<name>.proxy
+	Override the HTTP proxy, normally configured using the 'http_proxy',
+	'https_proxy', and 'all_proxy' environment variables (see
+	linkgit:curl[1]).  This can be overridden on a per-remote basis; see
+	remote.<name>.proxy
 
 http.cookiefile::
 	File containing previously stored cookie lines which should be used
-- 
1.7.9.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] http.proxy: also mention https_proxy and all_proxy
  2012-03-03 14:50 [PATCH] http.proxy: also mention https_proxy and all_proxy Clemens Buchacher
@ 2012-03-03 17:42 ` Jeff King
  2012-03-03 18:33   ` [RFH] 'man:' macro for asciidoc Jakub Narebski
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jeff King @ 2012-03-03 17:42 UTC (permalink / raw)
  To: Clemens Buchacher; +Cc: git, Junio C Hamano

On Sat, Mar 03, 2012 at 03:50:53PM +0100, Clemens Buchacher wrote:

> The current wording of the http.proxy documentation suggests that
> http_proxy is somehow equivalent to http.proxy. However, while
> http.proxy (by the means of curl's CURLOPT_PROXY option) overrides the
> proxy for both HTTP and HTTPS protocols, the http_proxy environment
> variable is used only for HTTP. But since the docs mention only
> http_proxy, a user might expect it to apply to all HTTP-like protocols.

Hmm, I didn't know that. This certainly adds an interesting twist to the
patch in a nearby thread to start reading http_proxy ourselves.

> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index abeb82b..7d197bb 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -1258,9 +1258,10 @@ help.autocorrect::
>  	This is the default.
>  
>  http.proxy::
> -	Override the HTTP proxy, normally configured using the 'http_proxy'
> -	environment variable (see linkgit:curl[1]).  This can be overridden
> -	on a per-remote basis; see remote.<name>.proxy
> +	Override the HTTP proxy, normally configured using the 'http_proxy',
> +	'https_proxy', and 'all_proxy' environment variables (see
> +	linkgit:curl[1]).  This can be overridden on a per-remote basis; see
> +	remote.<name>.proxy

Text looks OK. I think this linkgit:curl is wrong, though. In the
manpages, it formats as simply curl(1), but in the HTML pages, it
creates a link to curl.html, which does not exist. This is not a problem
introduced by your patch, obviously, but maybe it is worth cleaning up.
I think just using:

  `curl(1)`

might be sufficient.

-Peff

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [RFH] 'man:' macro for asciidoc
  2012-03-03 17:42 ` Jeff King
@ 2012-03-03 18:33   ` Jakub Narebski
  2012-03-03 22:22   ` [PATCH] http.proxy: also mention https_proxy and all_proxy Junio C Hamano
  2012-03-04 16:50   ` [PATCH v2] " Clemens Buchacher
  2 siblings, 0 replies; 8+ messages in thread
From: Jakub Narebski @ 2012-03-03 18:33 UTC (permalink / raw)
  To: Jeff King; +Cc: Clemens Buchacher, git, Junio C Hamano

Jeff King <peff@peff.net> writes:
> On Sat, Mar 03, 2012 at 03:50:53PM +0100, Clemens Buchacher wrote:

> >  http.proxy::
> > -	Override the HTTP proxy, normally configured using the 'http_proxy'
> > -	environment variable (see linkgit:curl[1]).  This can be overridden
> > -	on a per-remote basis; see remote.<name>.proxy
> > +	Override the HTTP proxy, normally configured using the 'http_proxy',
> > +	'https_proxy', and 'all_proxy' environment variables (see
> > +	linkgit:curl[1]).  This can be overridden on a per-remote basis; see
> > +	remote.<name>.proxy
> 
> Text looks OK. I think this linkgit:curl is wrong, though. In the
> manpages, it formats as simply curl(1), but in the HTML pages, it
> creates a link to curl.html, which does not exist. This is not a problem
> introduced by your patch, obviously, but maybe it is worth cleaning up.
> I think just using:
> 
>   `curl(1)`
> 
> might be sufficient.

BTW it wouldreally be nice be able to use simply  man:curl[1]  instead
of worrying if it shoudl be `curl(1)`, or *curl*(1), or curl(1)


-- 
Jakub Narebski

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] http.proxy: also mention https_proxy and all_proxy
  2012-03-03 17:42 ` Jeff King
  2012-03-03 18:33   ` [RFH] 'man:' macro for asciidoc Jakub Narebski
@ 2012-03-03 22:22   ` Junio C Hamano
  2012-03-04 12:46     ` Clemens Buchacher
  2012-03-04 16:50   ` [PATCH v2] " Clemens Buchacher
  2 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2012-03-03 22:22 UTC (permalink / raw)
  To: Jeff King; +Cc: Clemens Buchacher, git

Jeff King <peff@peff.net> writes:

> On Sat, Mar 03, 2012 at 03:50:53PM +0100, Clemens Buchacher wrote:
>
>> The current wording of the http.proxy documentation suggests that
>> http_proxy is somehow equivalent to http.proxy. However, while
>> http.proxy (by the means of curl's CURLOPT_PROXY option) overrides the
>> proxy for both HTTP and HTTPS protocols, the http_proxy environment
>> variable is used only for HTTP. But since the docs mention only
>> http_proxy, a user might expect it to apply to all HTTP-like protocols.
>
> Hmm, I didn't know that. This certainly adds an interesting twist to the
> patch in a nearby thread to start reading http_proxy ourselves.

Yeah, I too had an "Ahhhh" moment.

I recall that I was frustrated more than 10 years ago when I had to point
at our company proxy with many *_proxy variables in my .login and ended up
writing a shell script (and placed it under source control) that generates
dot files from a single source (which of course is under source control).

The manual page for curl seems to say that they have separate HTTPS_PROXY
and friends all in caps, and http_proxy is left lowercase for historical
reasons [*1*].

As to the way forward, I suspect that http.proxy was a mistake to begin
with, considering the structure of namespace our configuration variables
fit in.  Shouldn't they be proxy.http, proxy.https, etc.?

And if we were to map curl's HTTPS_PROXY to proxy.https to fix this
namespace gotha, we could treat http.proxy as a historical mistake, and
introduce proxy.http as what matches curl's http_proxy.

Then the change proposed in the nearby thread can notice http_proxy and
behave as if proxy.http is set, which would only affect http but not
https.  When http.proxy is set, we still let it affect anything curl
handles.


[Footnote]

*1* Come to think of it, the alleged Mac OS X breakage I mentined may
merely be a second-hand rumor of a misdiagnosed user error---the user
might have been trying to reach https:// resource with only http_proxy
set.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] http.proxy: also mention https_proxy and all_proxy
  2012-03-03 22:22   ` [PATCH] http.proxy: also mention https_proxy and all_proxy Junio C Hamano
@ 2012-03-04 12:46     ` Clemens Buchacher
  2012-03-04 23:07       ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Clemens Buchacher @ 2012-03-04 12:46 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git

On Sat, Mar 03, 2012 at 02:22:39PM -0800, Junio C Hamano wrote:
> 
> As to the way forward, I suspect that http.proxy was a mistake to begin
> with, considering the structure of namespace our configuration variables
> fit in.  Shouldn't they be proxy.http, proxy.https, etc.?

I actually prefer the current behavior, which is to configure only one
proxy for all protocols. I have not seen a setup where HTTP and HTTPS
are routed through different proxies before. But if this is really
needed, one has the option to use the environment variable, or
remote.<name>.proxy.

I suggest instead that we map curl's CURLOPT_PROXY to core.proxy.  That
would also fit well with the remote.<name>.proxy scheme.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] http.proxy: also mention https_proxy and all_proxy
  2012-03-03 17:42 ` Jeff King
  2012-03-03 18:33   ` [RFH] 'man:' macro for asciidoc Jakub Narebski
  2012-03-03 22:22   ` [PATCH] http.proxy: also mention https_proxy and all_proxy Junio C Hamano
@ 2012-03-04 16:50   ` Clemens Buchacher
  2012-03-05  5:11     ` Junio C Hamano
  2 siblings, 1 reply; 8+ messages in thread
From: Clemens Buchacher @ 2012-03-04 16:50 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Jeff King

The current wording of the http.proxy documentation suggests that
http_proxy is somehow equivalent to http.proxy. However, while
http.proxy (by the means of curl's CURLOPT_PROXY option) overrides the
proxy for both HTTP and HTTPS protocols, the http_proxy environment
variable is used only for HTTP. But since the docs mention only
http_proxy, a user might expect it to apply to all HTTP-like protocols.

Avoid any such misunderstanding by explicitly mentioning https_proxy and
all_proxy as well.

Also replace linkgit:curl[1] with a literal 'curl(1)', because the
former gets translated to a dead link in the HTML pages.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---

On Sat, Mar 03, 2012 at 12:42:52PM -0500, Jeff King wrote:
>
> I think just using: `curl(1)` might be sufficient.

Done.

 Documentation/config.txt |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index abeb82b..f0ab288 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1258,9 +1258,10 @@ help.autocorrect::
 	This is the default.
 
 http.proxy::
-	Override the HTTP proxy, normally configured using the 'http_proxy'
-	environment variable (see linkgit:curl[1]).  This can be overridden
-	on a per-remote basis; see remote.<name>.proxy
+	Override the HTTP proxy, normally configured using the 'http_proxy',
+	'https_proxy', and 'all_proxy' environment variables (see
+	`curl(1)`).  This can be overridden on a per-remote basis; see
+	remote.<name>.proxy
 
 http.cookiefile::
 	File containing previously stored cookie lines which should be used
-- 
1.7.9.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] http.proxy: also mention https_proxy and all_proxy
  2012-03-04 12:46     ` Clemens Buchacher
@ 2012-03-04 23:07       ` Junio C Hamano
  0 siblings, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2012-03-04 23:07 UTC (permalink / raw)
  To: Clemens Buchacher; +Cc: Jeff King, git

Clemens Buchacher <drizzd@aon.at> writes:

> On Sat, Mar 03, 2012 at 02:22:39PM -0800, Junio C Hamano wrote:
>> 
>> As to the way forward, I suspect that http.proxy was a mistake to begin
>> with, considering the structure of namespace our configuration variables
>> fit in.  Shouldn't they be proxy.http, proxy.https, etc.?
>
> I actually prefer the current behavior, which is to configure only one
> proxy for all protocols. I have not seen a setup where HTTP and HTTPS
> are routed through different proxies before. But if this is really
> needed, one has the option to use the environment variable, or
> remote.<name>.proxy.
>
> I suggest instead that we map curl's CURLOPT_PROXY to core.proxy.  That
> would also fit well with the remote.<name>.proxy scheme.

Contaminating core.* namespace would not solve anything.

People are already relying on http.proxy to apply to any cURL transport,
so we will keep supporting it anyway.  There is no justification to teach
new people to learn that both exists, and the transport is not core anyway; 
it is still cURL specific.

I forgot about remote.<name>.proxy that already can let you use different
proxies for http/https, and the use of different ones per protocol would
be rare to begin with, so I agree that we would not have to worry about
introducing proxy.{http,https,...}.

Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] http.proxy: also mention https_proxy and all_proxy
  2012-03-04 16:50   ` [PATCH v2] " Clemens Buchacher
@ 2012-03-05  5:11     ` Junio C Hamano
  0 siblings, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2012-03-05  5:11 UTC (permalink / raw)
  To: Clemens Buchacher; +Cc: git, Jeff King

Thanks; will queue.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-03-05  5:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-03 14:50 [PATCH] http.proxy: also mention https_proxy and all_proxy Clemens Buchacher
2012-03-03 17:42 ` Jeff King
2012-03-03 18:33   ` [RFH] 'man:' macro for asciidoc Jakub Narebski
2012-03-03 22:22   ` [PATCH] http.proxy: also mention https_proxy and all_proxy Junio C Hamano
2012-03-04 12:46     ` Clemens Buchacher
2012-03-04 23:07       ` Junio C Hamano
2012-03-04 16:50   ` [PATCH v2] " Clemens Buchacher
2012-03-05  5:11     ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.