| Issue 1947: | Project-specific labels are not support on CLI | |
| 1 person starred this issue and may be notified of changes. | Back to list |
************************************************************ ***** NOTE: THIS BUG TRACKER IS FOR GERRIT CODE REVIEW ***** ***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, INTERNAL ***** ***** ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC. ***** ***** THOSE ISSUE BELONG IN DIFFERENT ISSUE TRACKERS! ***** ************************************************************ Affected Version: 2.6 What steps will reproduce the problem? 1. Define a project-specific label named 'foo' 2. Run 'ssh server gerrit review --foo 1 <commit>' What is the expected output? What do you see instead? It should work, it doesn't :) Please provide any additional information below. If the label is declared in All-Projects it does work
Jul 24, 2013
Project Member
#1
bruce.zu@sonymobile.com
Jul 24, 2013
fatal: "--foo" is not a valid option
Jul 24, 2013
Custom label values are specified with --label=foo=+1,bar=-1; see --help.
Status:
WontFix
Jul 24, 2013
This is confusing. Is there a reason not to support custom labels with global flags?
Jul 24, 2013
For one thing, nothing is stopping you creating a label like "Help" that would conflict with existing flags. (For another the way we do flag parsing makes this annoying, but that could be overridden by a strong usability concern.)
Jul 24, 2013
1. The same is true for labels in All-Projects, yet you do support it. 2. This affects many scripts which are already using the "old" way. trivial-rebase.py is one example (should now be adapted), gerrit-trigger is another. Those are just the few I use, but I'm sure there are more out there.
Jul 24, 2013
Re. usability, please also have a look in https://code.google.com/p/gerrit/issues/detail?id=2033
Jul 25, 2013
--code-review and --verified should still work (see below). I'm not sure what you mean by (1). We don't have any restrictions on label names. This means if we map label names to flag names they might conflict with other flag names. So we need to have some way of specifying label values for conflicting names, hence the --label flag.
$ ssh -p 29418 localhost gerrit version
gerrit version 2.7-rc3-966-g89c3c58
$ ssh -p 29418 localhost gerrit review --help
gerrit review {COMMIT | CHANGE,PATCHSET} ... [--] [--abandon] [--delete] [--help (-h)] [--label (-l) LABEL=VALUE] [--message (-m) MESSAGE] [--project (-p) PROJECT] [--publish] [--restore] [--submit (-s)] [--verified N] [--code-review N]
{COMMIT | CHANGE,PATCHSET} : list of commits or patch sets to review
-- : end of options
--abandon : abandon the specified change(s)
--delete : delete the specified draft patch set(s)
--help (-h) : display this help text
--label (-l) LABEL=VALUE : custom label(s) to assign
--message (-m) MESSAGE : cover message to publish on change(s)
--project (-p) PROJECT : project containing the specified patch set(s)
--publish : publish the specified draft patch set(s)
--restore : restore the specified abandoned change(s)
--submit (-s) : submit the specified patch set(s)
--verified N : score for Verified
-1 Fails
0 No score
+1 Verified
--code-review N : score for Code-Review
-2 Do not submit
-1 I would prefer that you didn't submit this
0 No score
+1 Looks good to me, but someone else must approve
+2 Looks good to me, approved
$ ssh -p 29418 localhost gerrit review --code-review -1 43293,1
$ ssh -p 29418 localhost gerrit review --verified -1 43293,1
Jul 25, 2013
verified works because it is declared in All-Projects. Any label you declare there provides a "global" flag (with lowercase dash-separated name). This isn't true for project-specific flags. That's exactly the reported bug. (1) referred to declaring Help label. If you declare it in All-Projects you'll have --help N (unless you actually test it?) |
|
| ► Sign in to add a comment |