Files
group_fqcd_jr/.gitattributes
lzf_0626 c5bfc2c998 钉住 .bat 的换行:新增 .gitattributes(*.bat text eol=crlf)
本机 core.autocrlf=true,git 在 add 时会把工作区的 CRLF 静默存成 LF;
换个 autocrlf=false 的环境 clone 出来就是 LF,而 cmd 对 LF-only 的 .bat
会行边界错乱(把 echo 的说明文字当命令执行,实测报
"AT 命令已弃用"、"']' 不是内部或外部命令",甚至真的去跑脚本)。

.gitattributes 里钉 `*.bat text eol=crlf`:仓库统一按 LF 存储、检出时转回 CRLF,
不依赖任何人的本地 git 配置。

验证方式(不是"我觉得会转"):删掉工作区的 bat 再 `git checkout --` 取回来,
实测 2090 字节、62 个 CRLF、无裸 LF,与写文件时的形态一致。

仓库里目前只有 `启动平台.bat` 一个批处理,影响面仅此。
2026-09-14 02:00:41 +08:00

13 lines
744 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 换行与编码的硬约束(2026-09-13)
#
# 为什么需要这个文件:本机 `core.autocrlf=true`,git 在 add 时会把工作区的 CRLF
# 静默存成 LF。而 **cmd 对 LF-only 的 .bat 会行边界错乱** —— 把本该 echo 出去的
# 说明文字当命令执行(实测报 `AT 命令已弃用`、`']' 不是内部或外部命令`,
# 甚至真的去跑脚本)。只靠各自机器的 git 配置保不住这件事:换台机器、换个 CI,
# clone 出来就是 LF,双击直接失败。所以在仓库层面钉死。
#
# 配合 `tools/make_launcher_bat.py`:那个生成器负责**写**文件时用
# GBK + CRLF + 无 BOM,这里负责**存**的时候别把 CRLF 弄丢。
*.bat text eol=crlf
*.cmd text eol=crlf