Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies

2015-11-17 Thread Junio C Hamano
Pat Thoyts  writes:

> A bit late to the party but 'yes'. Frankly by posting something to SO I
> rather consider it public domain ...

Unless otherwise noted, material posted on stackoverflow by default
becomes CC-SA-BY (which may not be the best choice for open source
software).

Thanks for the patch.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies

2015-11-16 Thread Johannes Schindelin
Hi Pat,

On Mon, 9 Nov 2015, Pat Thoyts wrote:

> Johannes Schindelin  writes:
> 
> >On Tue, 27 Oct 2015, Johannes Schindelin wrote:
> >
> >> On Mon, 26 Oct 2015, Junio C Hamano wrote:
> >> 
> >> > James McCoy  writes:
> >> > 
> >> > >> The code looks OK but the last paragraph makes _us_ worried.  What
> >> > >> is the licensing status of the original at SO?
> >> > >
> >> > > According to Stackoverflow[0],
> >> > >
> >> > >   As noted in the Stack Exchange Terms of Service[1] and in the footer 
> >> > > of
> >> > >   every page, all user contributions are licensed under Creative 
> >> > > Commons
> >> > >   Attribution-Share Alike[2]. Proper attribution[3] is required if you
> >> > >   republish any Stack Exchange content.
> >> > >
> >> > > [0]: https://stackoverflow.com/help/licensing
> >> > 
> >> > Yes, and (please correct me if I am wrong--this is one of the times
> >> > I hope I am wrong!) I thought BY-SA does not mesh well with GPLv2,
> >> > in which case we cannot use this patch (instead somebody has to
> >> > reimplement the same without copying).
> >> 
> >> Pat, could you please allow us to insert your SOB?
> >
> >On second thought... Junio, could you please sanity-check my claim that
> >this patch:
> >
> >-- snip --
> >@@ -465,6 +465,17 @@ static CURL *get_curl_handle(void)
> > 
> >if (curl_http_proxy) {
> >curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
> >+#if LIBCURL_VERSION_NUM >= 0x071800
> >+   if (starts_with(curl_http_proxy, "socks5"))
> >+   curl_easy_setopt(result,
> >+   CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
> >+   else if (starts_with(curl_http_proxy, "socks4a"))
> >+   curl_easy_setopt(result,
> >+   CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);
> >+   else if (starts_with(curl_http_proxy, "socks"))
> >+   curl_easy_setopt(result,
> >+   CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
> >+#endif
> >}
> > #if LIBCURL_VERSION_NUM >= 0x070a07
> >curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
> >-- snap --
> >
> >cannot be copyrighted because it is pretty much the only way to implement
> >said functionality?
> >
> >Still, Pat, if you find the time, could you please simply relicense your
> >patch (I know that you are fine with it, but we need an explicit
> >statement)?
> >
> >Ciao,
> >Johannes
> 
> A bit late to the party but 'yes'. Frankly by posting something to SO I
> rather consider it public domain

Yeah, unfortunately it needs to be stated explicitly, though... ;-)

> but I hereby license this patch as required for use by the Git project.
> 
> Signed-off-by: Pat Thoyts 

Thanks!

Ciao,
Dscho
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies

2015-11-09 Thread Pat Thoyts
Johannes Schindelin  writes:

>Hi,
>
>On Tue, 27 Oct 2015, Johannes Schindelin wrote:
>
>> On Mon, 26 Oct 2015, Junio C Hamano wrote:
>> 
>> > James McCoy  writes:
>> > 
>> > >> The code looks OK but the last paragraph makes _us_ worried.  What
>> > >> is the licensing status of the original at SO?
>> > >
>> > > According to Stackoverflow[0],
>> > >
>> > >   As noted in the Stack Exchange Terms of Service[1] and in the footer of
>> > >   every page, all user contributions are licensed under Creative Commons
>> > >   Attribution-Share Alike[2]. Proper attribution[3] is required if you
>> > >   republish any Stack Exchange content.
>> > >
>> > > [0]: https://stackoverflow.com/help/licensing
>> > 
>> > Yes, and (please correct me if I am wrong--this is one of the times
>> > I hope I am wrong!) I thought BY-SA does not mesh well with GPLv2,
>> > in which case we cannot use this patch (instead somebody has to
>> > reimplement the same without copying).
>> 
>> Pat, could you please allow us to insert your SOB?
>
>On second thought... Junio, could you please sanity-check my claim that
>this patch:
>
>-- snip --
>@@ -465,6 +465,17 @@ static CURL *get_curl_handle(void)
> 
>if (curl_http_proxy) {
>curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
>+#if LIBCURL_VERSION_NUM >= 0x071800
>+   if (starts_with(curl_http_proxy, "socks5"))
>+   curl_easy_setopt(result,
>+   CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
>+   else if (starts_with(curl_http_proxy, "socks4a"))
>+   curl_easy_setopt(result,
>+   CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);
>+   else if (starts_with(curl_http_proxy, "socks"))
>+   curl_easy_setopt(result,
>+   CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
>+#endif
>}
> #if LIBCURL_VERSION_NUM >= 0x070a07
>curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
>-- snap --
>
>cannot be copyrighted because it is pretty much the only way to implement
>said functionality?
>
>Still, Pat, if you find the time, could you please simply relicense your
>patch (I know that you are fine with it, but we need an explicit
>statement)?
>
>Ciao,
>Johannes

A bit late to the party but 'yes'. Frankly by posting something to SO I
rather consider it public domain but I hereby license this patch as
required for use by the Git project.

Signed-off-by: Pat Thoyts 

-- 
Pat Thoytshttp://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies

2015-10-30 Thread Johannes Schindelin
Hi Junio,

On Tue, 27 Oct 2015, Junio C Hamano wrote:

> We are very lucky that the original was posted to SO by our friend
> Pat, and you did the right thing to ask Pat to relicense.

I suspect Pat is on a six month trip around the globe or something,
judging from the feedback I got here:

https://github.com/patthoyts/git-gui/pull/1

Ciao,
Dscho
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies

2015-10-27 Thread Johannes Schindelin
Hi,

On Tue, 27 Oct 2015, Johannes Schindelin wrote:

> On Mon, 26 Oct 2015, Junio C Hamano wrote:
> 
> > James McCoy  writes:
> > 
> > >> The code looks OK but the last paragraph makes _us_ worried.  What
> > >> is the licensing status of the original at SO?
> > >
> > > According to Stackoverflow[0],
> > >
> > >   As noted in the Stack Exchange Terms of Service[1] and in the footer of
> > >   every page, all user contributions are licensed under Creative Commons
> > >   Attribution-Share Alike[2]. Proper attribution[3] is required if you
> > >   republish any Stack Exchange content.
> > >
> > > [0]: https://stackoverflow.com/help/licensing
> > 
> > Yes, and (please correct me if I am wrong--this is one of the times
> > I hope I am wrong!) I thought BY-SA does not mesh well with GPLv2,
> > in which case we cannot use this patch (instead somebody has to
> > reimplement the same without copying).
> 
> Pat, could you please allow us to insert your SOB?

On second thought... Junio, could you please sanity-check my claim that
this patch:

-- snip --
@@ -465,6 +465,17 @@ static CURL *get_curl_handle(void)
 
if (curl_http_proxy) {
curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
+#if LIBCURL_VERSION_NUM >= 0x071800
+   if (starts_with(curl_http_proxy, "socks5"))
+   curl_easy_setopt(result,
+   CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
+   else if (starts_with(curl_http_proxy, "socks4a"))
+   curl_easy_setopt(result,
+   CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);
+   else if (starts_with(curl_http_proxy, "socks"))
+   curl_easy_setopt(result,
+   CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
+#endif
}
 #if LIBCURL_VERSION_NUM >= 0x070a07
curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
-- snap --

cannot be copyrighted because it is pretty much the only way to implement
said functionality?

Still, Pat, if you find the time, could you please simply relicense your
patch (I know that you are fine with it, but we need an explicit
statement)?

Ciao,
Johannes
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies

2015-10-27 Thread Johannes Schindelin
Hi,

On Mon, 26 Oct 2015, Junio C Hamano wrote:

> James McCoy  writes:
> 
> >> The code looks OK but the last paragraph makes _us_ worried.  What
> >> is the licensing status of the original at SO?
> >
> > According to Stackoverflow[0],
> >
> >   As noted in the Stack Exchange Terms of Service[1] and in the footer of
> >   every page, all user contributions are licensed under Creative Commons
> >   Attribution-Share Alike[2]. Proper attribution[3] is required if you
> >   republish any Stack Exchange content.
> >
> > [0]: https://stackoverflow.com/help/licensing
> 
> Yes, and (please correct me if I am wrong--this is one of the times
> I hope I am wrong!) I thought BY-SA does not mesh well with GPLv2,
> in which case we cannot use this patch (instead somebody has to
> reimplement the same without copying).

Pat, could you please allow us to insert your SOB?

Thanks,
Dscho
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies

2015-10-27 Thread Junio C Hamano
Johannes Schindelin  writes:

> On second thought... Junio, could you please sanity-check my claim that
> this patch:
>
> -- snip --
> ...
> -- snap --
>
> cannot be copyrighted because it is pretty much the only way to implement
> said functionality?

I am not a lawyer, so...


> Still, Pat, if you find the time, could you please simply relicense your
> patch (I know that you are fine with it, but we need an explicit
> statement)?
>
> Ciao,
> Johannes
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies

2015-10-27 Thread Junio C Hamano
Junio C Hamano  writes:

> Johannes Schindelin  writes:
>
>> On second thought... Junio, could you please sanity-check my claim that
>> this patch:
>>
>> -- snip --
>> ...
>> -- snap --
>>
>> cannot be copyrighted because it is pretty much the only way to implement
>> said functionality?
>
> I am not a lawyer, so...
>
>
>> Still, Pat, if you find the time, could you please simply relicense your
>> patch (I know that you are fine with it, but we need an explicit
>> statement)?

So, I talked to our lawyer.

We are very lucky that the original was posted to SO by our friend
Pat, and you did the right thing to ask Pat to relicense.

Analyzing copyrightability is often more costly than the risk.  Even
if you believe it is not copyrightable, you are bearing the risk
that the court may disagree with you.  Finding a different way to
express the same idea, especially for a small patch like this, is
often cheaper than the cost of copyrightability analysis and the
risk of lawsuit.

If the original is from a friendly party, relicensing is clearly
cheaper and cleaner of the possible choices.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies

2015-10-27 Thread Junio C Hamano
Junio C Hamano  writes:

> Analyzing copyrightability is often more costly than the risk.

Misspelled, obviously: "more costly than the other ways to mitigate
the risk" is what I meant.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies

2015-10-26 Thread Junio C Hamano
Johannes Schindelin  writes:

> This patch was required to work behind a faulty AP and scraped from
> http://stackoverflow.com/questions/15227130/#15228479 and guarded with
> an appropriate cURL version check by Johannes Schindelin.
>
> Signed-off-by: Johannes Schindelin 

Thanks.

The code looks OK but the last paragraph makes _us_ worried.  What
is the licensing status of the original at SO?  I can see that you
are taking legal responsibility with the Signed-off-by: line; you
state that to the best of your knowledge the patch is covered under
an appropriate open source license and you ahve the right under that
license to submit it here to the project.

But it is my job to double check when in doubt, hence this question.

> ---
>  http.c | 11 +++
>  1 file changed, 11 insertions(+)
>
> diff --git a/http.c b/http.c
> index 7da76ed..6b89dea 100644
> --- a/http.c
> +++ b/http.c
> @@ -465,6 +465,17 @@ static CURL *get_curl_handle(void)
>  
>   if (curl_http_proxy) {
>   curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
> +#if LIBCURL_VERSION_NUM >= 0x071800
> + if (starts_with(curl_http_proxy, "socks5"))
> + curl_easy_setopt(result,
> + CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
> + else if (starts_with(curl_http_proxy, "socks4a"))
> + curl_easy_setopt(result,
> + CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);
> + else if (starts_with(curl_http_proxy, "socks"))
> + curl_easy_setopt(result,
> + CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
> +#endif
>   }
>  #if LIBCURL_VERSION_NUM >= 0x070a07
>   curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies

2015-10-26 Thread James McCoy
On Mon, Oct 26, 2015 at 01:15:17PM -0700, Junio C Hamano wrote:
> Johannes Schindelin  writes:
> 
> > This patch was required to work behind a faulty AP and scraped from
> > http://stackoverflow.com/questions/15227130/#15228479 and guarded with
> > an appropriate cURL version check by Johannes Schindelin.
> >
> > Signed-off-by: Johannes Schindelin 
> 
> Thanks.
> 
> The code looks OK but the last paragraph makes _us_ worried.  What
> is the licensing status of the original at SO?

According to Stackoverflow[0],

  As noted in the Stack Exchange Terms of Service[1] and in the footer of
  every page, all user contributions are licensed under Creative Commons
  Attribution-Share Alike[2]. Proper attribution[3] is required if you
  republish any Stack Exchange content.

[0]: https://stackoverflow.com/help/licensing
[1]: http://stackexchange.com/legal
[2]: http://creativecommons.org/licenses/by-sa/3.0/
[3]: http://blog.stackoverflow.com/2009/06/attribution-required/

Cheers,
-- 
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy 
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies

2015-10-26 Thread Junio C Hamano
James McCoy  writes:

>> The code looks OK but the last paragraph makes _us_ worried.  What
>> is the licensing status of the original at SO?
>
> According to Stackoverflow[0],
>
>   As noted in the Stack Exchange Terms of Service[1] and in the footer of
>   every page, all user contributions are licensed under Creative Commons
>   Attribution-Share Alike[2]. Proper attribution[3] is required if you
>   republish any Stack Exchange content.
>
> [0]: https://stackoverflow.com/help/licensing

Yes, and (please correct me if I am wrong--this is one of the times
I hope I am wrong!) I thought BY-SA does not mesh well with GPLv2,
in which case we cannot use this patch (instead somebody has to
reimplement the same without copying).

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/6] remote-http(s): Support SOCKS proxies

2015-10-26 Thread Johannes Schindelin
From: Pat Thoyts 

With this patch we properly support SOCKS proxies, configured e.g. like
this:

git config http.proxy socks5://192.168.67.1:32767

Without this patch, Git mistakenly tries to use SOCKS proxies as if they
were HTTP proxies, resulting in a error message like:

fatal: unable to access 'http://.../': Proxy CONNECT aborted

This patch was required to work behind a faulty AP and scraped from
http://stackoverflow.com/questions/15227130/#15228479 and guarded with
an appropriate cURL version check by Johannes Schindelin.

Signed-off-by: Johannes Schindelin 
---
 http.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/http.c b/http.c
index 7da76ed..6b89dea 100644
--- a/http.c
+++ b/http.c
@@ -465,6 +465,17 @@ static CURL *get_curl_handle(void)
 
if (curl_http_proxy) {
curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
+#if LIBCURL_VERSION_NUM >= 0x071800
+   if (starts_with(curl_http_proxy, "socks5"))
+   curl_easy_setopt(result,
+   CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
+   else if (starts_with(curl_http_proxy, "socks4a"))
+   curl_easy_setopt(result,
+   CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);
+   else if (starts_with(curl_http_proxy, "socks"))
+   curl_easy_setopt(result,
+   CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
+#endif
}
 #if LIBCURL_VERSION_NUM >= 0x070a07
curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
-- 
2.1.4


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html