Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/App/Multigit.pm
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ our %BEHAVIOUR = (
report_on_no_output => $ENV{MG_REPORT_ON_NO_OUTPUT} // 1,
ignore_stdout => !!$ENV{MG_IGNORE_STDOUT},
ignore_stderr => !!$ENV{MG_IGNORE_STDERR},
list_repos => $ENV{MG_LIST_REPOS},
concurrent => $ENV{MG_CONCURRENT_PROCESSES} // 20,
skip_readonly => !!$ENV{MG_SKIP_READONLY},
);
Expand Down
2 changes: 2 additions & 0 deletions lib/App/Multigit/Repo.pm
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ sub report {
return Future->done unless $App::Multigit::BEHAVIOUR{report_on_no_output}
or $output =~ s/\s//gr;

$output = '' if $App::Multigit::BEHAVIOUR{list_repos};

return Future->done(
$dir => $output
);
Expand Down
20 changes: 20 additions & 0 deletions script/mg
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ sub usage;
'verbose|v' => sub {
$qs--;
},
'list|l' => \$ENV{MG_LIST_REPOS},
'concurrent|c=i' => \$ENV{MG_CONCURRENT_PROCESSES},
'skip-readonly' => \$ENV{MG_SKIP_READONLY},
);
Expand Down Expand Up @@ -108,4 +109,23 @@ might use this.
Skip readonly repositories. Repositories marked readonly = 1 in the .mgconfig
will be ignored by whatever command you run.

=item -l

=item --list

List repositories that would produce output. This is useful for piping the list
of repositories to another mg each.

For example,

mg -l st -uno | mg each git push

Note that mg grep does a very similar thing and may be more appropriate.

mg grep git not-master

Is roughly equivalent to,

mg -lq each git not-master

=back