rust
rust copied to clipboard
build_helper::git uses the upstream/master branch to tell if a file has been modified, but this branch is never automatically updated.
I have my master branch set up to track the master branch of my fork (mainly because i don't want to accidentally pull in every git tag into my shallow clone), so upstream/master doesn't updated when i run git pull (presumably the upstream remote was created by ./x setup? i don't remember creating it, and lots of code needs it (or another branch pointing to this repo) to work).
as it turns out, ./x fmt uses the state of upstream/master to determine if a file has been modified. so instead of it formatting every file that i modified, it formats every file anyone has modified in the last few months.
at no point did anything warn me that i need to be updating a remote i didn't add. it should probably do that.
this could be addressed by checking the timestamp on .git/refs/remotes/upstream/master and warning if it is very old
@rustbot claim
I ran into a similar issue where ./x build library was building llvm from source instead of using the prebuilt ci version due to an outdated upstream branch. Would it make sense to solve both issues in one go?
@rickrum should be pretty easy, just call the same warning method for both build steps
maybe it should be used for all build steps?