@@ -172,6 +172,35 @@ multi MAIN ('extract', *@components) {
172
172
}
173
173
}
174
174
175
+ # = List checked out component trees with matching git revision
176
+ multi MAIN (' list-checkouts' , * @ components ) {
177
+ needs-setup(' list' );
178
+
179
+ my $ max-length = max (for-checkouts @ components , -> $ , $ name , $ checkout { " $ name /$ checkout" . chars }, : quiet);
180
+ my $ format = " %-{ $ max-length } s % s\n " ;
181
+ printf $ format , < CHECKOUT REVISION >;
182
+ printf $ format , < -------- -------- >;
183
+
184
+ for-checkouts @ components , -> $ comp , $ name , $ checkout {
185
+ my $ subdir = " $ name /$ checkout" ;
186
+ my $ comp-dir = " $ COMPONENTS_DIR /$ subdir" ;
187
+ if $ comp-dir . IO . d {
188
+ my $ git-dir = " $ comp-dir /.git" ;
189
+ if $ git-dir . IO . d {
190
+ % * ENV <GIT_DIR > = $ git-dir ;
191
+ my $ desc = qx / git describe --always/ . chomp ;
192
+ printf $ format , $ subdir , $ desc ;
193
+ }
194
+ else {
195
+ printf $ format , $ subdir , ' [NOT A GIT CHECKOUT]' ;
196
+ }
197
+ }
198
+ else {
199
+ printf $ format , $ subdir , ' [NOT FOUND]' ;
200
+ }
201
+ }, : quiet;
202
+ }
203
+
175
204
# = Build checked out component trees
176
205
multi MAIN (' build' , * @ components ) {
177
206
needs-setup(' build components' );
0 commit comments