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       Run `repo help forall` to view the detailed manual.
60

DETAILS

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