Roger Shimizu | 0a1f533 | 2021-06-20 21:41:05 +0900 | [diff] [blame] | 1 | .\" DO NOT MODIFY THIS FILE! It was generated by help2man. |
Mike Frysinger | d47d9ff | 2022-07-10 05:15:19 -0400 | [diff] [blame] | 2 | .TH REPO "1" "July 2022" "repo forall" "Repo Manual" |
Roger Shimizu | 0a1f533 | 2021-06-20 21:41:05 +0900 | [diff] [blame] | 3 | .SH NAME |
| 4 | repo \- repo forall - manual page for repo forall |
| 5 | .SH SYNOPSIS |
| 6 | .B repo |
| 7 | \fI\,forall \/\fR[\fI\,<project>\/\fR...] \fI\,-c <command> \/\fR[\fI\,<arg>\/\fR...] |
| 8 | .SH DESCRIPTION |
| 9 | Summary |
| 10 | .PP |
| 11 | Run a shell command in each project |
| 12 | .PP |
| 13 | repo forall \fB\-r\fR str1 [str2] ... \fB\-c\fR <command> [<arg>...] |
| 14 | .SH OPTIONS |
| 15 | .TP |
| 16 | \fB\-h\fR, \fB\-\-help\fR |
| 17 | show this help message and exit |
| 18 | .TP |
| 19 | \fB\-j\fR JOBS, \fB\-\-jobs\fR=\fI\,JOBS\/\fR |
Mike Frysinger | df8b1cb | 2021-07-26 15:59:20 -0400 | [diff] [blame] | 20 | number of jobs to run in parallel (default: based on |
| 21 | number of CPU cores) |
Roger Shimizu | 0a1f533 | 2021-06-20 21:41:05 +0900 | [diff] [blame] | 22 | .TP |
| 23 | \fB\-r\fR, \fB\-\-regex\fR |
| 24 | execute the command only on projects matching regex or |
| 25 | wildcard expression |
| 26 | .TP |
| 27 | \fB\-i\fR, \fB\-\-inverse\-regex\fR |
| 28 | execute the command only on projects not matching |
| 29 | regex or wildcard expression |
| 30 | .TP |
| 31 | \fB\-g\fR GROUPS, \fB\-\-groups\fR=\fI\,GROUPS\/\fR |
| 32 | execute the command only on projects matching the |
| 33 | specified groups |
| 34 | .TP |
| 35 | \fB\-c\fR, \fB\-\-command\fR |
| 36 | command (and arguments) to execute |
| 37 | .TP |
| 38 | \fB\-e\fR, \fB\-\-abort\-on\-errors\fR |
| 39 | abort if a command exits unsuccessfully |
| 40 | .TP |
| 41 | \fB\-\-ignore\-missing\fR |
| 42 | silently skip & do not exit non\-zero due missing |
| 43 | checkouts |
| 44 | .TP |
| 45 | \fB\-\-interactive\fR |
| 46 | force interactive usage |
| 47 | .SS Logging options: |
| 48 | .TP |
| 49 | \fB\-v\fR, \fB\-\-verbose\fR |
| 50 | show all output |
| 51 | .TP |
| 52 | \fB\-q\fR, \fB\-\-quiet\fR |
| 53 | only show errors |
| 54 | .TP |
| 55 | \fB\-p\fR |
| 56 | show project headers before output |
Mike Frysinger | d47d9ff | 2022-07-10 05:15:19 -0400 | [diff] [blame] | 57 | .SS Multi\-manifest options: |
| 58 | .TP |
| 59 | \fB\-\-outer\-manifest\fR |
| 60 | operate starting at the outermost manifest |
| 61 | .TP |
| 62 | \fB\-\-no\-outer\-manifest\fR |
| 63 | do not operate on outer manifests |
| 64 | .TP |
| 65 | \fB\-\-this\-manifest\-only\fR |
| 66 | only operate on this (sub)manifest |
| 67 | .TP |
| 68 | \fB\-\-no\-this\-manifest\-only\fR, \fB\-\-all\-manifests\fR |
| 69 | operate on this manifest and its submanifests |
Roger Shimizu | 0a1f533 | 2021-06-20 21:41:05 +0900 | [diff] [blame] | 70 | .PP |
| 71 | Run `repo help forall` to view the detailed manual. |
| 72 | .SH DETAILS |
| 73 | .PP |
| 74 | Executes the same shell command in each project. |
| 75 | .PP |
| 76 | The \fB\-r\fR option allows running the command only on projects matching regex or |
| 77 | wildcard expression. |
| 78 | .PP |
| 79 | By default, projects are processed non\-interactively in parallel. If you want to |
| 80 | run interactive commands, make sure to pass \fB\-\-interactive\fR to force \fB\-\-jobs\fR 1. |
| 81 | While the processing order of projects is not guaranteed, the order of project |
| 82 | output is stable. |
| 83 | .PP |
| 84 | Output Formatting |
| 85 | .PP |
| 86 | The \fB\-p\fR option causes 'repo forall' to bind pipes to the command's stdin, stdout |
| 87 | and stderr streams, and pipe all output into a continuous stream that is |
| 88 | displayed in a single pager session. Project headings are inserted before the |
| 89 | output of each command is displayed. If the command produces no output in a |
| 90 | project, no heading is displayed. |
| 91 | .PP |
| 92 | The formatting convention used by \fB\-p\fR is very suitable for some types of |
| 93 | searching, e.g. `repo forall \fB\-p\fR \fB\-c\fR git log \fB\-SFoo\fR` will print all commits that |
| 94 | add or remove references to Foo. |
| 95 | .PP |
| 96 | The \fB\-v\fR option causes 'repo forall' to display stderr messages if a command |
| 97 | produces output only on stderr. Normally the \fB\-p\fR option causes command output to |
| 98 | be suppressed until the command produces at least one byte of output on stdout. |
| 99 | .PP |
| 100 | Environment |
| 101 | .PP |
| 102 | pwd is the project's working directory. If the current client is a mirror |
| 103 | client, then pwd is the Git repository. |
| 104 | .PP |
| 105 | REPO_PROJECT is set to the unique name of the project. |
| 106 | .PP |
| 107 | REPO_PATH is the path relative the the root of the client. |
| 108 | .PP |
Mike Frysinger | d47d9ff | 2022-07-10 05:15:19 -0400 | [diff] [blame] | 109 | REPO_OUTERPATH is the path of the sub manifest's root relative to the root of |
| 110 | the client. |
| 111 | .PP |
| 112 | REPO_INNERPATH is the path relative to the root of the sub manifest. |
| 113 | .PP |
Roger Shimizu | 0a1f533 | 2021-06-20 21:41:05 +0900 | [diff] [blame] | 114 | REPO_REMOTE is the name of the remote system from the manifest. |
| 115 | .PP |
| 116 | REPO_LREV is the name of the revision from the manifest, translated to a local |
| 117 | tracking branch. If you need to pass the manifest revision to a locally executed |
| 118 | git command, use REPO_LREV. |
| 119 | .PP |
| 120 | REPO_RREV is the name of the revision from the manifest, exactly as written in |
| 121 | the manifest. |
| 122 | .PP |
| 123 | REPO_COUNT is the total number of projects being iterated. |
| 124 | .PP |
| 125 | REPO_I is the current (1\-based) iteration count. Can be used in conjunction with |
| 126 | REPO_COUNT to add a simple progress indicator to your command. |
| 127 | .PP |
| 128 | REPO__* are any extra environment variables, specified by the "annotation" |
| 129 | element under any project element. This can be useful for differentiating trees |
| 130 | based on user\-specific criteria, or simply annotating tree details. |
| 131 | .PP |
| 132 | shell positional arguments ($1, $2, .., $#) are set to any arguments following |
| 133 | <command>. |
| 134 | .PP |
| 135 | Example: to list projects: |
| 136 | .IP |
| 137 | repo forall \fB\-c\fR 'echo $REPO_PROJECT' |
| 138 | .PP |
| 139 | Notice that $REPO_PROJECT is quoted to ensure it is expanded in the context of |
| 140 | running <command> instead of in the calling shell. |
| 141 | .PP |
| 142 | Unless \fB\-p\fR is used, stdin, stdout, stderr are inherited from the terminal and are |
| 143 | not redirected. |
| 144 | .PP |
| 145 | If \fB\-e\fR is used, when a command exits unsuccessfully, 'repo forall' will abort |
| 146 | without iterating through the remaining projects. |