<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/lib-httpd.sh, 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-04-01T17:28:18Z</updated>
<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='http://git.kilabit.info/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='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>t5550: add netrc tests for http 401/403</title>
<updated>2026-01-08T02:02:39Z</updated>
<author>
<name>Ashlesh Gawande</name>
<email>git@ashlesh.me</email>
</author>
<published>2026-01-07T07:47:24Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=5913fd26aad32bd028a8fe4e5b80fccc28e118af'/>
<id>urn:sha1:5913fd26aad32bd028a8fe4e5b80fccc28e118af</id>
<content type='text'>
git allows using .netrc file to supply credentials for HTTP auth.
Three test cases are added in this patch to provide missing coverage
when cloning over HTTP using .netrc file:

  - First test case checks that the git clone is successful when credentials
    are provided via .netrc file
  - Second test case checks that the git clone fails when the .netrc file
    provides invalid credentials. The HTTP server is expected to return
    401 Unauthorized in such a case. The test checks that the user is
    provided with a prompt for username/password on 401 to provide
    the valid ones.
  - Third test case checks that the git clone fails when the .netrc file
    provides credentials that are valid but do not have permission for
    this user. For example one may have multiple tokens in GitHub
    and uses the one which was not authorized for cloning this repo.
    In such a case the HTTP server returns 403 Forbidden.
    For this test, the apache.conf is modified to return a 403
    on finding a forbidden-user. No prompt for username/password is
    expected after the 403 (unlike 401). This is because prompting may wipe
    out existing credentials or conflict with custom credential helpers.

Signed-off-by: Ashlesh Gawande &lt;git@ashlesh.me&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t/lib-httpd: refactor "one-time-perl" CGI script to not depend on Perl</title>
<updated>2025-04-07T21:47:40Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-04-03T05:06:07Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=cee137b7e53403fe9170c9aeb758fa946b2f0c4c'/>
<id>urn:sha1:cee137b7e53403fe9170c9aeb758fa946b2f0c4c</id>
<content type='text'>
Our Apache HTTPD setup exposes an "one_time_perl" endpoint to access
repositories. If used, we execute the "apply-one-time-perl.sh" CGI
script that checks whether we have a "one-time-perl" script. If so, that
script gets executed so that it can munge what would be served. Once
done, the script gets removed so that it doesn't execute a second time.

As the name says, this functionality expects the user to pass a Perl
script. This isn't really necessary though: we can just as easily
implement the same thing with arbitrary scripts.

Refactor the code so that we instead expect an arbitrary script to
exist and rename the functionality to "one-time-script". Adapt callers
to use shell utilities instead of Perl so that we can drop the
PERL_TEST_HELPERS prerequisite.

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/ci-gitlab'</title>
<updated>2023-12-10T00:37:48Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-12-10T00:37:48Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=14a4445d18eccc146b3340c2bdeeb15c81538938'/>
<id>urn:sha1:14a4445d18eccc146b3340c2bdeeb15c81538938</id>
<content type='text'>
Add support for GitLab CI.

* ps/ci-gitlab:
  ci: add support for GitLab CI
  ci: install test dependencies for linux-musl
  ci: squelch warnings when testing with unusable Git repo
  ci: unify setup of some environment variables
  ci: split out logic to set up failed test artifacts
  ci: group installation of Docker dependencies
  ci: make grouping setup more generic
  ci: reorder definitions for grouping functions
</content>
</entry>
<entry>
<title>t/lib-httpd: dynamically detect httpd and modules path</title>
<updated>2023-11-11T00:00:42Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2023-11-10T08:17:00Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=7d05974d725a68b2498b2b0041e5e1e01c0187ac'/>
<id>urn:sha1:7d05974d725a68b2498b2b0041e5e1e01c0187ac</id>
<content type='text'>
In order to set up the Apache httpd server, we need to locate both the
httpd binary and its default module path. This is done with a hardcoded
list of locations that we scan. While this works okayish with distros
that more-or-less follow the Filesystem Hierarchy Standard, it falls
apart on others like NixOS that don't.

While it is possible to specify these paths via `LIB_HTTPD_PATH` and
`LIB_HTTPD_MODULE_PATH`, it is not a nice experience for the developer
to figure out how to set those up. And in fact we can do better by
dynamically detecting both httpd and its module path at runtime:

    - The httpd binary can be located via PATH.

    - The module directory can (in many cases) be derived via the
      `HTTPD_ROOT` compile-time variable.

Amend the code to do so.

Note that the new runtime-detected paths will only be used as a fallback
in case none of the hardcoded paths are usable. For the PATH lookup this
is because httpd is typically installed into "/usr/sbin", which is often
not included in the user's PATH variable. And the module path detection
relies on a configured httpd installation and may thus not work in all
cases, either.

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>ci: install test dependencies for linux-musl</title>
<updated>2023-11-09T09:56:10Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2023-11-09T08:05:50Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=0d3911ad73514850a79af478d62a94c754892d12'/>
<id>urn:sha1:0d3911ad73514850a79af478d62a94c754892d12</id>
<content type='text'>
The linux-musl CI job executes tests on Alpine Linux, which is based on
musl libc instead of glibc. We're missing some test dependencies though,
which causes us to skip a subset of tests.

Install these test dependencies to increase our test coverage on this
platform. There are still some missing test dependecies, but these do
not have a corresponding package in the Alpine repositories:

    - p4 and p4d, both parts of the Perforce version control system.

    - cvsps, which generates patch sets for CVS.

    - Subversion and the SVN::Core Perl library, the latter of which is
      not available in the Alpine repositories. While the tool itself is
      available, all Subversion-related tests are skipped without the
      SVN::Core Perl library anyway.

The Apache2-based tests require a bit more care though. For one, the
module path is different on Alpine Linux, which requires us to add it to
the list of known module paths to detect it. But second, the WebDAV
module on Alpine Linux is broken because it does not bundle the default
database backend [1]. We thus need to skip the WebDAV-based tests on
Alpine Linux for now.

[1]: https://gitlab.alpinelinux.org/alpine/aports/-/issues/13112

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>tests: teach callers of test_i18ngrep to use test_grep</title>
<updated>2023-11-02T08:13:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-10-31T05:23:30Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=6789275d3780bcb950e6be8557aeedf160d4ad6d'/>
<id>urn:sha1:6789275d3780bcb950e6be8557aeedf160d4ad6d</id>
<content type='text'>
They are equivalents and the former still exists, so as long as the
only change this commit makes are to rewrite test_i18ngrep to
test_grep, there won't be any new bug, even if there still are
callers of test_i18ngrep remaining in the tree, or when merged to
other topics that add new uses of test_i18ngrep.

This patch was produced more or less with

    git grep -l -e 'test_i18ngrep ' 't/t[0-9][0-9][0-9][0-9]-*.sh' |
    xargs perl -p -i -e 's/test_i18ngrep /test_grep /'

and a good way to sanity check the result yourself is to run the
above in a checkout of c4603c1c (test framework: further deprecate
test_i18ngrep, 2023-10-31) and compare the resulting working tree
contents with the result of applying this patch to the same commit.
You'll see that test_i18ngrep in a few t/lib-*.sh files corrected,
in addition to the manual reproduction.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/http-test-cgipassauth-unavailable-in-older-apache'</title>
<updated>2023-05-19T16:27:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-05-19T16:27:07Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=646ca8955861b9e3d4b1d130b15fd59673c3c76b'/>
<id>urn:sha1:646ca8955861b9e3d4b1d130b15fd59673c3c76b</id>
<content type='text'>
We started unconditionally testing with CGIPassAuth directive but
it is unavailable in older Apache that ships with CentOS 7 that has
about a year of shelf-life still left.  The test has conditionally
been disabled when running with an ancient Apache.  This was a fix
for a recent regression caught before the release, so no need to
mention it in the release notes.

* jk/http-test-cgipassauth-unavailable-in-older-apache:
  t/lib-httpd: make CGIPassAuth support conditional
</content>
</entry>
<entry>
<title>t/lib-httpd: make CGIPassAuth support conditional</title>
<updated>2023-05-18T21:29:32Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2023-05-18T19:21:02Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=eb1c42da8e21cc2a8dacd21023a179b788858887'/>
<id>urn:sha1:eb1c42da8e21cc2a8dacd21023a179b788858887</id>
<content type='text'>
Commit 988aad99b4 (t5563: add tests for basic and anoymous HTTP access,
2023-02-27) added tests that require Apache to support the CGIPassAuth
directive, which was added in Apache 2.4.13. This is fairly old (~8
years), but recent enough that we still encounter it in the wild (e.g.,
RHEL/CentOS 7, which is not EOL until June 2024).

We can live with skipping the new tests on such a platform. But
unfortunately, since the directive is used unconditionally in our
apache.conf, it means the web server fails to start entirely, and we
cannot run other HTTP tests at all (e.g., the basic ones in t5551).

We can fix that by making the config conditional, and only triggering it
for t5563. That solves the problem for t5551 (which then ignores the
directive entirely). For t5563, we'd see apache complain in start_httpd;
with the default setting of GIT_TEST_HTTPD, we'd then skip the whole
script.

But that leaves one small problem: people may set GIT_TEST_HTTPD=1
explicitly, which instructs the tests to fail (rather than skip) when we
can't start the webserver (to avoid accidentally missing some tests).

This could be worked around by having the user manually set
GIT_SKIP_TESTS on a platform with an older Apache. But we can be a bit
friendlier by doing the version check ourselves and setting an
appropriate prereq. We'll use the (lack of) prereq to then skip the rest
of t5563. In theory we could use the prereq to skip individual tests, but
in practice this whole script depends on it.

Reported-by: Todd Zullinger &lt;tmz@pobox.com&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
