From 9e31d29e0ee20ef1fcbcb4b71112002dad3bcc1d Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Wed, 5 Mar 2025 11:18:29 -0500 Subject: [PATCH] Tell GitHub that `*.inc.rs` files are generated ... and rename hir_type_generated.rs so it gets picked up by the glob. This mostly changes how GitHub renders diffs for generated files on the web interface. See: https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github --- .gitattributes | 1 + zjit/src/gen_hir_type.rb | 2 +- zjit/src/{hir_type_generated.rs => hir_type.inc.rs} | 0 zjit/src/hir_type.rs | 3 +-- 4 files changed, 3 insertions(+), 3 deletions(-) rename zjit/src/{hir_type_generated.rs => hir_type.inc.rs} (100%) diff --git a/.gitattributes b/.gitattributes index d0c2d266b4..6ac6e6fcc3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ *.gemspec diff=ruby *.rb diff=ruby +*.inc.rs linguist-generated=true bin svn-properties=svn:ignore=ruby bin/* diff=ruby tool/update-deps diff=ruby diff --git a/zjit/src/gen_hir_type.rb b/zjit/src/gen_hir_type.rb index b83db31d7a..eebf7c7048 100644 --- a/zjit/src/gen_hir_type.rb +++ b/zjit/src/gen_hir_type.rb @@ -1,4 +1,4 @@ -# Generate src/hir_type_generated.rs. To do this, we build up a DAG that +# Generate hir_type.inc.rs. To do this, we build up a DAG that # represents a slice of the Ruby type hierarchy that we care about optimizing. # This also includes primitive values such as C booleans, int32, and so on. diff --git a/zjit/src/hir_type_generated.rs b/zjit/src/hir_type.inc.rs similarity index 100% rename from zjit/src/hir_type_generated.rs rename to zjit/src/hir_type.inc.rs diff --git a/zjit/src/hir_type.rs b/zjit/src/hir_type.rs index 4114d81822..898676ff16 100644 --- a/zjit/src/hir_type.rs +++ b/zjit/src/hir_type.rs @@ -60,8 +60,7 @@ pub struct Type { spec: Specialization } -// TODO(max): Figure out how to silence the non-upper-case globals warning -include!("hir_type_generated.rs"); +include!("hir_type.inc.rs"); /// Get class name from a class pointer. fn get_class_name(class: Option) -> String {