Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: git/git
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 270e10ad6dda3379ea0da7efd11e4fbf2cd7a325
Choose a base ref
...
head repository: git/git
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 640657ffd06999ec1ec3b1d030b7f5aac6b7f57b
Choose a head ref
  • 3 commits
  • 16 files changed
  • 1 contributor

Commits on Mar 17, 2026

  1. strbuf: pass correct alloc to strbuf_attach() in strbuf_reencode()

    reencode_string_len() allocates len+1 bytes (including the NUL) and
    returns the string length in len. strbuf_reencode() was calling
    strbuf_attach(sb, out, len, len), so alloc was one byte too small.
    
    strbuf_attach() then calls strbuf_grow(sb, 0). With alloc < len+1,
    ALLOC_GROW always reallocates, so we reallocated immediately after
    attach even when the strbuf was not extended further. Pass len+1 as
    the alloc argument so the existing buffer is reused and the
    reallocation is avoided.
    
    Signed-off-by: Vaidas Pilkauskas <vaidas.pilkauskas@shopify.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    vaidas-shopify authored and gitster committed Mar 17, 2026
    Configuration menu
    Copy the full SHA
    bc6a6cf View commit details
    Browse the repository at this point in the history
  2. strbuf_attach: fix call sites to pass correct alloc

    strbuf_attach(sb, buf, len, alloc) requires alloc > len (the buffer
    must have at least len+1 bytes to hold the NUL). Several call sites
    passed alloc == len, relying on strbuf_grow(sb, 0) inside strbuf_attach
    to reallocate. Fix these in mailinfo, am, refs/files-backend,
    fast-import, and trailer by passing len+1 when the buffer is a
    NUL-terminated string (or from strbuf_detach).
    
    Signed-off-by: Vaidas Pilkauskas <vaidas.pilkauskas@shopify.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    vaidas-shopify authored and gitster committed Mar 17, 2026
    Configuration menu
    Copy the full SHA
    a4fddb0 View commit details
    Browse the repository at this point in the history
  3. http: add support for HTTP 429 rate limit retries

    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 <vaidas.pilkauskas@shopify.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    vaidas-shopify authored and gitster committed Mar 17, 2026
    Configuration menu
    Copy the full SHA
    640657f View commit details
    Browse the repository at this point in the history
Loading