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