# ============================================================================= # 換行符政策 # ----------------------------------------------------------------------------- # 這個 repo 同時被 Windows(Tera Term 端編輯)與 SONiC/Linux(DUT 端執行)使用, # 所以必須明確指定,不能靠各機器的 core.autocrlf。 # # 踩過的坑:margin.sh 帶著 CRLF 進 repo,scp 到 DUT 後 bash 直接掛: # -bash: $'\r': command not found # syntax error near unexpected token `$'{\r'' # settings/*.conf 同樣危險 —— margin_init 是用 source 讀它們的,未加引號的 # 賦值(例如 CB_I2C_CH=6)會變成 "6\r",SWB transport 會拿著壞掉的通道號去打 I2C。 # ============================================================================= # 在 DUT / Linux 上執行或被 source 的,一律 LF *.sh text eol=lf *.conf text eol=lf *.py text eol=lf *.txt text eol=lf *.md text eol=lf # Tera Term macro 只在 Windows 上跑,維持 CRLF;標成 -text 讓 git 原樣保存, # 避免對既有檔案產生大量純換行符的假 diff *.ttl -text # 二進位,不要做任何轉換 *.xlsx binary *.docx binary *.pdf binary *.h5 binary