Skip to content

feat(git): add pack.threads and pack.windowMemory options - #50

Merged
rolandjitsu merged 1 commit into
rolandjitsu:mainfrom
Temikus:feat/upload-pack-pack-options
Oct 17, 2026
Merged

rolandjitsu merged 1 commit into
rolandjitsu:mainfrom
Temikus:feat/upload-pack-pack-options

Conversation

@Temikus

@Temikus Temikus commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

  • fix
  • feat
  • refactor
  • perf
  • docs
  • test
  • build / ci
  • chore

Summary
Point 3 from #45, part 2: --pack-threads and --pack-window-memory, passed to upload-pack as -c pack.threads / -c pack.windowMemory. Unset = git defaults. Independent of #47.

On the GIT_CONFIG_* question: upload-pack inherits the proxy env today, so container-set GIT_CONFIG_* reaches it. Clone and fetch do not get it, because fetch_cmd sets its own GIT_CONFIG_COUNT, which replaces those entries. Nothing guarantees the inheritance, so these flags are the supported way.

Tests

  • Added / updated tests (unit, plus integration where it fits)
  • Not relevant, because: ...

upload_pack_runs_with_pack_options: real git serves a pack with both options set, and the recorded argv carries both -c values. git rejects a bad pack.* value, so the served pack also shows git accepted them.

Checklist

  • CI is green locally: cargo fmt --all --check, cargo clippy --all-targets --all-features --locked -- -D warnings, cargo test --all-features
  • Commits follow Conventional Commits; AI-assisted commits carry an Assisted-by: trailer (see CONTRIBUTING.md / AGENTS.md)
  • Preserves the read-only, pull-only invariant (no push or proactive replication to upstream)
  • Docs / README updated if behavior or flags changed

Breaking change?
No. New flags only; unset keeps current behavior.

@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.97%. Comparing base (d514d1b) to head (a57ed20).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #50      +/-   ##
==========================================
+ Coverage   96.96%   96.97%   +0.01%     
==========================================
  Files           6        6              
  Lines        2208     2218      +10     
==========================================
+ Hits         2141     2151      +10     
  Misses         67       67              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rolandjitsu

Copy link
Copy Markdown
Owner

On the GIT_CONFIG_* question:

Is this saying that the side effect of this change is that the config env vars will not be supported anymore or they weren't anyway before and providing the means to set them via the proxy is the right way?

@rolandjitsu

Copy link
Copy Markdown
Owner

On the GIT_CONFIG_* question:

Is this saying that the side effect of this change is that the config env vars will not be supported anymore or they weren't anyway before and providing the means to set them via the proxy is the right way?

We already set a few others via the proxy, so I guess the flags are the way to go.

@Temikus
Temikus force-pushed the feat/upload-pack-pack-options branch from f28c87d to 2e8aea8 Compare October 15, 2026 05:47
@Temikus Temikus mentioned this pull request Oct 15, 2026
5 of 14 tasks
@Temikus

Temikus commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

@rolandjitsu rebased, but the rustls bump is needed - sent a PR for that as well.

On the GIT_CONFIG_* question:

Is this saying that the side effect of this change is that the config env vars will not be supported anymore or they weren't anyway before and providing the means to set them via the proxy is the right way?

We already set a few others via the proxy, so I guess the flags are the way to go.

You're asking if it takes away the ability of using -c to set options, right?

In that case - no. It doesn't touch environment variables, so the container's GIT_CONFIG_* still reaches upload-pack.

I was just explaining precedence, i.e. if both set the same option, the -c value wins, because git ranks the command line above environment config.

Does this sound reasonable?

@rolandjitsu

Copy link
Copy Markdown
Owner

Does this sound reasonable?

Sounds good. Thanks.

pack-objects memory grows with threads times window size, so a clone
burst on a large repo could OOM the proxy with git's defaults.

Assisted-by: Claude:claude-opus-5-5
@rolandjitsu
rolandjitsu force-pushed the feat/upload-pack-pack-options branch from 2e8aea8 to a57ed20 Compare October 17, 2026 02:14
@rolandjitsu
rolandjitsu merged commit b5e3375 into rolandjitsu:main Oct 17, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants