@@ -61,6 +61,14 @@ pub struct PackageSelectOptions {
61
61
/// regardless, set this flag.
62
62
#[ structopt( long = "ignore-publish" ) ]
63
63
ignore_publish : bool ,
64
+ /// Automatically detect the packages, which changed compared to the given git commit.
65
+ ///
66
+ /// Compares the current git `head` to the reference given, identifies which files changed
67
+ /// and attempts to identify the packages and its dependents through that mechanism. You
68
+ /// can use any `tag`, `branch` or `commit`, but you must be sure it is available
69
+ /// (and up to date) locally.
70
+ #[ structopt( short = "c" , long="changed-since" ) ]
71
+ pub changed_since : String ,
64
72
}
65
73
66
74
#[ derive( StructOpt , Debug ) ]
@@ -348,6 +356,7 @@ fn make_pkg_predicate(args: PackageSelectOptions) -> Result<Box<dyn Fn(&Package)
348
356
skip,
349
357
ignore_pre_version,
350
358
ignore_publish,
359
+ changed_since,
351
360
} = args;
352
361
353
362
if !packages. is_empty ( ) {
@@ -357,8 +366,24 @@ fn make_pkg_predicate(args: PackageSelectOptions) -> Result<Box<dyn Fn(&Package)
357
366
. into ( ) ,
358
367
) ;
359
368
}
369
+ if changed_since. len ( ) != 0 {
370
+ return Err (
371
+ "-p/--packages is mutually exlusive to using -c/--changed-since"
372
+ . into ( ) ,
373
+ ) ;
374
+ }
360
375
}
361
376
377
+ if changed_since. len ( ) != 0 {
378
+ if !skip. is_empty ( ) || !ignore_pre_version. is_empty ( ) {
379
+ return Err (
380
+ "-c/--changed-since is mutually exlusive to using -s/--skip and -i/--ignore-version-pre"
381
+ . into ( ) ,
382
+ ) ;
383
+ }
384
+ }
385
+
386
+
362
387
let publish = move |p : & Package | {
363
388
let publ = if ignore_publish {
364
389
true
@@ -371,6 +396,8 @@ fn make_pkg_predicate(args: PackageSelectOptions) -> Result<Box<dyn Fn(&Package)
371
396
publ
372
397
} ;
373
398
399
+
400
+
374
401
if !packages. is_empty ( ) {
375
402
trace ! ( "going for matching against {:?}" , packages) ;
376
403
return Ok ( Box :: new ( move |p : & Package | {
0 commit comments