build-tools
build-tools copied to clipboard
image-tag: Rework the -WIP logic
Seems like grepping the output of git status --porcelain broke. Use a
different approach with git diff and only check the events we care about
(having staged and un staged changes).
IIRC the reason I changed this was to avoid git reading all the files to generate a diff, which can be slow over a mounted filesystem.
@leth would you care to explain your regex? ISTM that a regex approach should work, but I had git status --porcelain like this:
M src/kubernetes.js
M src/server.js
M tools/image-tag
?? src/oneweave.js
?? src/oneweave.js~
and it decided that meant there was no WIP.
I tested it with that output, and it correctly said -WIP for me, so I'm not sure what is broken.
I think i've overcomplicated the regex though: grep -qE '^[^ ][^ ]\s' would suffice.
what is happening with this?