From ae19489666a82cf1990fcfee256af450f2a27c7c Mon Sep 17 00:00:00 2001 From: diffwireauto <330573775+diffwireauto@users.noreply.github.com> Date: Fri, 27 Nov 2026 16:20:23 -0500 Subject: [PATCH] chore(#1238): pin the generated plugin registrants to LF The Flutter toolchain rewrites seven checked-in generated files on every `pub get` and every build. On a Windows checkout with core.autocrlf=true git checked them out as CRLF while the index held LF, so after each flutter invocation they showed as modified, and `git rebase` refused with "cannot rebase: You have unstaged changes" until someone restored them. That happened three times in one session during PR #1235. `text eol=lf` on those paths makes git check them out as LF, which is what the toolchain writes, so the two agree and the churn stops. Verified rather than assumed: re-materialized the seven under the new rule (w/crlf became w/lf), then ran `flutter pub get` twice. Both times the seven stayed out of `git status`. Scoped to these paths deliberately. A repo-wide `* text=auto` would renormalize every tracked text file in one commit, colliding with whatever other branches have in flight and changing checkout behaviour for contributors on other platforms. While testing this, `untranslated.json` turned out to be a SECOND and unrelated cause, so it is deliberately not in the rule: git hash-object --path untranslated.json -- untranslated.json git rev-parse :untranslated.json both 47cfb36de8c4b16716046a03e98bbe87172a2c5a, both 248185 bytes It is byte-identical to the index and already w/lf, so a line-ending rule cannot affect it and adding one would be a no-op. `flutter gen-l10n` regenerates it with identical content and a fresh mtime, git flags it on stat, and `git update-index --refresh` reports "needs update" without clearing it. `git add untranslated.json` clears it and stages nothing, which confirms there is no content change and gives a one-command workaround when it blocks a rebase. Recorded on #1238; not fixed here. --- .gitattributes | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.gitattributes b/.gitattributes index da27f489..76cfef7b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,23 @@ *.aab filter=lfs diff=lfs merge=lfs -text *.so filter=lfs diff=lfs merge=lfs -text *.jar filter=lfs diff=lfs merge=lfs -text + +# Generated plugin registrants, pinned to LF (#1238). +# +# The Flutter toolchain rewrites these seven files on every `pub get` and +# every build. On a Windows checkout with core.autocrlf=true they then come +# back CRLF while the index holds LF, so they show as modified with a +# zero-byte content diff, and `git rebase` refuses with "cannot rebase: You +# have unstaged changes" until someone restores them. During PR #1235 that +# happened three times in one session. +# +# Scoped to these paths on purpose. A repo-wide `* text=auto` would +# renormalize every tracked text file in one commit, colliding with whatever +# other branches have in flight and changing checkout behaviour for +# contributors on other platforms. The churn is confined to generated files, +# so the rule is too. +linux/flutter/generated_plugin_registrant.* text eol=lf +linux/flutter/generated_plugins.cmake text eol=lf +macos/Flutter/GeneratedPluginRegistrant.swift text eol=lf +windows/flutter/generated_plugin_registrant.* text eol=lf +windows/flutter/generated_plugins.cmake text eol=lf