<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/http.c, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2026-04-09T18:21:59Z</updated>
<entry>
<title>Merge branch 'jk/c23-const-preserving-fixes-more'</title>
<updated>2026-04-09T18:21:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-04-09T18:21:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3eabc358a940e5ac2e0cb161957a51f3e2a5a3a0'/>
<id>urn:sha1:3eabc358a940e5ac2e0cb161957a51f3e2a5a3a0</id>
<content type='text'>
Further work to adjust the codebase for C23 that changes functions
like strchr() that discarded constness when they return a pointer into
a const string to preserve constness.

* jk/c23-const-preserving-fixes-more:
  git-compat-util: fix CONST_OUTPARAM typo and indentation
  refs/files-backend: drop const to fix strchr() warning
  http: drop const to fix strstr() warning
  range-diff: drop const to fix strstr() warnings
  pkt-line: make packet_reader.line non-const
  skip_prefix(): check const match between in and out params
  pseudo-merge: fix disk reads from find_pseudo_merge()
  find_last_dir_sep(): convert inline function to macro
  run-command: explicitly cast away constness when assigning to void
  pager: explicitly cast away strchr() constness
  transport-helper: drop const to fix strchr() warnings
  http: add const to fix strchr() warnings
  convert: add const to fix strchr() warnings
</content>
</entry>
<entry>
<title>http: drop const to fix strstr() warning</title>
<updated>2026-04-02T05:08:53Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2026-04-02T04:15:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8a0566b42b133b73423c801a7ab6f356de69f51a'/>
<id>urn:sha1:8a0566b42b133b73423c801a7ab6f356de69f51a</id>
<content type='text'>
In redact_sensitive_header(), a C23 implementation of libc will complain
that strstr() assigns the result from "const char *cookie" to "char
*semicolon".

Ultimately the memory is writable. We're fed a strbuf, generate a const
pointer "sensitive_header" within it using skip_iprefix(), and then
assign the result to "cookie".  So we can solve this by dropping the
const from "cookie" and "sensitive_header".

However, this runs afoul of skip_iprefix(), which wants a "const char
**" for its out-parameter. We can solve that by teaching skip_iprefix()
the same "make sure out is at least as const as in" magic that we
recently taught to skip_prefix().

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>Merge branch 'vp/http-rate-limit-retries'</title>
<updated>2026-04-01T17:28:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-04-01T17:28:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0a39ec283cadafeae5f542a26569e4cec6f36fae'/>
<id>urn:sha1:0a39ec283cadafeae5f542a26569e4cec6f36fae</id>
<content type='text'>
The HTTP transport learned to react to "429 Too Many Requests".

* vp/http-rate-limit-retries:
  http: add support for HTTP 429 rate limit retries
  strbuf_attach: fix call sites to pass correct alloc
  strbuf: pass correct alloc to strbuf_attach() in strbuf_reencode()
</content>
</entry>
<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='https://git.shady.money/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>odb: embed base source in the "files" backend</title>
<updated>2026-03-05T19:45:15Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-05T14:19:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d9ecf268ef3f69130fa269012318470d908978f6'/>
<id>urn:sha1:d9ecf268ef3f69130fa269012318470d908978f6</id>
<content type='text'>
The "files" backend is implemented as a pointer in the `struct
odb_source`. This contradicts our typical pattern for pluggable backends
like we use it for example in the ref store or for object database
streams, where we typically embed the generic base structure in the
specialized implementation. This pattern has a couple of small benefits:

  - We avoid an extra allocation.

  - We hide implementation details in the generic structure.

  - We can easily downcast from a generic backend to the specialized
    structure and vice versa because the offsets are known at compile
    time.

  - It becomes trivial to identify locations where we depend on backend
    specific logic because the cast needs to be explicit.

Refactor our "files" object database source to do the same and embed the
`struct odb_source` in the `struct odb_source_files`.

There are still a bunch of sites in our code base where we do have to
access internals of the "files" backend. The intent is that those will
go away over time, but this will certainly take a while. Meanwhile,
provide a `odb_source_files_downcast()` function that can convert a
generic source into a "files" source.

As we only have a single source the downcast succeeds unconditionally
for now. Eventually though the intent is to make the cast `BUG()` in
case the caller requests to downcast a non-"files" backend to a "files"
backend.

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>odb: introduce "files" source</title>
<updated>2026-03-05T19:45:14Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-05T14:19:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cb506a8a69c953f7b87bb3ae099e0bed8218d3ab'/>
<id>urn:sha1:cb506a8a69c953f7b87bb3ae099e0bed8218d3ab</id>
<content type='text'>
Introduce a new "files" object database source. This source encapsulates
access to both loose object files and the packfile store, similar to how
the "files" backend for refs encapsulates access to loose refs and the
packed-refs file.

Note that for now the "files" source is still a direct member of a
`struct odb_source`. This architecture will be reversed in the next
commit so that the files source contains a `struct odb_source`.

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>packfile: move packfile store into object source</title>
<updated>2026-01-09T14:40:07Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-01-09T08:33:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=84f0e60b28de69d1ccb7a51b729af6202b6cf4c8'/>
<id>urn:sha1:84f0e60b28de69d1ccb7a51b729af6202b6cf4c8</id>
<content type='text'>
The packfile store is a member of `struct object_database`, which means
that we have a single store per database. This doesn't really make much
sense though: each source connected to the database has its own set of
packfiles, so there is a conceptual mismatch here. This hasn't really
caused much of a problem in the past, but with the advent of pluggable
object databases this is becoming more of a problem because some of the
sources may not even use packfiles in the first place.

Move the packfile store down by one level from the object database into
the object database source. This ensures that each source now has its
own packfile store, and we can eventually start to abstract it away
entirely so that the caller doesn't even know what kind of store it
uses.

Note that we only need to adjust a relatively small number of callers,
way less than one might expect. This is because most callers are using
`repo_for_each_pack()`, which handles enumeration of all packfiles that
exist in the repository. So for now, none of these callers need to be
adapted. The remaining callers that iterate through the packfiles
directly and that need adjustment are those that are a bit more tangled
with packfiles. These will be adjusted over time.

Note that this patch only moves the packfile store, and there is still a
bunch of functions that seemingly operate on a packfile store but that
end up iterating over all sources. These will be adjusted in subsequent
commits.

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: 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='https://git.shady.money/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>packfile: introduce macro to iterate through packs</title>
<updated>2025-10-16T21:42:39Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-10-09T08:01:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=86d8c62f48a1b193299de19c4dbc664650a853f1'/>
<id>urn:sha1:86d8c62f48a1b193299de19c4dbc664650a853f1</id>
<content type='text'>
We have a bunch of different sites that want to iterate through all
packs of a given `struct packfile_store`. This pattern is somewhat
verbose and repetitive, which makes it somewhat cumbersome.

Introduce a new macro `repo_for_each_pack()` that removes some of the
boilerplate.

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 'ps/packfile-store' into tb/incremental-midx-part-3.1</title>
<updated>2025-09-29T16:31:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-09-29T16:31:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9fab7ec7ff80707e703f16636200be8bbde204ca'/>
<id>urn:sha1:9fab7ec7ff80707e703f16636200be8bbde204ca</id>
<content type='text'>
* ps/packfile-store:
  packfile: refactor `get_packed_git_mru()` to work on packfile store
  packfile: refactor `get_all_packs()` to work on packfile store
  packfile: refactor `get_packed_git()` to work on packfile store
  packfile: move `get_multi_pack_index()` into "midx.c"
  packfile: introduce function to load and add packfiles
  packfile: refactor `install_packed_git()` to work on packfile store
  packfile: split up responsibilities of `reprepare_packed_git()`
  packfile: refactor `prepare_packed_git()` to work on packfile store
  packfile: reorder functions to avoid function declaration
  odb: move kept cache into `struct packfile_store`
  odb: move MRU list of packfiles into `struct packfile_store`
  odb: move packfile map into `struct packfile_store`
  odb: move initialization bit into `struct packfile_store`
  odb: move list of packfiles into `struct packfile_store`
  packfile: introduce a new `struct packfile_store`
</content>
</entry>
</feed>
