From 5d8585012f384d1e2566f9c0b7ad7c0efcc5edd2 Mon Sep 17 00:00:00 2001 From: Gavin Mak Date: Thu, 7 May 2026 23:30:54 +0000 Subject: [PATCH] sync: Suggest "git repack -a -d" in bloat warning The warning suggests running "repo sync --auto-gc" which runs "git gc --auto". Git may decide not to repack if its internal thresholds are not met, leaving the warning active even after running the suggested command. "git repack -a -d" forces all reachable objects into a single pack and deletes redundant packs, reducing the pack count to 1. This guarantees that the warning (which triggers when pack count exceeds 10) goes away. Bug: 505755299 Change-Id: I10163ef8efb7f3b7c5055378ad95051974d11b88 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/580821 Reviewed-by: Becky Siegel Commit-Queue: Gavin Mak Tested-by: Gavin Mak --- subcmds/sync.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subcmds/sync.py b/subcmds/sync.py index 7e7a2d3c0..5aec277a0 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -2151,8 +2151,8 @@ later is required to fix a server side protocol bug. for project_name in sorted(self._bloated_projects): warn_msg = ( f'warning: Project "{project_name}" is accumulating ' - 'unoptimized data. Please run "repo sync --auto-gc" or ' - '"repo gc --repack" to clean up.' + 'unoptimized data. Please run "git repack -a -d" in the ' + 'project directory or "repo gc --repack" to clean up.' ) self.git_event_log.ErrorEvent(warn_msg) logger.warning(warn_msg)