Summarize number of commits being processed by `git cl upload`.
Occasionally, users can get a branch into a state where `git cl upload` takes a long time because it is operating on an unexpectedly large diff. One way where this can happen is when the local view of origin/main is behind and someone force-patches in a CL based on a newer origin/main: git cl upload will happily consider all the origin/main commits it does not have in its local view of origin/main to simply be part of the diff. As this is a rather frustrating user experience, make it a bit easier to realize when this sort of thing is happening by summarizing the number of commits `git cl upload` is processing. One alternative would be to stats about the diff; however, calculating the number of commits is considerably faster than calculating the actual diff. A quick local test shows that calculating the diff for 10k commits takes nearly 20 seconds, while calculating the number of commits takes a 150 milliseconds. Change-Id: I0e8706f164f6bf669f36f4792401589644be38b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4819796 Commit-Queue: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Gavin Mak <gavinmak@google.com>changes/96/4819796/7
parent
095f92db7d
commit
66d0f15a56
Loading…
Reference in New Issue