Warn when --show-all is used with no files listed

At least one contributor thought that --show-all would show all owners
for the current CL, so they used it with no files specified and got
confused by the lack of output. I was fooled to. The message printed
by "git cl help owners" makes it clear but it seems worth detecting the
no-files case and printing a helpful message, especially since most
(all?) of the other git cl owners commands apply to the current CL.

Bug: 1071967
Change-Id: I77bd2e30a3b3a6eb67cd40b93f5544b20facacb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2183219
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
changes/19/2183219/3
Bruce Dawson 5 years ago committed by LUCI CQ
parent 4de54135e8
commit 97ed44ada9

@ -4653,6 +4653,9 @@ def CMDowners(parser, args):
author = cl.GetAuthor()
if options.show_all:
if len(args) == 0:
print('No files specified for --show-all. Nothing to do.')
return 0
for arg in args:
base_branch = cl.GetCommonAncestorWithUpstream()
database = owners.Database(settings.GetRoot(), open, os.path)

Loading…
Cancel
Save