Re: [PATCH] Allow HTTP proxy to be overridden in config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sam Vilain <sam.vilain@xxxxxxxxxxxxxxx> writes:

> Junio C Hamano wrote:
>>> The http_proxy / HTTPS_PROXY variables used by curl to control
>>> proxying may not be suitable for git.  Allow the user to override them
>>> in the configuration file.
>>> ---
>>>   In particular, privoxy will block directories called /ad/ ... d'oh!
>>> +++ b/Documentation/config.txt
>>> +http.proxy::
>>> +	Override the HTTP proxy, normally configured using the 'http_proxy'
>>> +	environment variable (see gitlink:curl[1]).
>> 
>> This may work around the issue you cited, but it makes me wonder
>> if it is a road to insanity.  Does the curl library expect that
>> (1) each and every HTTP talking application that uses the
>> library offer this kind of knob for its users to tweak, and (2)
>> users set the knob for each and every one of such application?
>
> This is true.  However I still think that it is a useful feature for
> many users, with few side effects.  If nothing else the bit on the man
> page will prompt them to think, "oh, I should set that in the environment".
>
>> I would say if privoxy cannot be tweaked to allow /ad/ in chosen
>> context (e.g. /ad/ in general is rejected but /objects/ad/ is
>> Ok), that is what needs to be fixed.
>> Or it would be the use of such a broken proxy by the user.  That
>> can be fixed and much easily.
>
> Yes - but consider the dilemma of the user.  They've apt-get installed
> this privoxy thing and figured out how to set their applications to use
> it.  Now, it doesn't work and they think it is the proxy in the way, and
> they've no idea that they might be able to reconfigure it.  This way
> they can tell git to bypass it.
>
> I don't know, I see your point and pretty much agree with it.  It just
> seems like something that might come in handy (as well as be another
> vector for something you need to check when you get HTTP fetch issues -
> so maybe a command-line option would be better).
>
> Actually something that would really have helped is more documentation
> of the various GIT_CURL_* environment variables available for debugging.

Having thought about this a bit more, I changed my mind.  From the
beginning, I did not mind adding a dozen or so lines if the change helps
the user.  I was not _fundamentally_ opposed to your patch.

However.

There may be other environment variables that the users may want to set
differently when running git from the settings they use in their
interactive sessions.  We have precedentsto support such situations in
the form of git-specific environment variables (e.g. GIT_EDITOR and
GIT_PAGER).  These might have been a road to insanity already, and what
we should have done may be to introduce multivalued core.environment
variables in $HOME/.gitconfig, like so:

	[core.environment]
        	EDITOR = vim
		PAGER = less

without introducing GIT_foo environment variables.  We can then change
the git potty[*1*] start-up sequence to add them to the enviornment.  But
this is a bit like water under the bridge now.

While that approach could work for environment variables that apply
globally to any and all git sessions the user may run, I suspect it
would not work well for things like http_proxy.  If we really wanted to
help users, I think it should be tied to which remote we are going to,
just like we made git-send-email to use different mailpath depending on
which project you are communicating with.

In that sense, I think http.proxy configuration variable does not go far
enough, even though it might be a step in the right direction.  Perhaps
use your configuration variable http.proxy (or "core.environment") to
define the global default, with remote.$name.httpproxy to override it?


[Footnote]

*1* git(7) calls "git" itself as "git potty".  Is this word still used?
I also notice that Andreas's name is misspelled there.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux