-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x.py fmt: logic for "which files changed" is broken when there are no changes #130147
Comments
That should only format the files that changed, which is 0 files. Instead it formats >5000 files. |
It's not just "no changes" where this case hits, I've also now hit this in a branch that does have changes compared to master. Not sure how to reproduce that. |
(Note that this issue is not fixed yet, it needs #130161 to be merged first). |
Thank you, for letting me know! |
Rollup merge of rust-lang#130161 - onur-ozkan:fmt-changed-files, r=Kobzol,RalfJung refactor merge base logic and fix `x fmt` When remote upstream is not configured, using [get_git_modified_files](https://github.com/rust-lang/rust/blob/38e3a5771cefc9362976a605549f8b04d5707311/src/tools/build_helper/src/git.rs#L114) to find modified files fails because [get_rust_lang_rust_remote](https://github.com/rust-lang/rust/blob/38e3a5771cefc9362976a605549f8b04d5707311/src/tools/build_helper/src/git.rs#L46-L48) can not resolve "rust-lang/rust" from the git output. The changes in this PR makes bootstrap to find the latest bors commit, treating it as the "closest upstream commit" so that the change tracker logic can use it to find the diffs. In addition, [skips formatting](rust-lang@e392454) if there are no modified files. Fixes rust-lang#130147
When I run
./x.py fmt
in a clean checkout, I get the following:If I now change a single file manually, it says instead:
Cc @rust-lang/bootstrap
The text was updated successfully, but these errors were encountered: