From e1772e723855709d0debd7a4334f03584423f192 Mon Sep 17 00:00:00 2001 From: binarycat Date: Thu, 9 Jan 2025 14:22:41 -0600 Subject: [PATCH 1/2] re-add a warning for old master branch, but with much simpler logic instead of calling into git or checking the modification time of files, simply print the warning if there is a very large number of "modified" files. also make the wording much softer, so false positives are less alarming. --- src/bootstrap/src/core/build_steps/format.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bootstrap/src/core/build_steps/format.rs b/src/bootstrap/src/core/build_steps/format.rs index f15e0f38e6921..95cf55d2fcd4a 100644 --- a/src/bootstrap/src/core/build_steps/format.rs +++ b/src/bootstrap/src/core/build_steps/format.rs @@ -114,6 +114,9 @@ fn print_paths(verb: &str, adjective: Option<&str>, paths: &[String]) { } else { println!("fmt: {verb} {len} {adjective}files"); } + if len > 1000 { + println!("hint: if this number seems too high, try running `git fetch origin master"); + } } pub fn format(build: &Builder<'_>, check: bool, all: bool, paths: &[PathBuf]) { From 60cbd749f3cfb2c717a32788bca010b441818bae Mon Sep 17 00:00:00 2001 From: binarycat Date: Fri, 10 Jan 2025 20:35:34 -0600 Subject: [PATCH 2/2] never print the warning on CI --- src/bootstrap/src/core/build_steps/format.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/build_steps/format.rs b/src/bootstrap/src/core/build_steps/format.rs index 95cf55d2fcd4a..590da1fb514cf 100644 --- a/src/bootstrap/src/core/build_steps/format.rs +++ b/src/bootstrap/src/core/build_steps/format.rs @@ -114,7 +114,7 @@ fn print_paths(verb: &str, adjective: Option<&str>, paths: &[String]) { } else { println!("fmt: {verb} {len} {adjective}files"); } - if len > 1000 { + if len > 1000 && !CiEnv::is_ci() { println!("hint: if this number seems too high, try running `git fetch origin master"); } }