Commit Graph

2 Commits (b084cd665f2fc959c808423cf1978a62f042c18e)

Author SHA1 Message Date
Gavin Mak b084cd665f Fix CheckForCommitObjects to check missing gitlink changes
https://crrev.com/c/7234371 made some optimizations to the check
but caused it to start missing changes that modified DEPS but not
the corresponding gitlink.

Fix the check by doing a full tree scan when DEPS is updated.

Bug: 469784282
Change-Id: Ibdcdcb1af5a330e4d9e96daecd28e06bc1436022
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7362007
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josiah Kiehl <kiehl@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
1 week ago
Josiah Kiehl 7c09ebfd12 Optimize CheckForCommitObjects by batching `git ls-tree` operations
Significantly reduces the execution time of presubmit checks by
optimizing CheckForCommitObjects.

For CLs with fewer than 1000 affected files, run `git ls-tree` only on
specific files instead of scanning the full tree. This yields a ~70x
speedup (~0.97s -> ~0.01s) for typical CLs.

Change-Id: Ia8b89dbb14a5129ba79944282deba52a3558bdf2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7234371
Commit-Queue: Josiah Kiehl <kiehl@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
1 month ago