diff options
| author | Gavin Mak <gavinmak@google.com> | 2026-05-07 23:30:54 +0000 |
|---|---|---|
| committer | gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2026-05-08 14:12:22 -0700 |
| commit | 5d8585012f384d1e2566f9c0b7ad7c0efcc5edd2 (patch) | |
| tree | 8d296b545532a89b209824e08cfa4157e7eaac9c /subcmds/sync.py | |
| parent | e8deeabf2a4bacf6530aa4dc23478e4dd2fb0942 (diff) | |
| download | git-repo-5d8585012f384d1e2566f9c0b7ad7c0efcc5edd2.tar.gz | |
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 <beckysiegel@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Tested-by: Gavin Mak <gavinmak@google.com>
Diffstat (limited to 'subcmds/sync.py')
| -rw-r--r-- | subcmds/sync.py | 4 |
1 files 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. | |||
| 2151 | for project_name in sorted(self._bloated_projects): | 2151 | for project_name in sorted(self._bloated_projects): |
| 2152 | warn_msg = ( | 2152 | warn_msg = ( |
| 2153 | f'warning: Project "{project_name}" is accumulating ' | 2153 | f'warning: Project "{project_name}" is accumulating ' |
| 2154 | 'unoptimized data. Please run "repo sync --auto-gc" or ' | 2154 | 'unoptimized data. Please run "git repack -a -d" in the ' |
| 2155 | '"repo gc --repack" to clean up.' | 2155 | 'project directory or "repo gc --repack" to clean up.' |
| 2156 | ) | 2156 | ) |
| 2157 | self.git_event_log.ErrorEvent(warn_msg) | 2157 | self.git_event_log.ErrorEvent(warn_msg) |
| 2158 | logger.warning(warn_msg) | 2158 | logger.warning(warn_msg) |
