
The /projects/ URL now accepts a prefix string as part of the URL, making it usable by the suggestion client UI to limit results. With this change, the project suggestion service can be removed and replaced by the REST API. "GET /projects/platform/" will list all projects that start with the specified platform/ prefix. Change-Id: I6f8b9302166f59d03d58a85292cbf052e8419a78
142 lines
3.7 KiB
Plaintext
142 lines
3.7 KiB
Plaintext
gerrit ls-projects
|
|
==================
|
|
|
|
NAME
|
|
----
|
|
gerrit ls-projects - List projects visible to caller
|
|
|
|
SYNOPSIS
|
|
--------
|
|
[verse]
|
|
'ssh' -p <port> <host> 'gerrit ls-projects'
|
|
[--show-branch <BRANCH> ...]
|
|
[--tree]
|
|
[--type {code | permissions | all}]
|
|
|
|
DESCRIPTION
|
|
-----------
|
|
Displays the list of project names, one per line, that the
|
|
calling user account has been granted 'READ' access to.
|
|
|
|
If the caller is a member of the privileged 'Administrators'
|
|
group, all projects are listed.
|
|
|
|
ACCESS
|
|
------
|
|
Any user who has configured an SSH key, or by an user over HTTP.
|
|
|
|
SCRIPTING
|
|
---------
|
|
This command is intended to be used in scripts.
|
|
|
|
OPTIONS
|
|
-------
|
|
--show-branch::
|
|
-b::
|
|
Branch for which the command will display the sha of each project.
|
|
The command may have multiple --show-branch parameters, in this case
|
|
sha will be shown for each of the branches.
|
|
If the user does not have READ access to some branch or the branch does not
|
|
exist then stub (40 `-` symbols) is shown.
|
|
If the user does not have access to any branch in the project then the
|
|
whole project is not shown.
|
|
|
|
--description::
|
|
--d::
|
|
Allows listing of projects together with their respective
|
|
description.
|
|
+
|
|
Line-feeds are escaped to allow ls-project to keep the
|
|
"one project per line"-style.
|
|
|
|
--tree::
|
|
-t::
|
|
Displays project inheritance in a tree-like format.
|
|
This option does not work together with the show-branch option.
|
|
|
|
--type::
|
|
Display only projects of the specified type. If not
|
|
specified, defaults to `code`. Supported types:
|
|
+
|
|
--
|
|
`code`:: Any project likely to contain user files.
|
|
`permissions`:: Projects created with the `--permissions-only` flag.
|
|
`all`:: Any type of project.
|
|
--
|
|
|
|
--format::
|
|
What output format to display the results in.
|
|
+
|
|
--
|
|
`text`:: Simple text based format.
|
|
`json`:: Map of JSON objects describing each project.
|
|
`json_compact`:: Minimized JSON output.
|
|
--
|
|
|
|
--all::
|
|
Display all projects that are accessible by the calling user
|
|
account. Besides the projects that the calling user account has
|
|
been granted 'READ' access to, this includes all projects that
|
|
are owned by the calling user account (even if for these projects
|
|
the 'READ' access right is not assigned to the calling user
|
|
account).
|
|
|
|
--limit::
|
|
Cap the number of results to the first N matches.
|
|
|
|
HTTP
|
|
----
|
|
This command is also available over HTTP, as `/projects/` for
|
|
anonymous access and `/a/projects/` for authenticated access.
|
|
Named options are available as query parameters. Results can
|
|
be limited to projects matching a prefix by supplying the prefix
|
|
as part of the URL, for example `/projects/external/` lists only
|
|
projects whose name start with the string `external/`.
|
|
|
|
Over HTTP the `json_compact` output format is assumed if the client
|
|
explicitly asks for JSON using HTTP header `Accept: application/json`.
|
|
When any JSON output format is used on HTTP, readers must skip the
|
|
first line produced. The first line is a garbage JSON string crafted
|
|
to prevent a browser from executing the response in a script tag.
|
|
|
|
Output will be gzip compressed if `Accept-Encoding: gzip` was used
|
|
by the client in the request headers.
|
|
|
|
EXAMPLES
|
|
--------
|
|
|
|
List visible projects:
|
|
=====
|
|
$ ssh -p 29418 review.example.com gerrit ls-projects
|
|
platform/manifest
|
|
tools/gerrit
|
|
tools/gwtorm
|
|
|
|
$ curl http://review.example.com/projects/
|
|
platform/manifest
|
|
tools/gerrit
|
|
tools/gwtorm
|
|
|
|
$ curl http://review.example.com/projects/tools/
|
|
tools/gerrit
|
|
tools/gwtorm
|
|
=====
|
|
|
|
Clone any project visible to the user:
|
|
====
|
|
for p in `ssh -p 29418 review.example.com gerrit ls-projects`
|
|
do
|
|
mkdir -p `dirname "$p"`
|
|
git clone --bare "ssh://review.example.com:29418/$p.git" "$p.git"
|
|
done
|
|
====
|
|
|
|
SEE ALSO
|
|
--------
|
|
|
|
* link:access-control.html[Access Controls]
|
|
|
|
GERRIT
|
|
------
|
|
Part of link:index.html[Gerrit Code Review]
|