diff options
Diffstat (limited to 'Documentation/cmd-query.txt')
-rw-r--r-- | Documentation/cmd-query.txt | 63 |
1 files changed, 45 insertions, 18 deletions
diff --git a/Documentation/cmd-query.txt b/Documentation/cmd-query.txt index c8996ebd24..253bed18cc 100644 --- a/Documentation/cmd-query.txt +++ b/Documentation/cmd-query.txt @@ -8,14 +8,18 @@ gerrit query - Query the change database SYNOPSIS -------- [verse] - 'ssh' -p <port> <host> 'gerrit query' \ - [\--format {TEXT | JSON}] \ - [\--current-patch-set] \ - [\--patch-sets|--all-approvals] \ - [\--] \ - <query> \ - [limit:<n>] \ - [resume\_sortkey:<sortKey>] +'ssh' -p <port> <host> 'gerrit query' + [--format {TEXT | JSON}] + [--current-patch-set] + [--patch-sets | --all-approvals] + [--files] + [--comments] + [--commit-message] + [--dependencies] + [--] + <query> + [limit:<n>] + [resume_sortkey:<sortKey>] DESCRIPTION ----------- @@ -39,27 +43,50 @@ multiple levels of quoting required. OPTIONS ------- -\--current-patch-set:: +--format:: + Formatting method for the results. TEXT is the default, + presenting a human readable display. JSON creates one line + per matching record, with embedded LFs escaped. + +--current-patch-set:: Include information about the current patch set in the results. -\--patch-sets:: +--patch-sets:: Include information about all patch sets. If combined with - the \--current-patch-set flag then the current patch set + the --current-patch-set flag then the current patch set information will be output twice, once in each field. -\--all-approvals:: +--all-approvals:: Include information about all patch sets along with the approval information for each patch set. If combined with - the \--current-patch-set flag then the current patch set + the --current-patch-set flag then the current patch set information will be output twice, once in each field. +--files:: + Support for listing files with patch sets and their + attributes (ADDED, MODIFIED, DELETED, RENAMED, COPIED). + Note that this option requires either the --current-patch-set + or the --patch-sets option in order to give any file information. + +--comments:: + Include comments for all changes. If combined with the + --patch-sets flag then all in-line comments are included for + each patch set. + +--commit-message:: + Include the full commit message in the change description. + +--dependencies:: + Show information about patch sets which depend on, or are needed by, + each patch set. + limit:<n>:: Maximum number of results to return. This is actually a query operator, and not a command line option. If more than one limit: operator is provided, the smallest limit will be used to cut the result set. -resume\_sortkey:<sortKey>:: +resume_sortkey:<sortKey>:: Resume results from this sort key. Callers should pass the sortKey of the last change of the prior result set to resume a prior query. This is actually a query operator, @@ -77,20 +104,20 @@ EXAMPLES -------- Find the 2 most recent open changes in the tools/gerrit project: ------ +==== $ ssh -p 29418 review.example.com gerrit query --format=JSON status:open project:tools/gerrit limit:2 {"project":"tools/gerrit", ...} {"project":"tools/gerrit", ..., sortKey:"000e6aee00003e26", ...} {"type":"stats","rowCount":2,"runningTimeMilliseconds:15} ------ +==== Resume the same query and obtain the final results: ------ +==== $ ssh -p 29418 review.example.com gerrit query --format=JSON status:open project:tools/gerrit limit:2 resume_sortkey:000e6aee00003e26 {"project":"tools/gerrit", ...} {"project":"tools/gerrit", ...} {"type":"stats","rowCount":1,"runningTimeMilliseconds:15} ------ +==== SCHEMA |