<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/http.c, branch v2.39.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v2.39.2</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v2.39.2'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2023-02-06T08:43:39Z</updated>
<entry>
<title>Sync with 2.38.4</title>
<updated>2023-02-06T08:43:39Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2023-02-06T08:43:39Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=3aef76ffd4a67296d5d0d1530d980e655d189f47'/>
<id>urn:sha1:3aef76ffd4a67296d5d0d1530d980e655d189f47</id>
<content type='text'>
* maint-2.38:
  Git 2.38.4
  Git 2.37.6
  Git 2.36.5
  Git 2.35.7
  Git 2.34.7
  http: support CURLOPT_PROTOCOLS_STR
  http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
  http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
  Git 2.33.7
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport
</content>
</entry>
<entry>
<title>Sync with 2.37.6</title>
<updated>2023-02-06T08:43:28Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2023-02-06T08:43:28Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=6487e9c4594028c47559a868fc89f3302562cd8b'/>
<id>urn:sha1:6487e9c4594028c47559a868fc89f3302562cd8b</id>
<content type='text'>
* maint-2.37:
  Git 2.37.6
  Git 2.36.5
  Git 2.35.7
  Git 2.34.7
  http: support CURLOPT_PROTOCOLS_STR
  http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
  http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
  Git 2.33.7
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport
</content>
</entry>
<entry>
<title>Sync with 2.36.5</title>
<updated>2023-02-06T08:38:31Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2023-02-06T08:38:31Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=16004682f95ee0065892c3206bd6a69bfe4bc891'/>
<id>urn:sha1:16004682f95ee0065892c3206bd6a69bfe4bc891</id>
<content type='text'>
* maint-2.36:
  Git 2.36.5
  Git 2.35.7
  Git 2.34.7
  http: support CURLOPT_PROTOCOLS_STR
  http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
  http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
  Git 2.33.7
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport
</content>
</entry>
<entry>
<title>Sync with 2.35.7</title>
<updated>2023-02-06T08:37:52Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2023-02-06T08:37:52Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=40843216c568d39ee4d10ee256dc76de4f54f0a0'/>
<id>urn:sha1:40843216c568d39ee4d10ee256dc76de4f54f0a0</id>
<content type='text'>
* maint-2.35:
  Git 2.35.7
  Git 2.34.7
  http: support CURLOPT_PROTOCOLS_STR
  http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
  http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
  Git 2.33.7
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport
</content>
</entry>
<entry>
<title>Sync with 2.34.7</title>
<updated>2023-02-06T08:29:44Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2023-02-06T08:29:44Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=6a53a59bf9986f99c1a8dd0f36e2b9d6033e89f2'/>
<id>urn:sha1:6a53a59bf9986f99c1a8dd0f36e2b9d6033e89f2</id>
<content type='text'>
* maint-2.34:
  Git 2.34.7
  http: support CURLOPT_PROTOCOLS_STR
  http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
  http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
  Git 2.33.7
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport
</content>
</entry>
<entry>
<title>http: support CURLOPT_PROTOCOLS_STR</title>
<updated>2023-02-06T08:27:09Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2023-01-17T03:04:48Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=f44e6a21057b0d8aae7c36f10537353330813f62'/>
<id>urn:sha1:f44e6a21057b0d8aae7c36f10537353330813f62</id>
<content type='text'>
The CURLOPT_PROTOCOLS (and matching CURLOPT_REDIR_PROTOCOLS) flag was
deprecated in curl 7.85.0, and using it generate compiler warnings as of
curl 7.87.0. The path forward is to use CURLOPT_PROTOCOLS_STR, but we
can't just do so unilaterally, as it was only introduced less than a
year ago in 7.85.0.

Until that version becomes ubiquitous, we have to either disable the
deprecation warning or conditionally use the "STR" variant on newer
versions of libcurl. This patch switches to the new variant, which is
nice for two reasons:

  - we don't have to worry that silencing curl's deprecation warnings
    might cause us to miss other more useful ones

  - we'd eventually want to move to the new variant anyway, so this gets
    us set up (albeit with some extra ugly boilerplate for the
    conditional)

There are a lot of ways to split up the two cases. One way would be to
abstract the storage type (strbuf versus a long), how to append
(strbuf_addstr vs bitwise OR), how to initialize, which CURLOPT to use,
and so on. But the resulting code looks pretty magical:

  GIT_CURL_PROTOCOL_TYPE allowed = GIT_CURL_PROTOCOL_TYPE_INIT;
  if (...http is allowed...)
	GIT_CURL_PROTOCOL_APPEND(&amp;allowed, "http", CURLOPT_HTTP);

and you end up with more "#define GIT_CURL_PROTOCOL_TYPE" macros than
actual code.

On the other end of the spectrum, we could just implement two separate
functions, one that handles a string list and one that handles bits. But
then we end up repeating our list of protocols (http, https, ftp, ftp).

This patch takes the middle ground. The run-time code is always there to
handle both types, and we just choose which one to feed to curl.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
</content>
</entry>
<entry>
<title>http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION</title>
<updated>2023-02-06T08:27:09Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2023-01-17T03:04:44Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=4bd481e0ad9c6e78e320288886ffdad8f76dcfc1'/>
<id>urn:sha1:4bd481e0ad9c6e78e320288886ffdad8f76dcfc1</id>
<content type='text'>
The IOCTLFUNCTION option has been deprecated, and generates a compiler
warning in recent versions of curl. We can switch to using SEEKFUNCTION
instead. It was added in 2008 via curl 7.18.0; our INSTALL file already
indicates we require at least curl 7.19.4.

But there's one catch: curl says we should use CURL_SEEKFUNC_{OK,FAIL},
and those didn't arrive until 7.19.5. One workaround would be to use a
bare 0/1 here (or define our own macros).  But let's just bump the
minimum required version to 7.19.5. That version is only a minor version
bump from our existing requirement, and is only a 2 month time bump for
versions that are almost 13 years old. So it's not likely that anybody
cares about the distinction.

Switching means we have to rewrite the ioctl functions into seek
functions. In some ways they are simpler (seeking is the only
operation), but in some ways more complex (the ioctl allowed only a full
rewind, but now we can seek to arbitrary offsets).

Curl will only ever use SEEK_SET (per their documentation), so I didn't
bother implementing anything else, since it would naturally be
completely untested. This seems unlikely to change, but I added an
assertion just in case.

Likewise, I doubt curl will ever try to seek outside of the buffer sizes
we've told it, but I erred on the defensive side here, rather than do an
out-of-bounds read.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
</content>
</entry>
<entry>
<title>http: redact curl h2h3 headers in info</title>
<updated>2022-11-14T22:42:46Z</updated>
<author>
<name>Glen Choo</name>
<email>chooglen@google.com</email>
</author>
<published>2022-11-11T22:35:06Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=b637a41ebe0e65b6d64dd65efaf848b4705dcbed'/>
<id>urn:sha1:b637a41ebe0e65b6d64dd65efaf848b4705dcbed</id>
<content type='text'>
With GIT_TRACE_CURL=1 or GIT_CURL_VERBOSE=1, sensitive headers like
"Authorization" and "Cookie" get redacted. However, since [1], curl's
h2h3 module (invoked when using HTTP/2) also prints headers in its
"info", which don't get redacted. For example,

  echo 'github.com	TRUE	/	FALSE	1698960413304	o	foo=bar' &gt;cookiefile &amp;&amp;
  GIT_TRACE_CURL=1 GIT_TRACE_CURL_NO_DATA=1 git \
    -c 'http.cookiefile=cookiefile' \
    -c 'http.version=' \
    ls-remote https://github.com/git/git refs/heads/main 2&gt;output &amp;&amp;
  grep 'cookie' output

produces output like:

  23:04:16.920495 http.c:678              == Info: h2h3 [cookie: o=foo=bar]
  23:04:16.920562 http.c:637              =&gt; Send header: cookie: o=&lt;redacted&gt;

Teach http.c to check for h2h3 headers in info and redact them using the
existing header redaction logic. This fixes the broken redaction logic
that we noted in the previous commit, so mark the redaction tests as
passing under HTTP2.

[1] https://github.com/curl/curl/commit/f8c3724aa90472c0e617ddbbc420aa199971eb77

Helped-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Glen Choo &lt;chooglen@google.com&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'll/curl-accept-language'</title>
<updated>2022-07-19T23:40:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-07-19T23:40:19Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=4b8cdff8baa44c97a784d5b4b6c5a9df37de41ff'/>
<id>urn:sha1:4b8cdff8baa44c97a784d5b4b6c5a9df37de41ff</id>
<content type='text'>
Earlier, HTTP transport clients learned to tell the server side
what locale they are in by sending Accept-Language HTTP header, but
this was done only for some requests but not others.

* ll/curl-accept-language:
  remote-curl: send Accept-Language header to server
</content>
</entry>
<entry>
<title>remote-curl: send Accept-Language header to server</title>
<updated>2022-07-11T19:24:28Z</updated>
<author>
<name>Li Linchao</name>
<email>lilinchao@oschina.cn</email>
</author>
<published>2022-07-11T05:58:54Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=b0c4adcdd7e339110bea8da94d7880d413e49330'/>
<id>urn:sha1:b0c4adcdd7e339110bea8da94d7880d413e49330</id>
<content type='text'>
Git server end's ability to accept Accept-Language header was introduced
in f18604bbf2 (http: add Accept-Language header if possible, 2015-01-28),
but this is only used by very early phase of the transfer, which is HTTP
GET request to discover references. For other phases, like POST request
in the smart HTTP, the server does not know what language the client
speaks.

Teach git client to learn end-user's preferred language and throw
accept-language header to the server side. Once the server gets this header,
it has the ability to talk to end-user with language they understand.
This would be very helpful for many non-English speakers.

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Li Linchao &lt;lilinchao@oschina.cn&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
