From f25eea8cc3b940cbcaa96224485826bfaae82449 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 12 Jan 2026 10:57:50 +0000 Subject: fix: fetch full git history instead of shallow clones Previously, purgatory sync was using '--depth=1' when fetching OIDs from remote servers. This created shallow clones with only 1-2 commits instead of the complete git history. The fix removes the '--depth=1' flag, allowing git to fetch the complete commit history chain when fetching specific commit OIDs. This is the correct behavior for GRASP - users cloning from our relay should get the full repository history. Changes: - Remove '--depth=1' from git fetch command in RealSyncContext::fetch_oids - Update comment to clarify that full history is fetched Impact: - Production repositories will now contain full git history - Users cloning from the relay will get complete commit chains - No more 'shallow' files in git repositories - May be slightly slower due to fetching more data, but correctness is prioritized Testing: - All 564 tests pass (276 unit + 288 integration) - No regressions in existing functionality Fixes issue documented in work/active-issues/shallow-git-fetch.md --- src/purgatory/sync/context.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/purgatory/sync/context.rs') diff --git a/src/purgatory/sync/context.rs b/src/purgatory/sync/context.rs index 3c2c683..f41dc25 100644 --- a/src/purgatory/sync/context.rs +++ b/src/purgatory/sync/context.rs @@ -361,8 +361,8 @@ impl SyncContext for RealSyncContext { let naughty_list = self.git_naughty_list.clone(); tokio::task::spawn_blocking(move || -> Result> { - // git fetch ... - fetch all OIDs in one command - let mut args = vec!["fetch", "--depth=1", &url]; + // git fetch ... - fetch all OIDs with full history + let mut args = vec!["fetch", &url]; args.extend(missing_oids.iter().map(|s| s.as_str())); let output = Command::new("git") -- cgit v1.2.3