I'm trying `./pants tailor --changed-since=HEAD` a...
# general
f
I'm trying
./pants tailor --changed-since=HEAD
as a pre-commit check, and it's adding things for unstaged files... is there a way to spell the index in a
--changed-diffspec=
so that this doesn't happen?
1
h
f
I mean.. yeah that's what i'm going for... I want be able to say the equivalent of
Copy code
./pants --changed-diffspec=HEAD...<staged> tailor
I don't know if there's a way to express '<staged>' in spelling revisions though
i know that I could do
Copy code
git diff --cached --name-only --no-commit-id HEAD
er... I guess I could do this only on push and then I could just do
--changed-since=HEAD
h
One option is to try something like
./pants --spec-files=<(git diff-tree --cached --name-only --no-commit-id HEAD) list
. Although you may hit https://github.com/pantsbuild/pants/issues/5385 on bash
f
I tried that... it doesn't work for tailor specifically because pants wont
list
things it hasn't been told to pay attention to yet
h
what Pants version is this? In Pants 2.13,
tailor
learned how to work on file arguments regardless of targets existing or not 🙂
f
2.13rc0
h
hm, I'm not following then why this would be relevant?
it doesn't work for tailor specifically because pants wont list things it hasn't been told to pay attention to yet
In the code snippet, use
tailor
rather than
list
. That should feed Pants a bunch of (possibly unowned) files, and it should know what to do
f
oh, have to change the deprecated directory semantics thing
👍 1
ah so I can just set pre-commit up to pass the filenames
1