rust icon indicating copy to clipboard operation
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.

Open lolbinarycat opened this issue 1 year ago • 3 comments

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.

lolbinarycat avatar Aug 24 '24 21:08 lolbinarycat

this could be addressed by checking the timestamp on .git/refs/remotes/upstream/master and warning if it is very old

lolbinarycat avatar Aug 25 '24 16:08 lolbinarycat

@rustbot claim

lolbinarycat avatar Aug 25 '24 16:08 lolbinarycat

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?

nickrum avatar Aug 26 '24 13:08 nickrum

@rickrum should be pretty easy, just call the same warning method for both build steps

maybe it should be used for all build steps?

lolbinarycat avatar Aug 26 '24 18:08 lolbinarycat