Open gkleen opened 6 years ago
Nope, it shouldn't
With a file b
(with arbitrary content) and a buildscript b.gup
with content as follows:
#!/usr/bin/env zsh
gup --leave
I get the following behaviour:
$ gup b
gup b
gup b.gup modified ./b directly
$ gup b
gup b
gup b.gup modified ./b directly
I looked into this today. The clobbering stuff is a bit of a weird heuristic to try and balance annoyance with usefulness. Also it uses the previous build's state, not the current build. It does already suppress the warning if the previous build clobbered the target, but only for an update (gup -u
).
The idea is that you'll mostly run gup target
for a target you're modifying/testing, most other builds of a clobbering target should come from gup -u
. And the warning is most useful when you're working on the target, just in case you didn't mean to make it clobber the output.
So long story short: it would take a fair bit of code (and a slight performance impact) to make this always work correctly for --leave
, and it already doesn't warn if you use gup --leave
and you gup -u
your target. So it's a bug, but it's at most a nuisance and it will only appear on a clean build if you use gup -u
.
Should
gup --leave
really emit thex modified y directly
-warning?