From 06a0ef3f440c498196bd22d14c79287e38f19a7f Mon Sep 17 00:00:00 2001 From: Preetam Dwivedi Date: Wed, 30 Sep 2026 11:04:12 -0700 Subject: [PATCH] Remove ineffective arbitrary-want setting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary ### Why? Partial-clone lazy fetches require direct object wants, while the configuration claimed they could be disabled even though both upload-pack engines always accepted them. ### What? Remove the inert `git.allow_any_sha1_in_want` option and update tests and integrity documentation to describe arbitrary object wants as part of partial-clone support. ## Test Plan ⚠️ Rust tests were not run because `cargo` is unavailable in this environment; `git diff --check` passes. ## Issue Closes #77 --- crates/walgit-config/src/lib.rs | 2 -- crates/walgit-server/tests/e2e.rs | 2 +- crates/walgit-server/tests/maintain.rs | 1 - docs/INTEGRITY.md | 2 +- walgit.example.toml | 1 - 5 files changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/walgit-config/src/lib.rs b/crates/walgit-config/src/lib.rs index e3cdaf15..80f0ec86 100644 --- a/crates/walgit-config/src/lib.rs +++ b/crates/walgit-config/src/lib.rs @@ -569,7 +569,6 @@ pub struct GitConfig { pub binary: PathBuf, pub upload_pack_engine: UploadPackEngine, pub allow_filter: bool, - pub allow_any_sha1_in_want: bool, /// Default object format for new repos. pub object_format: ObjectFormat, /// Maintain a split commit-graph chain per local repo: tier-2 packs that @@ -927,7 +926,6 @@ impl Default for GitConfig { binary: PathBuf::from("git"), upload_pack_engine: UploadPackEngine::Auto, allow_filter: true, - allow_any_sha1_in_want: false, object_format: ObjectFormat::Sha1, commit_graph: true, commit_graph_changed_paths: false, diff --git a/crates/walgit-server/tests/e2e.rs b/crates/walgit-server/tests/e2e.rs index e37eea27..b7cc4441 100644 --- a/crates/walgit-server/tests/e2e.rs +++ b/crates/walgit-server/tests/e2e.rs @@ -1447,7 +1447,7 @@ async fn push_from_a_shallow_clone() -> TestResult { /// `allow-any-sha1-in-want`), plus `--depth` + filter together. #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn partial_clone_tree_zero_and_depth_with_filter() -> TestResult { - let server = Server::start_with_tweak(|c| c.git.allow_any_sha1_in_want = true).await?; + let server = Server::start().await?; server.put_repo("t", "tree0").await?; let src = TestRepo::synthetic(5, 4)?; git_in( diff --git a/crates/walgit-server/tests/maintain.rs b/crates/walgit-server/tests/maintain.rs index 70242f34..c48d9329 100644 --- a/crates/walgit-server/tests/maintain.rs +++ b/crates/walgit-server/tests/maintain.rs @@ -330,7 +330,6 @@ async fn fsck_unit_records_missing_objects_and_repair_unit_fetches_them_from_ups let server = step!( "start", Server::start_with_tweak(|c| { - c.git.allow_any_sha1_in_want = true; c.maintenance.checkpoints = false; c.packs.enabled = false; c.maintenance.fsck_interval = std::time::Duration::from_hours(1); diff --git a/docs/INTEGRITY.md b/docs/INTEGRITY.md index 142a1982..62911d50 100644 --- a/docs/INTEGRITY.md +++ b/docs/INTEGRITY.md @@ -33,7 +33,7 @@ Due right after checkpoint when `fsck.pb` lists missing objects, `repaired_seq = **`upstream.git`** (D24 setting, `[upstream] git = "https://github.com/acme/monorepo.git"`, `token_env` shared with `upstream.lfs`, `docs/LFS.md`). Steps (`walgit_git::repair::fetch_objects_as_pack`): scratch bare repo under `cache.dir/repair/`, `git fetch --depth=1 …` in batches of 500 (GitHub serves commit, tree **and -blob** wants by SHA — verified 2026-08-21; walgit does with `git.allow_any_sha1_in_want`), `pack-objects` of exactly +blob** wants by SHA — verified 2026-08-21; walgit enables arbitrary object wants for partial-clone lazy fetches), `pack-objects` of exactly the requested oids, verify every oid is in the resulting idx (a refused want is an error, never a silent hole), then `RepoHandle::add_pack(tier 0)` → one **COMPACT entry superseding nothing** (what `walgit wal add-pack … --tier 0` did by hand for a large repository, seq 11). `fsck.pb.repaired_seq` is set so the next pass re-audits instead of repairing diff --git a/walgit.example.toml b/walgit.example.toml index 79584aa9..bfa570c2 100644 --- a/walgit.example.toml +++ b/walgit.example.toml @@ -182,7 +182,6 @@ max_object_bytes = "16GiB" binary = "git" # path to upstream git binary (>= 2.47 recommended: pack.writeReverseIndex) upload_pack_engine = "auto" # "auto" = stock git when packs are local/mount-linked, gix only for remote-served bases | "git" | "gix" allow_filter = true # uploadpack.allowFilter -allow_any_sha1_in_want = false # uploadpack.allowAnySHA1InWant object_format = "sha1" # default for new repos: "sha1" | "sha256" commit_graph = true # maintain a split commit-graph chain per repo (tier-2 layer from the WAL + incremental) history_pack = true # base rebuild also publishes commits+trees as a local "history pack"