Re: git smart http + apache mod_auth_openidc

2019-10-17 Thread Ralph Ewig
Understood (and agree). We do use git for source code (where we use SSH and key authentication for CI/CD), but also for configuration control of other files like financial reports, engineering drawings, etc. where access is via HTTPS.  In that 2nd group the challenge is to make it as "not cod

Re: git smart http + apache mod_auth_openidc

2019-10-17 Thread brian m. carlson
On 2019-10-17 at 14:33:38, Ralph Ewig wrote: > Quick follow up question: can the git client pass > a token read from a cookie with a request? That > would enable users to sign-in via a browser, store > the cookie, and then use that as the access token > to authenticate a git request. Git has an op

Re: git smart http + apache mod_auth_openidc

2019-10-17 Thread Ralph Ewig
Quick follow up question: can the git client pass a token read from a cookie with a request? That would enable users to sign-in via a browser, store the cookie, and then use that as the access token to authenticate a git request. On 10/16/2019 11:03 PM, Jeff King wrote: > On Thu, Oct 17, 2019

Re: git smart http + apache mod_auth_openidc

2019-10-17 Thread Ralph Ewig
Interesting ... I have not looked at access tokens before, but did find some documentation online that describes how Azure AD Jason Web Tokens can be used to authenticate a headless API (https://docs.microsoft.com/en-us/azure/active-directory/develop/id-tokens), This seems to be a fit in thi

Re: git smart http + apache mod_auth_openidc

2019-10-16 Thread Jeff King
On Thu, Oct 17, 2019 at 03:00:58AM +, Ralph Ewig wrote: > Thanks for the reply. I was hoping the Git GUI > might be able to handle the OpenID authentication > flow, but it makes sense that it would be > inconsistent with other git clients. I don't think we'd ever do the full flow, but it m

Re: git smart http + apache mod_auth_openidc

2019-10-16 Thread Ralph Ewig
Thanks for the reply. I was hoping the Git GUI might be able to handle the OpenID authentication flow, but it makes sense that it would be inconsistent with other git clients. Azure AD does support both LDAP and Kerberos, but unfortunately only as an extra cost add-on called "Domain Services"

Re: git smart http + apache mod_auth_openidc

2019-10-16 Thread brian m. carlson
On 2019-10-15 at 15:59:03, Ralph Ewig wrote: > Hi Everyone, hoping you might have a solution for > this problem: > > CONTEXT > >  * I'm serving git repos using "smart https" via > apache and basic authentication; everything works > fine. >  * We're moving to SSO via Azure AD and apache > mo

git smart http + apache mod_auth_openidc

2019-10-15 Thread Ralph Ewig
Hi Everyone, hoping you might have a solution for this problem: CONTEXT  * I'm serving git repos using "smart https" via apache and basic authentication; everything works fine.  * We're moving to SSO via Azure AD and apache mod_auth_openidc; this works fine for gitweb (on the same server a

Re: [PATCH 1/3] remote-curl: refactor smart-http discovery

2019-02-06 Thread Junio C Hamano
Jeff King writes: > Yep. Here it is. > > Rather than a range-diff, which is quite large due to the code movement, > I'll include below the interesting hunk of a diff between the two > endpoints (i.e., what we would have seen applying the packet-err-check > changes on top of my code movement, whic

Re: [PATCH 1/3] remote-curl: refactor smart-http discovery

2019-02-06 Thread Jeff King
On Wed, Feb 06, 2019 at 11:29:03AM -0800, Josh Steadmon wrote: > > + packet_reader_init(&reader, -1, d->buf, d->len, > > + PACKET_READ_CHOMP_NEWLINE | > > + PACKET_READ_DIE_ON_ERR_PACKET); > > + if (packet_reader_read(&reader) != PACKET_READ_NORMAL) >

Re: [PATCH 1/3] remote-curl: refactor smart-http discovery

2019-02-06 Thread Junio C Hamano
Josh Steadmon writes: >> +packet_reader_init(&reader, -1, d->buf, d->len, >> + PACKET_READ_CHOMP_NEWLINE | >> + PACKET_READ_DIE_ON_ERR_PACKET); >> +if (packet_reader_read(&reader) != PACKET_READ_NORMAL) >> +die("invalid server respon

Re: [PATCH 1/3] remote-curl: refactor smart-http discovery

2019-02-06 Thread Josh Steadmon
On 2019.02.06 14:18, Jeff King wrote: > After making initial contact with an http server, we have to decide if > the server supports smart-http, and if so, which version. Our rules are > a bit inconsistent: > > 1. For v0, we require that the content-type indicates a smart-http

[PATCH 2/3] remote-curl: tighten "version 2" check for smart-http

2019-02-06 Thread Jeff King
In a v2 smart-http conversation, the server should reply to our initial request with a pkt-line saying "version 2". We check that with starts_with(), but really that should be the only thing in that packet. A response of "version 20" should not match. Let's tighten

[PATCH 1/3] remote-curl: refactor smart-http discovery

2019-02-06 Thread Jeff King
After making initial contact with an http server, we have to decide if the server supports smart-http, and if so, which version. Our rules are a bit inconsistent: 1. For v0, we require that the content-type indicates a smart-http response. We also require the response to look vaguely like

Re: [PATCH 1/3] remote-curl: refactor smart-http discovery

2019-02-06 Thread Jeff King
On Tue, Feb 05, 2019 at 03:29:18PM -0800, Junio C Hamano wrote: > Jeff King writes: > > > After making initial contact with an http server, we have to decide if > > the server supports smart-http, and if so, which version. Our rules are > > a bit inconsistent: &

Re: [PATCH 1/3] remote-curl: refactor smart-http discovery

2019-02-05 Thread Junio C Hamano
Jeff King writes: > After making initial contact with an http server, we have to decide if > the server supports smart-http, and if so, which version. Our rules are > a bit inconsistent: > ... > > - we now predicate the smart/dumb decision entirely on the presence of >

Re: [PATCH v3 0/4] Unify pkt-line error handling and refactor smart-http

2018-12-12 Thread Junio C Hamano
Josh Steadmon writes: > This is a reroll of js/smart-http-detect-remote-error that also includes > a fixed version of ms/proto-err-packet-anywhere [1]. Yay. Thanks for reducing a topic I have to worry about by 1 ;-). > The first patch clarifies the use of ERR messages in the

[PATCH v3 0/4] Unify pkt-line error handling and refactor smart-http

2018-12-11 Thread Josh Steadmon
This is a reroll of js/smart-http-detect-remote-error that also includes a fixed version of ms/proto-err-packet-anywhere [1]. The first patch clarifies the use of ERR messages in the pkt-line protocol and unifies error handling in pkt-line.c The second patch refactors smart-http discovery in

[PATCH v3 2/4] remote-curl: refactor smart-http discovery

2018-12-11 Thread Josh Steadmon
From: Jeff King After making initial contact with an http server, we have to decide if the server supports smart-http, and if so, which version. Our rules are a bit inconsistent: 1. For v0, we require that the content-type indicates a smart-http response. We also require the response to

[PATCH v3 3/4] remote-curl: tighten "version 2" check for smart-http

2018-12-11 Thread Josh Steadmon
From: Jeff King In a v2 smart-http conversation, the server should reply to our initial request with a pkt-line saying "version 2" (this is the start of the "capabilities advertisement"). We check for the string using starts_with(), but that's overly permissive (it woul

Re: [PATCH 2/3] remote-curl: tighten "version 2" check for smart-http

2018-11-16 Thread Josh Steadmon
On 2018.11.16 03:48, Jeff King wrote: > In a v2 smart-http conversation, the server should reply to our initial > request with a pkt-line saying "version 2" (this is the start of the > "capabilities advertisement"). We check for the string using > starts_with(),

Re: [PATCH 1/3] remote-curl: refactor smart-http discovery

2018-11-16 Thread Josh Steadmon
On 2018.11.16 03:47, Jeff King wrote: > After making initial contact with an http server, we have to decide if > the server supports smart-http, and if so, which version. Our rules are > a bit inconsistent: > > 1. For v0, we require that the content-type indicates a smart-http

Re: [PATCH 0/3] remote-curl smart-http discovery cleanup

2018-11-16 Thread Josh Steadmon
On 2018.11.16 03:44, Jeff King wrote: [...] > Amusingly, this does break the test you just added, because it tries to > issue an ERR after claiming "text/html" (and after my patch, we > correctly fall back to dumb-http). Heh yeah, I copied the script from a dumb-http test without reading the spec.

[PATCH 2/3] remote-curl: tighten "version 2" check for smart-http

2018-11-16 Thread Jeff King
In a v2 smart-http conversation, the server should reply to our initial request with a pkt-line saying "version 2" (this is the start of the "capabilities advertisement"). We check for the string using starts_with(), but that's overly permissive (it would match "ver

[PATCH 1/3] remote-curl: refactor smart-http discovery

2018-11-16 Thread Jeff King
After making initial contact with an http server, we have to decide if the server supports smart-http, and if so, which version. Our rules are a bit inconsistent: 1. For v0, we require that the content-type indicates a smart-http response. We also require the response to look vaguely like

[PATCH 0/3] remote-curl smart-http discovery cleanup

2018-11-16 Thread Jeff King
> > For the first point above, dumb servers should never use an > "application/x-git-*" content type (http-protocol.txt line 163-167). > > For the second point, the docs require v2 servers to use > "application/x-git-*" content types. protocol-v2.txt lines 63-65 s

Re: [PATCH] smart-http: document flush after "# service" line

2018-03-03 Thread Jeff King
On Sat, Mar 03, 2018 at 03:28:47AM -0500, Eric Sunshine wrote: > On Sat, Mar 3, 2018 at 12:27 AM, Jeff King wrote: > > Subject: smart-http: document flush after "# service" line > > > > The http-protocol.txt spec fails to mention that a flush > > packet com

Re: [PATCH] smart-http: document flush after "# service" line

2018-03-03 Thread Eric Sunshine
On Sat, Mar 3, 2018 at 12:27 AM, Jeff King wrote: > Subject: smart-http: document flush after "# service" line > > The http-protocol.txt spec fails to mention that a flush > packet comes in the smart server response after sending any > the "service" header. &

[PATCH] smart-http: document flush after "# service" line

2018-03-02 Thread Jeff King
not forthcoming, then. :-/ Let's wrap up this topic with this, then, which adds a commit message and fixes the flush/version-1 ordering issue. -- >8 -- Subject: smart-http: document flush after "# service" line The http-protocol.txt spec fails to mention that a flush packet comes in

Re: Git smart http: parsing commit messages in git-receive-pack

2017-05-07 Thread Junio C Hamano
Bryan Turner writes: > That means if you pair a pre-receive hook with Git 2.11 or newer on > the server, you should be able to achieve what you're looking for. It probably is worth mentioning that even without the "quarantine" changes of 2.11, the new objects brought in by a rejected push cannot

Re: Git smart http: parsing commit messages in git-receive-pack

2017-05-06 Thread Bryan Turner
On Sat, May 6, 2017 at 5:30 AM, akos tajti wrote: > Dear All, > > we implemented a java servlet around the git-http-backend. This servlet > intercepts the requests sent by the git client when pushing. One thing I want > to achieve is parsing the commit messages in the pre push phase (request >

Git smart http: parsing commit messages in git-receive-pack

2017-05-06 Thread akos tajti
Dear All, we implemented a java servlet around the git-http-backend. This servlet intercepts the requests sent by the git client when pushing. One thing I want to achieve is parsing the commit messages in the pre push phase (request param service==git-receive-pack) and after checking if the com

RE: Smart HTTP push permissions failure

2016-08-25 Thread David McGough
Thank you for your reply Jeff. I have moved on to installing GitLab. It has been a success so far. Thanks, Dave -Original Message- From: Jeff King [mailto:p...@peff.net] Sent: Wednesday, August 24, 2016 1:00 PM To: David McGough Cc: git@vger.kernel.org Subject: Re: Smart HTTP push

Re: Smart HTTP push permissions failure

2016-08-24 Thread Jeff King
tty confused about what the issue. Which OS user is git > using to write the files? I hope somebody can help me understand why > the project cannot be pushed to the git server. For a smart-http push, it will be whatever user the web server execs the CGI as. So I'd think "apac

Smart HTTP push permissions failure

2016-08-23 Thread David McGough
Hi Git Community! I'm trying to get Git on the server. I installed Git and httpd on Centos 7 and configred for smart http. I created a project on my local git and I cloned it to a base repository: git clone --bare DataConversion DataConversion.git then I scp it to the server: s

Re: Git Smart HTTP using Nginx

2016-03-10 Thread Dennis Kaarsemaker
On do, 2016-03-10 at 10:13 -0300, Ben Mezger wrote: > The git-scm.com only uses apache2 as an example of setting Git's > Smart > HTTP, and searching the web for the Nginx's config only gives me old > configs or not-functional configurations. Has anyone managed to get >

Git Smart HTTP using Nginx

2016-03-10 Thread Ben Mezger
Hi all, The git-scm.com only uses apache2 as an example of setting Git's Smart HTTP, and searching the web for the Nginx's config only gives me old configs or not-functional configurations. Has anyone managed to get Smart HTTP to work with Nginx and could give me a sample of the .conf

Re: Git Smart HTTP with HTTP/2.0

2015-07-11 Thread Shawn Pearce
On Sat, Jul 11, 2015 at 11:26 AM, Ilari Liusvaara wrote: > On Sat, Jul 11, 2015 at 10:23:09AM -0700, Shawn Pearce wrote: >> >> > Websockets over HTTP/2 (a.k.a. "websockets2") has not been defined yet. >> > With Websockets(1), it would probably already be possible to tunnel the >> > native git smar

Re: Git Smart HTTP with HTTP/2.0

2015-07-11 Thread Ilari Liusvaara
ficult to speed up (due to nature of the negotiations), > > but usually is pretty reliable (the efficiency isn't horrible). > > The negotiation in smart-HTTP actually has some bad corner cases. Each > round of negotiation requires a new POST resupplying all previously > agr

Re: Git Smart HTTP with HTTP/2.0

2015-07-11 Thread Shawn Pearce
On Sat, Jul 11, 2015 at 12:00 AM, Ilari Liusvaara wrote: > On Sat, Jul 11, 2015 at 11:10:48AM +0800, ForceCharlie wrote: >> As we known, HTTP/2.0 has been released. All Git-Smart-HTTP are currently >> implemented using HTTP/1.1. > > Nit: It is HTTP/2. > >> Freque

Re: Git Smart HTTP with HTTP/2.0

2015-07-11 Thread Ilari Liusvaara
On Sat, Jul 11, 2015 at 11:10:48AM +0800, ForceCharlie wrote: > As we known, HTTP/2.0 has been released. All Git-Smart-HTTP are currently > implemented using HTTP/1.1. Nit: It is HTTP/2. > Frequently used Git developers often feel Git HTTP protocol is not > satisfactory, slow and u

Git Smart HTTP with HTTP/2.0

2015-07-10 Thread ForceCharlie
As we known, HTTP/2.0 has been released. All Git-Smart-HTTP are currently implemented using HTTP/1.1. Frequently used Git developers often feel Git HTTP protocol is not satisfactory, slow and unstable.This is because the HTTP protocol itself decides When HTTP/2.0 is published. We might be able to

Re: [PATCH 1/7] upload-pack: fix transfer.hiderefs over smart-http

2015-03-12 Thread Junio C Hamano
.sh > +++ b/t/t5551-http-fetch-smart.sh > @@ -213,6 +213,17 @@ test_expect_success 'cookies stored in http.cookiefile > when http.savecookies set > test_cmp expect_cookies.txt cookies_tail.txt > ' > > +test_expect_success 'transfer.hi

Re: [PATCH 0/7] fix transfer.hiderefs with smart http

2015-03-12 Thread Duy Nguyen
On Fri, Mar 13, 2015 at 11:59 AM, Jeff King wrote: > On Fri, Mar 13, 2015 at 12:41:01AM -0400, Jeff King wrote: > >> I'm experimenting with using transfer.hiderefs on a server, and it's >> rather easy to cause a git client to hang when fetching from such a repo >&g

Re: [PATCH 0/7] fix transfer.hiderefs with smart http

2015-03-12 Thread Jeff King
On Fri, Mar 13, 2015 at 12:41:01AM -0400, Jeff King wrote: > I'm experimenting with using transfer.hiderefs on a server, and it's > rather easy to cause a git client to hang when fetching from such a repo > over smart http. Details are in the first patch. A note on this ha

[PATCH 1/7] upload-pack: fix transfer.hiderefs over smart-http

2015-03-12 Thread Jeff King
in http.cookiefile when http.savecookies set test_cmp expect_cookies.txt cookies_tail.txt ' +test_expect_success 'transfer.hiderefs works over smart-http' ' + test_commit hidden && + test_commit visible && + git push public HEAD^:refs/heads

[PATCH 0/7] fix transfer.hiderefs with smart http

2015-03-12 Thread Jeff King
I'm experimenting with using transfer.hiderefs on a server, and it's rather easy to cause a git client to hang when fetching from such a repo over smart http. Details are in the first patch. There are 7 patches here, but the entirety of the fix is contained in the first one. The rest ar

Re: smart http push setup/egit win7

2014-11-05 Thread Jeff King
On Wed, Nov 05, 2014 at 07:11:29PM +, Jonathan wrote: > The client can connect to and successfully fetch the repo from the > server over https. However, when trying to push egit gives the error > "remote does not support http push." When attempting a push via bash, > I get "return code 22 - fa

smart http push setup/egit win7

2014-11-05 Thread Jonathan
This is yet another smart http thread. I must have read dozens of threads and articles about setting this up but everyone seems to do it a little differently so I can't tell what's right and what's not. First up, the environment, which is the same for both server and test clien

Re: Smart HTTP

2014-10-13 Thread Konstantin Khomoutov
On Mon, 13 Oct 2014 17:29:05 + "John Norris" wrote: > I guess this comment is aimed at Scott Chacon. > I have read your blog post on Smart HTTP > (http://git-scm.com/blog/2010/03/04/smart-http.html) and wondered if > there is any documentation that compares in terms

Smart HTTP

2014-10-13 Thread John Norris
Hi, I guess this comment is aimed at Scott Chacon. I have read your blog post on Smart HTTP (http://git-scm.com/blog/2010/03/04/smart-http.html) and wondered if there is any documentation that compares in terms of thoroughness with your sections in the book on using SSH, which does explain the

[PATCH v6 22/23] signed push: teach smart-HTTP to pass "git push --signed" around

2014-09-17 Thread Junio C Hamano
helper_option(), and the helper needs to take necessary action. For the smart-HTTP helper, the "necessary action" involves spawning the "git send-pack" subprocess with the "--signed" option. Once the above all gets wired in, the smart-HTTP transport now can use the pus

[PATCH v5 23/23] t5541: test push --signed to smart HTTP server

2014-09-15 Thread Junio C Hamano
Currently it seems that somewhere in the transport option setting chain the "--signed" bit gets lost and this does not pass. Signed-off-by: Junio C Hamano --- t/t5541-http-push-smart.sh | 39 +++ 1 file changed, 39 insertions(+) diff --git a/t/t5541-http-push

Re: PROPFIND 405 with git-http-backend and Smart HTTP

2014-08-14 Thread lpicquet
You need to allow the directory to be read? Allow from all -- View this message in context: http://git.661346.n2.nabble.com/PROPFIND-405-with-git-http-backend-and-Smart-HTTP-tp7564017p7616843.html Sent from the git mailing list archive at Nabble.com. -- To

Re: Returning error message from custom smart http server

2014-05-19 Thread Jeff King
.8.3, git will show text/plain content sent along with a a non-200 HTTP code. However, it does this _only_ for the initial refs fetch (along with several other error-reporting niceties, including specifically handling HTTP 401s). The thinking was that the interesting smart-http errors happen on that i

Re: Returning error message from custom smart http server

2014-05-19 Thread Carlos Martín Nieto
On Mon, 2014-05-19 at 18:12 +1000, Bryan Turner wrote: > On Sat, May 17, 2014 at 9:01 AM, brian m. carlson > wrote: > > On Tue, May 13, 2014 at 09:39:59AM +0200, "Ákos, Tajti" wrote: > >> Dear List, > >> > >> we implemented our own git smart

Re: Returning error message from custom smart http server

2014-05-19 Thread Bryan Turner
On Sat, May 17, 2014 at 9:01 AM, brian m. carlson wrote: > On Tue, May 13, 2014 at 09:39:59AM +0200, "Ákos, Tajti" wrote: >> Dear List, >> >> we implemented our own git smart http server to be able to check permissions >> and other thing before pushes. It wo

Re: Returning error message from custom smart http server

2014-05-16 Thread brian m. carlson
On Tue, May 13, 2014 at 09:39:59AM +0200, "Ákos, Tajti" wrote: > Dear List, > > we implemented our own git smart http server to be able to check permissions > and other thing before pushes. It works fine, however, the error messages we > generate on the server side

Returning error message from custom smart http server

2014-05-13 Thread Ákos, Tajti
Dear List, we implemented our own git smart http server to be able to check permissions and other thing before pushes. It works fine, however, the error messages we generate on the server side are not displayed by the command line client. On the server we generate error messages like this

Re: [PATCH 6/6] fetch-pack: fix deepen shallow over smart http with no-done cap

2014-02-10 Thread Junio C Hamano
Duy Nguyen writes: > On Fri, Feb 07, 2014 at 10:01:08AM -0800, Junio C Hamano wrote: >> Here is the difference between the posted series and what I queued >> after applying the changes suggested during the review. >> >> Thanks. > > I was going to send a reroll after the received comments. Could

Re: [PATCH 6/6] fetch-pack: fix deepen shallow over smart http with no-done cap

2014-02-07 Thread Duy Nguyen
On Fri, Feb 07, 2014 at 10:01:08AM -0800, Junio C Hamano wrote: > Here is the difference between the posted series and what I queued > after applying the changes suggested during the review. > > Thanks. I was going to send a reroll after the received comments. Could you put this on top of 6/6, ju

Re: [PATCH 6/6] fetch-pack: fix deepen shallow over smart http with no-done cap

2014-02-07 Thread Junio C Hamano
least one common base and multi_ack or multi_ack_detailed is enabled. The server always sends NAK after 'done' if there is no common base found. diff --git a/Documentation/technical/protocol-capabilities.txt b/Documentation/technical/protocol-capabilities.txt index cb2f5eb..e174343 100644 --

Re: [PATCH 6/6] fetch-pack: fix deepen shallow over smart http with no-done cap

2014-02-06 Thread Duy Nguyen
On Fri, Feb 7, 2014 at 2:16 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> In smart http, upload-pack adds new shallow lines at the beginning of >> each rpc response. Only shallow lines from the first rpc call are >> useful. After that they are thrown away

Re: [PATCH 6/6] fetch-pack: fix deepen shallow over smart http with no-done cap

2014-02-06 Thread Jeff King
On Thu, Feb 06, 2014 at 10:10:39PM +0700, Nguyễn Thái Ngọc Duy wrote: > In smart http, upload-pack adds new shallow lines at the beginning of > each rpc response. Only shallow lines from the first rpc call are > useful. After that they are thrown away. It's designed this way > be

Re: [PATCH 6/6] fetch-pack: fix deepen shallow over smart http with no-done cap

2014-02-06 Thread Eric Sunshine
On Thu, Feb 6, 2014 at 10:10 AM, Nguyễn Thái Ngọc Duy wrote: > diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh > index b0fa738..fb11073 100755 > --- a/t/t5537-fetch-shallow.sh > +++ b/t/t5537-fetch-shallow.sh > @@ -200,5 +200,29 @@ EOF > ) > ' > > +# This test is tricky.

Re: [PATCH 6/6] fetch-pack: fix deepen shallow over smart http with no-done cap

2014-02-06 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > In smart http, upload-pack adds new shallow lines at the beginning of > each rpc response. Only shallow lines from the first rpc call are > useful. After that they are thrown away. It's designed this way > because upload-pack is stateless and has

[PATCH 6/6] fetch-pack: fix deepen shallow over smart http with no-done cap

2014-02-06 Thread Nguyễn Thái Ngọc Duy
In smart http, upload-pack adds new shallow lines at the beginning of each rpc response. Only shallow lines from the first rpc call are useful. After that they are thrown away. It's designed this way because upload-pack is stateless and has no idea when its shallow lines are helpful or not

Re: [PATCH v4 23/28] Support shallow fetch/clone over smart-http

2014-01-08 Thread Jeff King
On Thu, Dec 05, 2013 at 08:02:50PM +0700, Nguyễn Thái Ngọc Duy wrote: > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > Documentation/gitremote-helpers.txt | 7 +++ > builtin/fetch-pack.c| 16 +--- > remote-curl.c | 31 ++

[PATCH v4 23/28] Support shallow fetch/clone over smart-http

2013-12-05 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/gitremote-helpers.txt | 7 +++ builtin/fetch-pack.c| 16 +--- remote-curl.c | 31 +-- t/t5536-fetch-shallow.sh| 27 +++ tran

Re: Use mongoose to test smart-http unconditionally?

2013-12-04 Thread Jeff King
On Wed, Dec 04, 2013 at 03:28:00PM -0800, Jonathan Nieder wrote: > For what it's worth, when I build git and run tests I tend to be in an > environment with apache available, but I'm too lazy to configure git's > tests to pick the right port and make sure it is reserved and so on. > Perhaps there'

Re: Use mongoose to test smart-http unconditionally?

2013-12-04 Thread Jeff King
r test harness apache config has grown non-trivial). > As long as a server supports bog standard CGI interface, smart-http > should work the same way with any such server. For that reason, it > should be theoretically sufficient to test with one non-apache > server (i.e. mongoose) for th

Re: Use mongoose to test smart-http unconditionally?

2013-12-04 Thread Duy Nguyen
On Thu, Dec 5, 2013 at 6:28 AM, Jonathan Nieder wrote: > Jeff King wrote: > >> I don't know if it is worth all that much effort, though. I suppose it >> could get us more exposure to the httpd tests, but I do not know if it >> would be a good idea to turn them on by default anyway. They touch >> g

Re: Use mongoose to test smart-http unconditionally?

2013-12-04 Thread Jonathan Nieder
Jeff King wrote: > I don't know if it is worth all that much effort, though. I suppose it > could get us more exposure to the httpd tests, but I do not know if it > would be a good idea to turn them on by default anyway. They touch > global machine resources (like ports) that can cause conflicts o

Re: Use mongoose to test smart-http unconditionally?

2013-12-04 Thread Junio C Hamano
g an excuse "my box does not have apache installed" from them. As long as a server supports bog standard CGI interface, smart-http should work the same way with any such server. For that reason, it should be theoretically sufficient to test with one non-apache server (i.e. mongoose) for t

Re: Use mongoose to test smart-http unconditionally?

2013-12-04 Thread Jeff King
On Wed, Dec 04, 2013 at 12:09:09PM -0800, Junio C Hamano wrote: > Duy Nguyen writes: > > > I was thinking of an alternative to apache for testing smart-http > > so that most of http tests could always run. Mongoose [1] looks > > like a good candidate to bundle with git.

Re: Use mongoose to test smart-http unconditionally?

2013-12-04 Thread Junio C Hamano
Duy Nguyen writes: > I was thinking of an alternative to apache for testing smart-http > so that most of http tests could always run. Mongoose [1] looks > like a good candidate to bundle with git. Just one pair of source > files, mongoose.[ch], a mainloop wrapper and we have an h

Re: Use mongoose to test smart-http unconditionally?

2013-12-04 Thread Jeff King
On Wed, Dec 04, 2013 at 10:13:11AM -0800, Shawn Pearce wrote: > On Wed, Dec 4, 2013 at 2:53 AM, Duy Nguyen wrote: > > I was thinking of an alternative to apache for testing smart-http so > > that most of http tests could always run. Mongoose [1] looks like a > > good candida

Re: Use mongoose to test smart-http unconditionally?

2013-12-04 Thread Shawn Pearce
On Wed, Dec 4, 2013 at 2:53 AM, Duy Nguyen wrote: > I was thinking of an alternative to apache for testing smart-http so > that most of http tests could always run. Mongoose [1] looks like a > good candidate to bundle with git. Just one pair of source files, > mongoose.[ch], a main

Use mongoose to test smart-http unconditionally?

2013-12-04 Thread Duy Nguyen
I was thinking of an alternative to apache for testing smart-http so that most of http tests could always run. Mongoose [1] looks like a good candidate to bundle with git. Just one pair of source files, mongoose.[ch], a mainloop wrapper and we have an http server. Just wondering, do we rely on any

[PATCH 06/10] fetch: pack v4 support on smart http

2013-09-25 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-fetch-pack.txt| 4 Documentation/gitremote-helpers.txt | 3 +++ builtin/fetch-pack.c| 7 +++ remote-curl.c | 14 +- t/t5551-http-fetch.sh | 9 + tran

Re: [PATCH] Document smart http

2013-08-20 Thread Duy Nguyen
On Tue, Aug 20, 2013 at 9:16 PM, Jeff King wrote: > On Tue, Aug 20, 2013 at 12:08:08PM +0700, Nguyen Thai Ngoc Duy wrote: > >> This may provide some clues for those who want to modify smart http >> code as smart http is pretty much undocumented. Smart http "document&quo

Re: [PATCH] Document smart http

2013-08-20 Thread Jeff King
On Tue, Aug 20, 2013 at 12:08:08PM +0700, Nguyen Thai Ngoc Duy wrote: > This may provide some clues for those who want to modify smart http > code as smart http is pretty much undocumented. Smart http "document" > so far is a few commit messages and the source code. There was

[PATCH] Document smart http

2013-08-19 Thread Nguyễn Thái Ngọc Duy
This may provide some clues for those who want to modify smart http code as smart http is pretty much undocumented. Smart http "document" so far is a few commit messages and the source code. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-fetch-pack.txt

[PATCH v3 9/6] push: teach --force-with-lease to smart-http transport

2013-08-02 Thread Junio C Hamano
We have been passing enough information to enable the compare-and-swap logic down to the transport layer, but the transport helper was not passing it to smart-http transport. Signed-off-by: Junio C Hamano --- * I didn't bother with the dumb commit walker push for obvious reasons, b

[PATCH v3 7/6] t5540/5541: smart-http does not support "--force-with-lease"

2013-08-01 Thread Junio C Hamano
The push() method in remote-curl.c is not told and does not pass the necessary information to underlying send-pack, so this extension does not yet work. Leave a note in the test suite. Signed-off-by: Junio C Hamano --- * This is primarily to give a target for other people to shoot at; patch

[PATCH] Let index-pack help with connectivity check on cloning via smart http

2013-07-21 Thread Nguyễn Thái Ngọc Duy
This is an extension of c6807a4 (clone: open a shortcut for connectivity check - 2013-05-26) to reduce the cost of connectivity check at clone time, this time with smart http protocol. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-fetch-pack.txt| 4 Documentation/gitremote

[PATCH v2 11/16] {fetch,upload}-pack: support fetching from a shallow clone via smart http

2013-07-20 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/technical/pack-protocol.txt | 3 +++ builtin/fetch-pack.c | 3 +-- remote-curl.c | 4 +++- t/t5536-fetch-shallow.sh | 27 +++ upload-pack.c

[PATCH v2 10/16] Add document for command arguments for supporting smart http

2013-07-20 Thread Nguyễn Thái Ngọc Duy
t, and the list must end with a flush packet. --no-progress:: Do not show the progress. +--stateless-rpc:: + Smart HTTP mode. + +--lock-pack:: + Issue "lock" command to the remote helper via stdout. + -v:: Run verbosely. diff --git a/Documentation/git-rec

[PATCH v2 09/16] pack-protocol.txt: a bit about smart http

2013-07-20 Thread Nguyễn Thái Ngọc Duy
/Documentation/technical/pack-protocol.txt +++ b/Documentation/technical/pack-protocol.txt @@ -551,3 +551,69 @@ An example client/server communication might look like this: S: 0018ok refs/heads/debug\n S: 002ang refs/heads/master non-fast-forward\n + +Smart HTTP Transport

Re: [PATCH 2/3] remote-curl: verify smart-http metadata lines

2013-02-18 Thread Jeff King
On Sun, Feb 17, 2013 at 04:54:43PM -0800, Jonathan Nieder wrote: > > My intent was that it followed the error convention of "negative is > > error, 0 is success, and positive is not used, but reserved for > > future use". > > From a maintainability perspective, that kind of contract would be > da

Re: [PATCH 2/3] remote-curl: verify smart-http metadata lines

2013-02-17 Thread Jonathan Nieder
Jeff King wrote: > On Sun, Feb 17, 2013 at 02:49:39AM -0800, Jonathan Nieder wrote: >> Jeff King wrote: >>> --- a/remote-curl.c [...] >>> + if (read_packets_until_flush(&last->buf, &last->len) < 0) >> >> Style nit: this made me wonder "What would it mean if >> read_packets_until_flush()

Re: [PATCH 2/3] remote-curl: verify smart-http metadata lines

2013-02-17 Thread Jeff King
le error; > > easier to read. My intent was that it followed the error convention of "negative is error, 0 is success, and positive is not used, but reserved for future use". And I tend to think the "< 0" makes it obvious that we are interested in e

Re: [PATCH 2/3] remote-curl: verify smart-http metadata lines

2013-02-17 Thread Jonathan Nieder
n for this function is "0 for success", I would personally find if (read_packets_until_flush(...)) handle error; easier to read. > + die("smart-http metadata lines are invalid at %s", > + refs_url

[PATCH 2/3] remote-curl: verify smart-http metadata lines

2013-02-15 Thread Jeff King
A smart http ref advertisement starts with a packet containing the service header, followed by an arbitrary number of packets containing other metadata headers, followed by a flush packet. We don't currently recognize any other metadata headers, so we just parse through any extra pa

[PATCH 0/3] make smart-http more robust against bogus server input

2013-02-15 Thread Jeff King
For the most part, smart-http just passes data to fetch-pack and send-pack, which take care of the heavy lifting. However, I did find a few corner cases around truncated data from the server, one of which can actually cause a deadlock. I found these because I was trying to figure out what was

Re: [PATCH] Verify Content-Type from smart HTTP servers

2013-02-06 Thread Jeff King
On Wed, Feb 06, 2013 at 07:56:08AM -0800, Junio C Hamano wrote: > Jeff King writes: > > > Is it worth having a strbuf_set* family of functions to match the > > strbuf_add*? We seem to have these sorts of errors with strbuf from time > > to time, and I wonder if that would make it easier (and mor

Re: [PATCH] Verify Content-Type from smart HTTP servers

2013-02-06 Thread Junio C Hamano
Jeff King writes: > Is it worth having a strbuf_set* family of functions to match the > strbuf_add*? We seem to have these sorts of errors with strbuf from time > to time, and I wonder if that would make it easier (and more readable) > to do the right thing. Possibly. The callsite below may be

Re: [PATCH] Verify Content-Type from smart HTTP servers

2013-02-06 Thread Jeff King
On Wed, Feb 06, 2013 at 11:24:41AM +0100, Michael Schubert wrote: > On 01/31/2013 11:09 PM, Junio C Hamano wrote: > > > > > -static int http_request_reauth(const char *url, void *result, int target, > > +static int http_request_reauth(const char *url, > > + struct strbu

Re: [PATCH] Verify Content-Type from smart HTTP servers

2013-02-06 Thread Michael Schubert
; > @@ -113,7 +115,7 @@ static struct discovery* discover_refs(const char > *service) > } > refs_url = strbuf_detach(&buffer, NULL); > > - http_ret = http_get_strbuf(refs_url, &buffer, HTTP_NO_CACHE); > + http_ret = http_get_strbuf(refs_url,

Re: [PATCH] Verify Content-Type from smart HTTP servers

2013-02-04 Thread Junio C Hamano
--- a/t/t5551-http-fetch.sh +++ b/t/t5551-http-fetch.sh @@ -158,9 +158,8 @@ test_expect_success 'GIT_SMART_HTTP can disable smart http' ' ' test_expect_success 'invalid Content-Type rejected' ' - echo "fatal: invalid content-type text/html

  1   2   >