diff --git a/Documentation/access-control.txt b/Documentation/access-control.txt index 995b1551ce..63d3c93e69 100644 --- a/Documentation/access-control.txt +++ b/Documentation/access-control.txt @@ -421,10 +421,10 @@ draft patch sets of a change into public patch sets for review. To block push permission to `+refs/drafts/*+` the following permission rule can be configured: -==== +---- [access "refs/drafts/*"] push = block group Anonymous Users -==== +---- [[access_categories]] @@ -637,15 +637,15 @@ This category permits users to push an annotated tag object into the project's repository. Typically this would be done with a command line such as: -==== +---- git push ssh://USER@HOST:PORT/PROJECT tag v1.0 -==== +---- Or: -==== +---- git push https://HOST/PROJECT tag v1.0 -==== +---- Tags must be annotated (created with `git tag -a`), should exist in the `refs/tags/` namespace, and should be new. @@ -677,15 +677,15 @@ This category permits users to push a PGP signed tag object into the project's repository. Typically this would be done with a command line such as: -==== +---- git push ssh://USER@HOST:PORT/PROJECT tag v1.0 -==== +---- Or: -==== +---- git push https://HOST/PROJECT tag v1.0 -==== +---- Tags must be signed (created with `git tag -s`), should exist in the `refs/tags/` namespace, and should be new. @@ -1069,10 +1069,10 @@ It is also possible to block label ranges. To block a group 'X' from voting '-2' and '+2', but keep their existing voting permissions for the '-1..+1' range intact we would define: -==== +---- [access "refs/heads/*"] label-Code-Review = block -2..+2 group X -==== +---- The interpretation of the 'min..max' range in case of a blocking rule is: block every vote from '-INFINITE..min' and 'max..INFINITE'. For the example above it @@ -1083,11 +1083,11 @@ means that the range '-1..+1' is not affected by this block. When an access section of a project contains a 'BLOCK' and an 'ALLOW' rule for the same permission then this 'ALLOW' rule overrides the 'BLOCK' rule: -==== +---- [access "refs/heads/*"] push = block group X push = group Y -==== +---- In this case a user which is a member of the group 'Y' will still be allowed to push to 'refs/heads/*' even if it is a member of the group 'X'. @@ -1108,22 +1108,22 @@ This requirement is quite common in a corporate deployment where reproducibility of a build must be guaranteed. To achieve that we block 'push' permission for the <> in "`All-Projects`": -==== +---- [access "refs/tags/*"] push = block group Anonymous Users -==== +---- By blocking the <> we effectively block everyone as everyone is a member of that group. Note that the permission to create a tag is still necessary. Assuming that only <> are allowed to create tags, we would extend the example above: -==== +---- [access "refs/tags/*"] push = block group Anonymous Users create = group Project Owners pushTag = group Project Owners -==== +---- ==== Let only a dedicated group vote in a special category @@ -1136,11 +1136,11 @@ this category. We have to block everyone except the 'Release Engineers' to vote in this category and, of course, allow 'Release Engineers' to vote in that category. In the "`All-Projects`" we define the following rules: -==== +---- [access "refs/heads/stable*"] label-Release-Process = block -1..+1 group Anonymous Users label-Release-Process = -1..+1 group Release Engineers -==== +---- [[global_capabilities]] == Global Capabilities diff --git a/Documentation/cmd-ban-commit.txt b/Documentation/cmd-ban-commit.txt index f4692cf1da..80f41f041c 100644 --- a/Documentation/cmd-ban-commit.txt +++ b/Documentation/cmd-ban-commit.txt @@ -44,10 +44,10 @@ This command is intended to be used in scripts. Ban commit `421919d015c062fd28901fe144a78a555d0b5984` from project `myproject`: -==== +---- $ ssh -p 29418 review.example.com gerrit ban-commit myproject \ 421919d015c062fd28901fe144a78a555d0b5984 -==== +---- GERRIT ------ diff --git a/Documentation/cmd-cherry-pick.txt b/Documentation/cmd-cherry-pick.txt index f702c83e29..de0b71b74a 100644 --- a/Documentation/cmd-cherry-pick.txt +++ b/Documentation/cmd-cherry-pick.txt @@ -33,11 +33,11 @@ each commit message. To obtain the 'gerrit-cherry-pick' script use scp, curl or wget to copy it to your local system: -==== +---- $ scp -p -P 29418 john.doe@review.example.com:bin/gerrit-cherry-pick ~/bin/ $ curl -Lo ~/bin/gerrit-cherry-pick http://review.example.com/tools/bin/gerrit-cherry-pick -==== +---- GERRIT ------ diff --git a/Documentation/cmd-create-account.txt b/Documentation/cmd-create-account.txt index e79ae5008f..62bd0aa328 100644 --- a/Documentation/cmd-create-account.txt +++ b/Documentation/cmd-create-account.txt @@ -68,9 +68,9 @@ This most likely requires double quoting the value, for example Create a new batch/role access user account called `watcher` in the 'Non-Interactive Users' group. -==== +---- $ cat ~/.ssh/id_watcher.pub | ssh -p 29418 review.example.com gerrit create-account --group "'Non-Interactive Users'" --ssh-key - watcher -==== +---- GERRIT ------ diff --git a/Documentation/cmd-create-branch.txt b/Documentation/cmd-create-branch.txt index 43d2b4f3c4..336af56d11 100644 --- a/Documentation/cmd-create-branch.txt +++ b/Documentation/cmd-create-branch.txt @@ -39,9 +39,9 @@ This command is intended to be used in scripts. Create a new branch called 'newbranch' from the 'master' branch of the project 'myproject'. -==== +---- $ ssh -p 29418 review.example.com gerrit create-branch myproject newbranch master -==== +---- GERRIT ------ diff --git a/Documentation/cmd-create-group.txt b/Documentation/cmd-create-group.txt index e8d7bd5ae4..7f1f463dea 100644 --- a/Documentation/cmd-create-group.txt +++ b/Documentation/cmd-create-group.txt @@ -67,16 +67,16 @@ to the group. Create a new account group called `gerritdev` with two initial members `developer1` and `developer2`. The group should be owned by itself: -==== +---- $ ssh -p 29418 user@review.example.com gerrit create-group --member developer1 --member developer2 gerritdev -==== +---- Create a new account group called `Foo` owned by the `Foo-admin` group. Put `developer1` as the initial member and include group description: -==== +---- $ ssh -p 29418 user@review.example.com gerrit create-group --owner Foo-admin --member developer1 --description "'Foo description'" Foo -==== +---- Note that it is necessary to quote the description twice. The local shell needs double quotes around the value to ensure the single quotes diff --git a/Documentation/cmd-create-project.txt b/Documentation/cmd-create-project.txt index 72c7d57047..503bd12630 100644 --- a/Documentation/cmd-create-project.txt +++ b/Documentation/cmd-create-project.txt @@ -171,15 +171,15 @@ Common unit suffixes of 'k', 'm', or 'g' are supported. == EXAMPLES Create a new project called `tools/gerrit`: -==== +---- $ ssh -p 29418 review.example.com gerrit create-project tools/gerrit.git -==== +---- Create a new project with a description: -==== +---- $ ssh -p 29418 review.example.com gerrit create-project tool.git --description "'Tools used by build system'" -==== +---- Note that it is necessary to quote the description twice. The local shell needs double quotes around the value to ensure the single quotes @@ -190,9 +190,9 @@ the single quotes to delimit the value. If the replication plugin is installed, the plugin will attempt to perform remote repository creation by a Bourne shell script: -==== +---- mkdir -p '/base/project.git' && cd '/base/project.git' && git init --bare && git update-ref HEAD refs/heads/master -==== +---- For this to work successfully the remote system must be able to run arbitrary shell scripts, and must have `git` in the user's PATH diff --git a/Documentation/cmd-flush-caches.txt b/Documentation/cmd-flush-caches.txt index 55a201a5c3..4716f3ba2d 100644 --- a/Documentation/cmd-flush-caches.txt +++ b/Documentation/cmd-flush-caches.txt @@ -57,7 +57,7 @@ This command is intended to be used in scripts. == EXAMPLES List caches available for flushing: -==== +---- $ ssh -p 29418 review.example.com gerrit flush-caches --list accounts accounts_byemail @@ -68,32 +68,32 @@ List caches available for flushing: projects sshkeys web_sessions -==== +---- Flush all caches known to the server, forcing them to recompute: -==== +---- $ ssh -p 29418 review.example.com gerrit flush-caches --all -==== +---- or -==== +---- $ ssh -p 29418 review.example.com gerrit flush-caches -==== +---- Flush only the "sshkeys" cache, after manually editing an SSH key for a user: -==== +---- $ ssh -p 29418 review.example.com gerrit flush-caches --cache sshkeys -==== +---- Flush "web_sessions", forcing all users to sign-in again: -==== +---- $ ssh -p 29418 review.example.com gerrit flush-caches --cache web_sessions -==== +---- == SEE ALSO diff --git a/Documentation/cmd-gc.txt b/Documentation/cmd-gc.txt index af098b1fd7..1d1cc002b9 100644 --- a/Documentation/cmd-gc.txt +++ b/Documentation/cmd-gc.txt @@ -53,7 +53,7 @@ This command is intended to be used in scripts. Run the Git garbage collection for the projects 'myProject' and 'yourProject': -===== +---- $ ssh -p 29418 review.example.com gerrit gc myProject yourProject collecting garbage for "myProject": ... @@ -62,12 +62,12 @@ Run the Git garbage collection for the projects 'myProject' and collecting garbage for "yourProject": ... done. -===== +---- Run the Git garbage collection for all projects: -===== +---- $ ssh -p 29418 review.example.com gerrit gc --all -===== +---- GERRIT ------ diff --git a/Documentation/cmd-gsql.txt b/Documentation/cmd-gsql.txt index d55ba2ba75..d2eb7833c4 100644 --- a/Documentation/cmd-gsql.txt +++ b/Documentation/cmd-gsql.txt @@ -41,7 +41,7 @@ JSON_SINGLE. == EXAMPLES To manually correct a user's SSH user name: -==== +---- $ ssh -p 29418 review.example.com gerrit gsql Welcome to Gerrit Code Review v2.0.25 (PostgreSQL 8.3.8) @@ -54,7 +54,7 @@ To manually correct a user's SSH user name: Bye $ ssh -p 29418 review.example.com gerrit flush-caches --cache sshkeys --cache accounts -==== +---- GERRIT ------ diff --git a/Documentation/cmd-hook-commit-msg.txt b/Documentation/cmd-hook-commit-msg.txt index e1021865e3..ffdd5da05a 100644 --- a/Documentation/cmd-hook-commit-msg.txt +++ b/Documentation/cmd-hook-commit-msg.txt @@ -63,26 +63,26 @@ it to your local system from your Gerrit server. You can use either of the below commands: -==== +---- $ scp -p -P 29418 @:hooks/commit-msg /.git/hooks/ $ curl -Lo /.git/hooks/commit-msg /tools/hooks/commit-msg -==== +---- A specific example of this might look something like this: .Example -==== +---- $ scp -p -P 29418 john.doe@review.example.com:hooks/commit-msg ~/duhproject/.git/hooks/ $ curl -Lo ~/duhproject/.git/hooks/commit-msg http://review.example.com/tools/hooks/commit-msg -==== +---- Make sure the hook file is executable: -==== +---- $ chmod u+x ~/duhproject/.git/hooks/commit-msg -==== +---- == SEE ALSO diff --git a/Documentation/cmd-index-changes.txt b/Documentation/cmd-index-changes.txt index 8560c7c85b..d38c51ad4a 100644 --- a/Documentation/cmd-index-changes.txt +++ b/Documentation/cmd-index-changes.txt @@ -29,9 +29,9 @@ This command is intended to be used in scripts. == EXAMPLES Index changes with legacy ID numbers 1 and 2. -==== +---- $ ssh -p 29418 user@review.example.com gerrit index changes 1 2 -==== +---- GERRIT ------ diff --git a/Documentation/cmd-index.txt b/Documentation/cmd-index.txt index e244228028..61e78650de 100644 --- a/Documentation/cmd-index.txt +++ b/Documentation/cmd-index.txt @@ -7,11 +7,13 @@ from Gerrit's daemon, and then executed on the client system. To download a client command or hook, use scp or an http client: +---- $ scp -p -P 29418 john.doe@review.example.com:bin/gerrit-cherry-pick ~/bin/ $ scp -p -P 29418 john.doe@review.example.com:hooks/commit-msg .git/hooks/ $ curl -Lo ~/bin/gerrit-cherry-pick http://review.example.com/tools/bin/gerrit-cherry-pick $ curl -Lo .git/hooks/commit-msg http://review.example.com/tools/hooks/commit-msg +---- For more details on how to determine the correct SSH port number, see link:user-upload.html#test_ssh[Testing Your SSH Connection]. @@ -38,7 +40,9 @@ several other commands over its internal SSH daemon. As Gerrit does not provide an interactive shell, the commands must be triggered from an ssh client, for example: +---- $ ssh -p 29418 review.example.com gerrit ls-projects +---- For more details on how to determine the correct SSH port number, see link:user-upload.html#test_ssh[Testing Your SSH Connection]. diff --git a/Documentation/cmd-logging-ls-level.txt b/Documentation/cmd-logging-ls-level.txt index b81bc8f2a1..ee015bb0de 100644 --- a/Documentation/cmd-logging-ls-level.txt +++ b/Documentation/cmd-logging-ls-level.txt @@ -26,15 +26,15 @@ Caller must have the ADMINISTRATE_SERVER capability. == Examples View the logging level of the loggers in the package com.google: -===== +---- $ssh -p 29418 review.example.com gerrit logging ls-level \ com.google. -===== +---- View the logging level of every logger -===== +---- $ssh -p 29418 review.example.com gerrit logging ls-level -===== +---- GERRIT ------ diff --git a/Documentation/cmd-logging-set-level.txt b/Documentation/cmd-logging-set-level.txt index fcf93111bf..5baa9687c4 100644 --- a/Documentation/cmd-logging-set-level.txt +++ b/Documentation/cmd-logging-set-level.txt @@ -33,16 +33,16 @@ Caller must have the ADMINISTRATE_SERVER capability. == Examples Change the logging level of the loggers in the package com.google to DEBUG. -===== +---- $ssh -p 29418 review.example.com gerrit logging set-level \ debug com.google. -===== +---- Reset the logging level of every logger to what they were at deployment time. -===== +---- $ssh -p 29418 review.example.com gerrit logging set-level \ reset -===== +---- GERRIT ------ diff --git a/Documentation/cmd-ls-groups.txt b/Documentation/cmd-ls-groups.txt index 8853854eb3..d8eef8bf59 100644 --- a/Documentation/cmd-ls-groups.txt +++ b/Documentation/cmd-ls-groups.txt @@ -87,55 +87,55 @@ nonexistent group, the owner group name field will read `n/a`. == EXAMPLES List visible groups: -===== +---- $ ssh -p 29418 review.example.com gerrit ls-groups Administrators Anonymous Users MyProject_Committers Project Owners Registered Users -===== +---- List all groups for which any permission is set for the project "MyProject": -===== +---- $ ssh -p 29418 review.example.com gerrit ls-groups --project MyProject MyProject_Committers Project Owners Registered Users -===== +---- List all groups which are owned by the calling user: -===== +---- $ ssh -p 29418 review.example.com gerrit ls-groups --owned MyProject_Committers MyProject_Verifiers -===== +---- Check if the calling user owns the group `MyProject_Committers`. If `MyProject_Committers` is returned the calling user owns this group. If the result is empty, the calling user doesn't own the group. -===== +---- $ ssh -p 29418 review.example.com gerrit ls-groups --owned -q MyProject_Committers MyProject_Committers -===== +---- Extract the UUID of the 'Administrators' group: -===== +---- $ ssh -p 29418 review.example.com gerrit ls-groups -v | awk '-F\t' '$1 == "Administrators" {print $2}' ad463411db3eec4e1efb0d73f55183c1db2fd82a -===== +---- Extract and expand the multi-line description of the 'Administrators' group: -===== +---- $ printf "$(ssh -p 29418 review.example.com gerrit ls-groups -v | awk '-F\t' '$1 == "Administrators" {print $3}')\n" This is a multi-line description. -===== +---- GERRIT ------ diff --git a/Documentation/cmd-ls-members.txt b/Documentation/cmd-ls-members.txt index 52428f9faa..a6d492cc3f 100644 --- a/Documentation/cmd-ls-members.txt +++ b/Documentation/cmd-ls-members.txt @@ -39,19 +39,19 @@ the output. == EXAMPLES List members of the Administrators group: -===== +---- $ ssh -p 29418 review.example.com gerrit ls-members Administrators id username full name email 100000 jim Jim Bob somebody@example.com 100001 johnny John Smith n/a 100002 mrnoname n/a someoneelse@example.com -===== +---- List members of a non-existent group: -===== +---- $ ssh -p 29418 review.example.com gerrit ls-members BadlySpelledGroup Group not found or not visible -===== +---- GERRIT ------ diff --git a/Documentation/cmd-ls-projects.txt b/Documentation/cmd-ls-projects.txt index 3dc8ff7c30..e2e71ff9e8 100644 --- a/Documentation/cmd-ls-projects.txt +++ b/Documentation/cmd-ls-projects.txt @@ -114,7 +114,7 @@ by the client in the request headers. == EXAMPLES List visible projects: -===== +---- $ ssh -p 29418 review.example.com gerrit ls-projects platform/manifest tools/gerrit @@ -128,16 +128,16 @@ List visible projects: $ 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 diff --git a/Documentation/cmd-ls-user-refs.txt b/Documentation/cmd-ls-user-refs.txt index 03e54cf982..1a87fc9507 100644 --- a/Documentation/cmd-ls-user-refs.txt +++ b/Documentation/cmd-ls-user-refs.txt @@ -41,9 +41,9 @@ Administrators == EXAMPLES List visible refs for the user "mr.developer" in project "gerrit" -===== +---- $ ssh -p 29418 review.example.com gerrit ls-user-refs -p gerrit -u mr.developer -===== +---- GERRIT ------ diff --git a/Documentation/cmd-plugin-enable.txt b/Documentation/cmd-plugin-enable.txt index 508f972336..9b5273630c 100644 --- a/Documentation/cmd-plugin-enable.txt +++ b/Documentation/cmd-plugin-enable.txt @@ -31,9 +31,9 @@ This command is intended to be used in scripts. == EXAMPLES Enable a plugin: -==== +---- ssh -p 29418 localhost gerrit plugin enable my-plugin -==== +---- GERRIT ------ diff --git a/Documentation/cmd-plugin-install.txt b/Documentation/cmd-plugin-install.txt index e701f984fc..274b446ab0 100644 --- a/Documentation/cmd-plugin-install.txt +++ b/Documentation/cmd-plugin-install.txt @@ -45,31 +45,31 @@ This command is intended to be used in scripts. == EXAMPLES Install a plugin from an absolute file path on the server's host: -==== +---- ssh -p 29418 localhost gerrit plugin install -n name.jar \ $(pwd)/my-plugin.jar -==== +---- Install a WebUi plugin from an absolute file path on the server's host: -==== +---- ssh -p 29418 localhost gerrit plugin install -n name.js \ $(pwd)/my-webui-plugin.js -==== +---- Install a plugin from an HTTP site: -==== +---- ssh -p 29418 localhost gerrit plugin install -n name.jar \ http://build-server/output/our-plugin -==== +---- Install a plugin from piped input: -==== +---- ssh -p 29418 localhost gerrit plugin install -n name.jar \ -