Is there a way to find out whether or not the tran...
# general
Is there a way to find out whether or not the transitive dependencies for a single target have changed compared to
In general
./pants --changed-since=origin/master --changed-dependees=transitive <goal>
will run the pants goal on just the targets that have changed.
So for example,
./pants --changed-since=origin/master --changed-dependees=transitive test
will only run tests transitively affected by changes
Is there a way to do the same thing but for a file instead of a goal?
If you need to know the actual target identities, you can do
./pants --changed-since=origin/main --changed-dependees=transitive list
What I basically want is the intersection of
./pants dependencies --transitive $directory/::
and the git diff. Or even more specific, whether or not the intersection is empty.
Copy code
./pants --changed-since=origin/master --changed-dependees=transitive src/my_directory/gp::
13:25:46.15 [ERROR] You used `--changed-since` at the same time as using target arguments. Please use only one.
☝️ I think the above is basically what I want to be able to say but not sure if there's a way that works
Yeah you can't combine the two right now. You either specify "I want to act on these targets" or "I want to act on the targets that have changed since this git sha"
But you can list the affected targets with
./pants --changed-since=origin/main --changed-dependees=transitive list
and then check if the targets you care about are in that list?
That might work! Thank you!