1REPO(1)                           Repo Manual                          REPO(1)
2
3
4

NAME

6       repo - repo forall - manual page for repo forall
7

SYNOPSIS

9       repo forall [<project>...] -c <command> [<arg>...]
10

DESCRIPTION

12       Summary
13
14       Run a shell command in each project
15
16       repo forall -r str1 [str2] ... -c <command> [<arg>...]
17

OPTIONS

19       -h, --help
20              show this help message and exit
21
22       -j JOBS, --jobs=JOBS
23              number  of  jobs to run in parallel (default: based on number of
24              CPU cores)
25
26       -r, --regex
27              execute the command only on projects matching regex or  wildcard
28              expression
29
30       -i, --inverse-regex
31              execute the command only on projects not matching regex or wild‐
32              card expression
33
34       -g GROUPS, --groups=GROUPS
35              execute the command only  on  projects  matching  the  specified
36              groups
37
38       -c, --command
39              command (and arguments) to execute
40
41       -e, --abort-on-errors
42              abort if a command exits unsuccessfully
43
44       --ignore-missing
45              silently skip & do not exit non-zero due missing checkouts
46
47       --interactive
48              force interactive usage
49
50   Logging options:
51       -v, --verbose
52              show all output
53
54       -q, --quiet
55              only show errors
56
57       -p     show project headers before output
58
59   Multi-manifest options:
60       --outer-manifest
61              operate starting at the outermost manifest
62
63       --no-outer-manifest
64              do not operate on outer manifests
65
66       --this-manifest-only
67              only operate on this (sub)manifest
68
69       --no-this-manifest-only, --all-manifests
70              operate on this manifest and its submanifests
71
72       Run `repo help forall` to view the detailed manual.
73

DETAILS

75       Executes the same shell command in each project.
76
77       The  -r  option  allows  running  the command only on projects matching
78       regex or wildcard expression.
79
80       By default, projects are processed non-interactively  in  parallel.  If
81       you  want  to run interactive commands, make sure to pass --interactive
82       to force --jobs 1.  While the processing order of projects is not guar‐
83       anteed, the order of project output is stable.
84
85       Output Formatting
86
87       The  -p  option  causes  'repo  forall'  to bind pipes to the command's
88       stdin, stdout and stderr streams, and pipe all output into a continuous
89       stream  that  is  displayed in a single pager session. Project headings
90       are inserted before the output of each command  is  displayed.  If  the
91       command produces no output in a project, no heading is displayed.
92
93       The formatting convention used by -p is very suitable for some types of
94       searching, e.g. `repo forall -p -c git log -SFoo` will print  all  com‐
95       mits that add or remove references to Foo.
96
97       The -v option causes 'repo forall' to display stderr messages if a com‐
98       mand produces output only on stderr. Normally the -p option causes com‐
99       mand  output  to  be suppressed until the command produces at least one
100       byte of output on stdout.
101
102       Environment
103
104       pwd is the project's working directory. If the current client is a mir‐
105       ror client, then pwd is the Git repository.
106
107       REPO_PROJECT is set to the unique name of the project.
108
109       REPO_PATH is the path relative the the root of the client.
110
111       REPO_OUTERPATH  is  the path of the sub manifest's root relative to the
112       root of the client.
113
114       REPO_INNERPATH is the path relative to the root of the sub manifest.
115
116       REPO_REMOTE is the name of the remote system from the manifest.
117
118       REPO_LREV is the name of the revision from the manifest, translated  to
119       a local tracking branch. If you need to pass the manifest revision to a
120       locally executed git command, use REPO_LREV.
121
122       REPO_RREV is the name of the revision from  the  manifest,  exactly  as
123       written in the manifest.
124
125       REPO_COUNT is the total number of projects being iterated.
126
127       REPO_I  is  the  current (1-based) iteration count. Can be used in con‐
128       junction with REPO_COUNT to add a simple  progress  indicator  to  your
129       command.
130
131       REPO__*  are any extra environment variables, specified by the "annota‐
132       tion" element under any project element. This can be useful for differ‐
133       entiating  trees  based on user-specific criteria, or simply annotating
134       tree details.
135
136       shell positional arguments ($1, $2, .., $#) are set  to  any  arguments
137       following <command>.
138
139       Example: to list projects:
140
141              repo forall -c 'echo $REPO_PROJECT'
142
143       Notice  that  $REPO_PROJECT  is  quoted to ensure it is expanded in the
144       context of running <command> instead of in the calling shell.
145
146       Unless -p is used, stdin, stdout, stderr are inherited from the  termi‐
147       nal and are not redirected.
148
149       If  -e is used, when a command exits unsuccessfully, 'repo forall' will
150       abort without iterating through the remaining projects.
151
152
153
154repo forall                        July 2022                           REPO(1)
Impressum