Commit 97ed44ad authored by Bruce Dawson's avatar Bruce Dawson Committed by LUCI CQ

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/+/2183219Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
parent 4de54135
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment