https://pantsbuild.org/ logo
#general
Title
# general
w

wide-zoo-86070

04/27/2022, 5:08 PM
I am wondering if there is any reason the changed-since flag does not work with a specific target?
n

narrow-vegetable-37489

04/27/2022, 5:14 PM
If it did work, what would be the expected behavior? Only fmt/lint/check/something this target if it has changed since X?
w

wide-zoo-86070

04/27/2022, 5:19 PM
I would say, only things in target A whose dependencies (including itself) changed since X.
@hundreds-father-404 any idea?
w

witty-crayon-22786

04/27/2022, 8:32 PM
@wide-zoo-86070: that isn’t the behavior i would expect if both
--changed-since
and a target were accepted at the same time: rather, i would expect that both the changed targets AND the explicitly specified targets were included.
what you’re asking for is more like https://github.com/pantsbuild/pants/issues/14243. the suggested approach currently though is to use a combination of
list
and
filter
and
dependencies
see https://www.pantsbuild.org/v2.11/docs/advanced-target-selection#piping-to-other-pants-runs
concretely, i think that it would look like
Copy code
./pants --changed-since=$SHA --changed-dependees=transitive filter --address-regex=$RELEVANT_DIRECTORY | xargs ./pants $GOAL_TO_RUN