Re: [PATCH v3 1/4] pack-protocol.txt: accept error packets in any context

2018-12-12 Thread Masaya Suzuki
On Wed, Dec 12, 2018 at 3:02 AM Jeff King wrote: > > On Tue, Dec 11, 2018 at 04:25:15PM -0800, Josh Steadmon wrote: > > > From: Masaya Suzuki > > > > In the Git pack protocol definition, an error packet may appear only in > > a certain context. However, servers c

[PATCH] Use packet_reader instead of packet_read_line

2018-12-26 Thread Masaya Suzuki
By using and sharing a packet_reader while handling a Git pack protocol request, the same reader option is used throughout the code. This makes it easy to set a reader option to the request parsing code. Signed-off-by: Masaya Suzuki --- builtin/archive.c | 19 ++--- builtin/receive

[PATCH] Specify -Wformat along with -Wformat-security

2018-12-26 Thread Masaya Suzuki
Without -Wformat, -Wformat-security won't work. > cc1: error: -Wformat-security ignored without -Wformat > [-Werror=format-security] Signed-off-by: Masaya Suzuki --- config.mak.dev | 1 + 1 file changed, 1 insertion(+) diff --git a/config.mak.dev b/config.mak.dev index bbeeff44f

Re: [PATCH] Specify -Wformat along with -Wformat-security

2018-12-27 Thread Masaya Suzuki
On Thu, Dec 27, 2018 at 10:36 AM Duy Nguyen wrote: > > On Thu, Dec 27, 2018 at 7:18 PM Masaya Suzuki wrote: > > > > Without -Wformat, -Wformat-security won't work. > > > > > cc1: error: -Wformat-security ignored without -Wformat > > > [-Werror

[PATCH 1/2] Change how HTTP response body is returned

2018-12-27 Thread Masaya Suzuki
a request with CURLOPT_FAILONERROR, and libcurl won't call the callback if the response has an error status code. Signed-off-by: Masaya Suzuki --- http.c| 99 +-- remote-curl.c | 29 --- 2 files changed, 81 insertions(+

[PATCH 2/2] Unset CURLOPT_FAILONERROR

2018-12-27 Thread Masaya Suzuki
y for non-OK responses. This is substantially same as setting http_options.keep_error to all requests. Hence, removing this option. Signed-off-by: Masaya Suzuki --- http.c | 4 http.h | 1 - remote-curl.c| 1 - t/lib-httpd/apache

Re: [PATCH 2/2] Unset CURLOPT_FAILONERROR

2018-12-28 Thread Masaya Suzuki
On Fri, Dec 28, 2018 at 11:37 AM Eric Sunshine wrote: > > On Thu, Dec 27, 2018 at 8:47 PM Masaya Suzuki wrote: > > When GIT_CURL_VERBOSE is set, libcurl produces request/response headers > > to stderr. However, if the response is an error response and > > CURLOPT_FAI

Re: [PATCH 2/2] Unset CURLOPT_FAILONERROR

2018-12-28 Thread Masaya Suzuki
On Fri, Dec 28, 2018 at 11:58 AM Eric Sunshine wrote: > > On Fri, Dec 28, 2018 at 2:51 PM Masaya Suzuki wrote: > > On Fri, Dec 28, 2018 at 11:37 AM Eric Sunshine > > wrote: > > > On Thu, Dec 27, 2018 at 8:47 PM Masaya Suzuki > > > wrote: > > >

[PATCH v2 0/2] Show HTTP headers of failed requests with GIT_CURL_VERBOSE

2018-12-29 Thread Masaya Suzuki
y for non-OK responses. To this end, the caller of libcurl needs to handle HTTP request failures by themselves. The first patch makes git prepared to handle those failures. The second patch actually unsets CURLOPT_FAILONERROR. Masaya Suzuki (2): Change how HTTP response body is returned

[PATCH v2 1/2] Change how HTTP response body is returned

2018-12-29 Thread Masaya Suzuki
a request with CURLOPT_FAILONERROR, and libcurl won't call the callback if the response has an error status code. Signed-off-by: Masaya Suzuki --- http.c| 99 +-- remote-curl.c | 29 --- 2 files changed, 81 insertions(+

[PATCH v2 2/2] Unset CURLOPT_FAILONERROR

2018-12-29 Thread Masaya Suzuki
y for non-OK responses. This is substantially same as setting http_options.keep_error to all requests. Hence, remove this option. Signed-off-by: Masaya Suzuki --- http.c | 4 http.h | 1 - remote-curl.c| 1 - t/lib-httpd/apache

Re: [PATCH] Use packet_reader instead of packet_read_line

2018-12-29 Thread Masaya Suzuki
Sorry. This is really broken. I'll fix the tests and send another version.

[PATCH v2 2/2] pack-protocol.txt: accept error packets in any context

2018-12-29 Thread Masaya Suzuki
not a part of Git protocol, it's possible that a packet that is not supposed to be an error packet is mistakenly parsed as an error packet. This error packet handling is enabled only for the Git pack protocol parsing code considering this. Signed-off-by: Masaya Suzuki --- Documentation/tech

[PATCH v2 1/2] Use packet_reader instead of packet_read_line

2018-12-29 Thread Masaya Suzuki
By using and sharing a packet_reader while handling a Git pack protocol request, the same reader option is used throughout the code. This makes it easy to set a reader option to the request parsing code. Signed-off-by: Masaya Suzuki --- builtin/archive.c | 19 ++--- builtin/receive

[PATCH v2 0/2] Accept error packets in any context

2018-12-29 Thread Masaya Suzuki
.ge37...@google.com/ Masaya Suzuki (2): Use packet_reader instead of packet_read_line pack-protocol.txt: accept error packets in any context Documentation/technical/pack-protocol.txt | 20 +++ builtin/archive.c | 19 +++ builtin/fetch-pack.c

Re: [PATCH v2 0/2] Accept error packets in any context

2019-01-03 Thread Masaya Suzuki
On Thu, Jan 3, 2019 at 3:05 PM Junio C Hamano wrote: > > Masaya Suzuki writes: > > > This makes it possible for servers to send an error message back to clients > > in > > an arbitrary situation. > > > > The first patch was originally sent in [1]. This

Re: [PATCH v2 2/2] Unset CURLOPT_FAILONERROR

2019-01-07 Thread Masaya Suzuki
On Fri, Jan 4, 2019 at 2:49 AM Jeff King wrote: > > On Sat, Dec 29, 2018 at 11:44:47AM -0800, Masaya Suzuki wrote: > > > When GIT_CURL_VERBOSE is set, libcurl produces request/response headers > > to stderr. However, if the response is an error response and > > CURLOPT_

[PATCH v3 4/5] remote-curl: unset CURLOPT_FAILONERROR

2019-01-07 Thread Masaya Suzuki
By not setting CURLOPT_FAILONERROR, curl parses the HTTP response headers even if the response is an error. This makes GIT_CURL_VERBOSE to show the HTTP headers, which is useful for debugging. Signed-off-by: Masaya Suzuki --- remote-curl.c | 10 ++ 1 file changed, 10 insertions(+) diff

[PATCH v3 1/5] http: support file handles for HTTP_KEEP_ERROR

2019-01-07 Thread Masaya Suzuki
HTTP_KEEP_ERROR makes it easy to debug HTTP transport errors. In order to make HTTP_KEEP_ERROR enabled for all requests, file handles need to be supported. Signed-off-by: Masaya Suzuki --- http.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/http.c b/http.c index

[PATCH v3 0/5] Show HTTP headers of failed requests with GIT_CURL_VERBOSE

2019-01-07 Thread Masaya Suzuki
-masayasuz...@google.com/ [2]: https://public-inbox.org/git/20190104101149.ga26...@sigill.intra.peff.net/ [3]: https://public-inbox.org/git/20190104104907.gc26...@sigill.intra.peff.net/ Masaya Suzuki (5): http: support file handles for HTTP_KEEP_ERROR http: enable keep_error for HTTP requests r

[PATCH v3 3/5] remote-curl: define struct for CURLOPT_WRITEFUNCTION

2019-01-07 Thread Masaya Suzuki
In order to pass more values for rpc_in, define a struct and pass it as an additional value. Signed-off-by: Masaya Suzuki --- remote-curl.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/remote-curl.c b/remote-curl.c index d8eda2380a..d4673b6e8c 100644

[PATCH v3 2/5] http: enable keep_error for HTTP requests

2019-01-07 Thread Masaya Suzuki
HTTP response headers, and they're shown if GIT_CURL_VERBOSE is set. Signed-off-by: Masaya Suzuki --- http.c| 30 +- http.h| 1 - remote-curl.c | 1 - 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/http.c b/http.c index 06450

[PATCH v3 5/5] test: test GIT_CURL_VERBOSE=1 shows an error

2019-01-07 Thread Masaya Suzuki
This tests GIT_CURL_VERBOSE shows an error when an URL returns 500. This exercises the code in remote_curl. Signed-off-by: Masaya Suzuki --- t/lib-httpd/apache.conf | 1 + t/t5581-http-curl-verbose.sh | 28 2 files changed, 29 insertions(+) create mode 100755

Re: [PATCH v2 1/2] Use packet_reader instead of packet_read_line

2019-01-08 Thread Masaya Suzuki
On Mon, Jan 7, 2019 at 2:33 PM Josh Steadmon wrote: > > On 2018.12.29 13:19, Masaya Suzuki wrote: > > By using and sharing a packet_reader while handling a Git pack protocol > > request, the same reader option is used throughout the code. This makes > > it easy to se

[PATCH v4 2/5] http: enable keep_error for HTTP requests

2019-01-10 Thread Masaya Suzuki
HTTP response headers, and they're shown if GIT_CURL_VERBOSE is set. Signed-off-by: Masaya Suzuki --- http.c| 42 +++--- http.h| 1 - remote-curl.c | 1 - 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/http.c b/http.c

[PATCH v4 1/5] http: support file handles for HTTP_KEEP_ERROR

2019-01-10 Thread Masaya Suzuki
HTTP_KEEP_ERROR makes it easy to debug HTTP transport errors. In order to make HTTP_KEEP_ERROR enabled for all requests, file handles need to be supported. Signed-off-by: Masaya Suzuki --- http.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/http.c b

[PATCH v4 0/5] Show HTTP headers of failed requests with GIT_CURL_VERBOSE

2019-01-10 Thread Masaya Suzuki
Diff from v3[1]: * Handle ftruncate and fflush return values * Call rewind to set the position back [1]: https://public-inbox.org/git/20190108024741.62176-1-masayasuz...@google.com/ Masaya Suzuki (5): http: support file handles for HTTP_KEEP_ERROR http: enable keep_error for HTTP

[PATCH v4 5/5] test: test GIT_CURL_VERBOSE=1 shows an error

2019-01-10 Thread Masaya Suzuki
This tests GIT_CURL_VERBOSE shows an error when an URL returns 500. This exercises the code in remote_curl. Signed-off-by: Masaya Suzuki --- t/lib-httpd/apache.conf | 1 + t/t5581-http-curl-verbose.sh | 28 2 files changed, 29 insertions(+) create mode 100755

[PATCH v4 3/5] remote-curl: define struct for CURLOPT_WRITEFUNCTION

2019-01-10 Thread Masaya Suzuki
In order to pass more values for rpc_in, define a struct and pass it as an additional value. Signed-off-by: Masaya Suzuki --- remote-curl.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/remote-curl.c b/remote-curl.c index d8eda2380a..d4673b6e8c 100644

[PATCH v4 4/5] remote-curl: unset CURLOPT_FAILONERROR

2019-01-10 Thread Masaya Suzuki
By not setting CURLOPT_FAILONERROR, curl parses the HTTP response headers even if the response is an error. This makes GIT_CURL_VERBOSE to show the HTTP headers, which is useful for debugging. Signed-off-by: Masaya Suzuki --- remote-curl.c | 10 ++ 1 file changed, 10 insertions(+) diff

[PATCH] credential: add nocache option to the credentials API

2019-07-06 Thread Masaya Suzuki
per should not be cached. If this is specified, even after the credential is used successfully, it won't be announced to other helpers for store. Signed-off-by: Masaya Suzuki --- Documentation/technical/api-credentials.txt | 4 +++- credential.c| 4 +++

Re: [PATCH] credential: add nocache option to the credentials API

2019-07-22 Thread Masaya Suzuki
On Tue, Jul 9, 2019 at 5:56 AM Jeff King wrote: > > On Sat, Jul 06, 2019 at 10:51:32PM -0700, Masaya Suzuki wrote: > > > The credentials API calls credentials helpers in order. If a > > username/password pair is returned the helpers and if it's used for > > a

[PATCH] pack-protocol.txt: accept error packets in any context

2018-11-26 Thread Masaya Suzuki
change, the error packet handling code is moved to pkt-line.c. Signed-off-by: Masaya Suzuki --- Documentation/technical/pack-protocol.txt | 20 +++- builtin/archive.c | 2 -- connect.c | 2 -- fetch-pack.c

Re: [PATCH] pack-protocol.txt: accept error packets in any context

2018-11-29 Thread Masaya Suzuki
On Thu, Nov 29, 2018 at 3:42 AM Junio C Hamano wrote: > > Masaya Suzuki writes: > > > In the Git pack protocol definition, an error packet may appear only in > > a certain context. However, servers can face a runtime error (e.g. I/O > > error) at an arbitrary tim

[PATCH] builtin/send-pack: populate the default configs

2018-06-12 Thread Masaya Suzuki
builtin/send-pack didn't call git_default_config, and because of this git push --signed didn't respect the username and email in gitconfig in the HTTP transport. Signed-off-by: Masaya Suzuki --- builtin/send-pack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bu

[PATCH] doc: fix want-capability separator

2018-07-28 Thread Masaya Suzuki
Unlike ref advertisement, client capabilities and the first want are separated by SP, not NUL, in the implementation. Fix the documentation to align with the implementation. pack-protocol.txt is already fixed. Signed-off-by: Masaya Suzuki --- Documentation/technical/http-protocol.txt | 4

[PATCH 1/1] fetch: Cache the want OIDs for faster lookup

2019-09-15 Thread Masaya Suzuki
refs' OIDs. Signed-off-by: Masaya Suzuki --- builtin/fetch.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index 54d6b01892..51a276dfaa 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -7,6 +7,7 @@ #include &qu

[PATCH 0/1] fetch: Cache the want OIDs for faster lookup

2019-09-15 Thread Masaya Suzuki
peeds up this process by using oid_set. Now the client can send a fetch request almost immediately. Masaya Suzuki (1): fetch: Cache the want OIDs for faster lookup builtin/fetch.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) -- 2.23.0.237.gc6a4ce50a0-goog

Re: [PATCH] credential: add nocache option to the credentials API

2019-09-15 Thread Masaya Suzuki
On Mon, Aug 26, 2019 at 9:28 AM Junio C Hamano wrote: > > Jeff King writes: > > > I was thinking that Git itself could treat "ttl=0" specially, the same > > as your nocache, and avoid passing it along to any helpers during the > > approve stage. That would make it exactly equivalent to your patch

Re: [PATCH 1/1] fetch: Cache the want OIDs for faster lookup

2019-09-15 Thread Masaya Suzuki
On Sun, Sep 15, 2019 at 7:35 PM Derrick Stolee wrote: > > On 9/15/2019 5:18 PM, Masaya Suzuki wrote: > > During git-fetch, the client checks if the advertised tags' OIDs are > > already in the fetch request's want OID set. This check is done in a > > linear sca