Files
git-repo/docs
Gavin Mak af53524261 sync: sort interleaved sync slowest-first
Phased sync orders each fetch batch slowest-first using
`.repo_fetchtimes.json`, whereas interleaved sync dispatched each
hierarchical level in path order, letting slow projects near the end of
a level start late and extend the tail of the sync.

Combining fetch and checkout times into `.repo_fetchtimes.json` would
mix units with phased mode and older repo versions, and cause `-n` or
`-l` runs to either skew full-sync estimates or sort by the wrong
phase.

Keep fetch and checkout estimates separate instead:

- Parameterize `_SyncTimes` by filename and track fetch durations in
  `.repo_fetchtimes.json` and checkout durations in
  `.repo_checkouttimes.json`, recording a phase only when it succeeds.
- Sort each interleaved level slowest-first by the phases active in
  `opt` (fetch when not `-l`, checkout when not `-n` and the project
  has a worktree).
- Sort each `_SafeCheckoutOrder` level in phased `_Checkout` by
  `_checkout_times` and save in `finally` so phased and interleaved
  runs maintain and use the same per-phase estimates.

Bug: 543101585
Change-Id: Ie8b15a95ab2d8019b058d5f839a93501d0d85979
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/657085
Tested-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Brian Gan <brgan@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2026-11-13 13:44:18 -08:00
..
2026-05-14 09:03:56 -07:00