<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/http.h, branch main</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=main</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2026-03-17T16:14:19Z</updated>
<entry>
<title>http: add support for HTTP 429 rate limit retries</title>
<updated>2026-03-17T16:14:19Z</updated>
<author>
<name>Vaidas Pilkauskas</name>
<email>vaidas.pilkauskas@shopify.com</email>
</author>
<published>2026-03-17T13:00:35Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=640657ffd06999ec1ec3b1d030b7f5aac6b7f57b'/>
<id>urn:sha1:640657ffd06999ec1ec3b1d030b7f5aac6b7f57b</id>
<content type='text'>
Add retry logic for HTTP 429 (Too Many Requests) responses to handle
server-side rate limiting gracefully. When Git's HTTP client receives
a 429 response, it can now automatically retry the request after an
appropriate delay, respecting the server's rate limits.

The implementation supports the RFC-compliant Retry-After header in
both delay-seconds (integer) and HTTP-date (RFC 2822) formats. If a
past date is provided, Git retries immediately without waiting.

Retry behavior is controlled by three new configuration options
(http.maxRetries, http.retryAfter, and http.maxRetryTime) which are
documented in git-config(1).

The retry logic implements a fail-fast approach: if any delay
(whether from server header or configuration) exceeds maxRetryTime,
Git fails immediately with a clear error message rather than capping
the delay. This provides better visibility into rate limiting issues.

The implementation includes extensive test coverage for basic retry
behavior, Retry-After header formats (integer and HTTP-date),
configuration combinations, maxRetryTime limits, invalid header
handling, environment variable overrides, and edge cases.

Signed-off-by: Vaidas Pilkauskas &lt;vaidas.pilkauskas@shopify.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http: refactor subsystem to use `packfile_list`s</title>
<updated>2025-10-30T14:09:52Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-10-30T10:38:40Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=89219bc0cd09ada8a204e0ace0bd15decaea7d31'/>
<id>urn:sha1:89219bc0cd09ada8a204e0ace0bd15decaea7d31</id>
<content type='text'>
The dumb HTTP protocol directly fetches packfiles from the remote server
and temporarily stores them in a list of packfiles. Those packfiles are
not yet added to the repository's packfile store until we finalize the
whole fetch.

Refactor the code to instead use a `struct packfile_list` to store those
packs. This prepares us for a subsequent change where the `-&gt;next`
pointer of `struct packed_git` will go away.

Note that this refactoring creates some temporary duplication of code,
as we now have both `packfile_list_find_oid()` and `find_oid_pack()`.
The latter function will be removed in a subsequent commit though.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/curl-off-t-fixes'</title>
<updated>2025-10-07T19:25:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-10-07T19:25:27Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=c2817955674c8cfc217c4ffc1deea8cc8cabe526'/>
<id>urn:sha1:c2817955674c8cfc217c4ffc1deea8cc8cabe526</id>
<content type='text'>
A few places where an size_t value was cast to curl_off_t without
checking has been updated to use the existing helper function.

* js/curl-off-t-fixes:
  http-push: avoid new compile error
  imap-send: be more careful when casting to `curl_off_t`
  http: offer to cast `size_t` to `curl_off_t` safely
</content>
</entry>
<entry>
<title>http: offer to cast `size_t` to `curl_off_t` safely</title>
<updated>2025-09-26T17:38:18Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2025-09-26T10:32:50Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=e4efcd70604f2a294e020ec2e1bc38f01892cd19'/>
<id>urn:sha1:e4efcd70604f2a294e020ec2e1bc38f01892cd19</id>
<content type='text'>
This commit moves the `xcurl_off_t()` function, which validates that a
given value fits within the `curl_off_t` data type and then casts it, to
a more central place so that it can be used outside of `remote-curl.c`,
too.

At the same time, this function is renamed to conform better with the
naming convention of the helper functions that safely cast from one data
type to another which has been well established in `git-compat-util.h`.

With this move, `gettext.h` must be `#include`d in `http.h` to allow the
error message to remain translatable.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>packfile: refactor `install_packed_git()` to work on packfile store</title>
<updated>2025-09-24T18:53:50Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-09-23T10:17:09Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=f6f236d926915411eca28cb1c47619fdacf6eafb'/>
<id>urn:sha1:f6f236d926915411eca28cb1c47619fdacf6eafb</id>
<content type='text'>
The `install_packed_git()` functions adds a packfile to a specific
object store. Refactor it to accept a packfile store instead of a
repository to clarify its scope.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hash: stop typedeffing the hash context</title>
<updated>2025-01-31T18:06:10Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-01-31T12:55:29Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=7346e340f147131ca32089f61f7d0f502f80d19d'/>
<id>urn:sha1:7346e340f147131ca32089f61f7d0f502f80d19d</id>
<content type='text'>
We generally avoid using `typedef` in the Git codebase. One exception
though is the `git_hash_ctx`, likely because it used to be a union
rather than a struct until the preceding commit refactored it. But now
that it is a normal `struct` there isn't really a need for a typedef
anymore.

Drop the typedef and adapt all callers accordingly.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http: fix leak of http_object_request struct</title>
<updated>2024-09-25T17:24:55Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2024-09-24T22:01:09Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=a1bc3c88de1526c83882143b2e47400f7e3ee4b2'/>
<id>urn:sha1:a1bc3c88de1526c83882143b2e47400f7e3ee4b2</id>
<content type='text'>
The new_http_object_request() function allocates a struct on the heap,
along with some fields inside the struct. But the matching function to
clean it up, release_http_object_request(), only frees the interior
fields without freeing the struct itself, causing a leak.

The related http_pack_request new/release pair gets this right, and at
first glance we should be able to do the same thing and just add a
single free() call. But there's a catch.

These http_object_request structs are typically embedded in the
object_request struct of http-walker.c. And when we clean up that parent
struct, it sanity-checks the embedded struct to make sure we are not
leaking descriptors. Which means a use-after-free if we simply free()
the embedded struct.

I have no idea how valuable that sanity-check is, or whether it can
simply be deleted. This all goes back to 5424bc557f (http*: add helper
methods for fetching objects (loose), 2009-06-06). But the obvious way
to make it all work is to be sure we set the pointer to NULL after
freeing it (and our freeing process closes the descriptor, so we know
there is no leak).

To make sure we do that consistently, we'll switch the pointer we take
in release_http_object_request() to a pointer-to-pointer, and we'll set
it to NULL ourselves. And then the compiler can help us find each caller
which needs to be updated.

Most cases will just pass "&amp;obj_req-&gt;req", which will obviously do the
right thing. In a few cases, like http-push's finish_request(), we are
working with a copy of the pointer, so we don't NULL the original. But
it's OK because the next step is to free the struct containing the
original pointer anyway.

This lets us mark t5551 as leak-free. Ironically this is the "smart"
http test, and the leak here only affects dumb http. But there's a
single dumb-http invocation in there. The full dumb tests are in t5550,
which still has some more leaks.

This also makes t5559 leak-free, as it's just an HTTP/2 variant of
t5551. But we don't need to mark it as such, since it inherits the flag
from t5551.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http: add support for authtype and credential</title>
<updated>2024-04-17T05:39:07Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2024-04-17T00:02:32Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=ad9bb6dfe6e598d87ffe6e2285b4b86dac3bc726'/>
<id>urn:sha1:ad9bb6dfe6e598d87ffe6e2285b4b86dac3bc726</id>
<content type='text'>
Now that we have the credential helper code set up to handle arbitrary
authentications schemes, let's add support for this in the HTTP code,
where we really want to use it.  If we're using this new functionality,
don't set a username and password, and instead set a header wherever
we'd normally do so, including for proxy authentication.

Since we can now handle this case, ask the credential helper to enable
the appropriate capabilities.

Finally, if we're using the authtype value, set "Expect: 100-continue".
Any type of authentication that requires multiple rounds (such as NTLM
or Kerberos) requires a 100 Continue (if we're larger than
http.postBuffer) because otherwise we send the pack data before we're
authenticated, the push gets a 401 response, and we can't rewind the
stream.  We don't know for certain what other custom schemes might
require this, the HTTP/1.1 standard has required handling this since
1999, the broken HTTP server for which we disabled this (Google's) is
now fixed and has been for some time, and libcurl has a 1-second
fallback in case the HTTP server is still broken.  In addition, it is
not unreasonable to require compliance with a 25-year old standard to
use new Git features.  For all of these reasons, do so here.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http: use new headers for each object request</title>
<updated>2024-04-17T05:39:06Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2024-04-17T00:02:27Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=d01c76f1cfc96ba56f1c7c0e1b051d121ba6cc48'/>
<id>urn:sha1:d01c76f1cfc96ba56f1c7c0e1b051d121ba6cc48</id>
<content type='text'>
Currently we create one set of headers for all object requests and reuse
it.  However, we'll need to adjust the headers for authentication
purposes in the future, so let's create a new set for each request so
that we can adjust them if the authentication changes.

Note that the cost of allocation here is tiny compared to the fact that
we're making a network call, not to mention probably a full TLS
connection, so this shouldn't have a significant impact on performance.
Moreover, nobody who cares about performance is using the dumb HTTP
protocol anyway, since it often makes huge numbers of requests compared
to the smart protocol.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http.h: remove unnecessary include</title>
<updated>2023-12-26T20:04:32Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-12-23T17:14:54Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=f25e65e0fea5cc45559079d9a84386efe2eb0c0c'/>
<id>urn:sha1:f25e65e0fea5cc45559079d9a84386efe2eb0c0c</id>
<content type='text'>
The unnecessary include in the header transitively pulled in some
other headers actually needed by source files, though.  Have those
source files explicitly include the headers they need.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
