Skip to content

Add .gitattributes to enforce LF line endings / Kabuk betikleri icin LF satir sonu (.gitattributes) - #29

Merged
schematrix merged 2 commits into
schematrix:mainfrom
isihussain:chore/gitattributes-lf
Nov 7, 2026
Merged

schematrix merged 2 commits into
schematrix:mainfrom
isihussain:chore/gitattributes-lf

Conversation

@isihussain

Copy link
Copy Markdown
Contributor

English · Turkce

English

When users clone the repository on Windows (where Git often defaults to core.autocrlf=true), shell scripts and configuration files can be checked out with Windows CRLF (\r\n) line endings.

If those files are transferred or executed on a Raspberry Pi or Linux machine, bash fails with errors such as /bin/bash^M: bad interpreter or \r: command not found.

This PR adds a .gitattributes file that:

  • Enforces eol=lf for all *.sh shell scripts, *.conf, *.yml, *.html, and *.md files.
  • Ensures consistent Unix line endings regardless of the operating system or local git config used to clone the repo.

Turkce

Repoyu Windows ortamında klonlayan geliştiricilerde (Git'in core.autocrlf=true varsayılanı nedeniyle) kabuk betikleri ve yapılandırma dosyaları Windows CRLF (\r\n) satır sonlarıyla indirilebiliyor.

Bu betikler doğrudan Raspberry Pi'ye aktarıldığında veya Linux üzerinde çalıştırıldığında /bin/bash^M: bad interpreter ya da \r: command not found hatalarına yol açar.

Bu PR:

  • Tüm *.sh kabuk betiklerinin, *.conf, *.yml, *.html ve *.md dosyalarının satır sonlarını eol=lf (Unix) olarak sabitler.
  • Klonlanan işletim sisteminden bağımsız olarak betiklerin her zaman temiz ve çalışabilir kalmasını sağlar.

@schematrix

Copy link
Copy Markdown
Owner

Merhaba isihussain, çok teşekkürler. Windows'ta klonlayıp betiği Pi'ye kopyalayınca çıkan "bad interpreter" hatası tam da insanı uğraştıran türden bir sorun, bunu baştan önlemen çok güzel olmuş.

Küçük bir ricam var. Repoda artık systemd dosyaları da var, örneğin saglik/has-disk-health.service ve has-disk-health.timer. Bunlar da CRLF ile inerse systemd sorun çıkarabilir. Listeye *.service ve *.timer satırlarını da ekleyebilir misin? İstersen *.css, *.js ve *.json da eklenebilir, ana sayfa dosyaları için tutarlı olur.


Hi isihussain, thanks a lot. The "bad interpreter" error you get after cloning on Windows and copying a script to the Pi is exactly the kind of thing that wastes people's time, so it's great to prevent it up front.

One small request. The repo now also has systemd files, for example saglik/has-disk-health.service and has-disk-health.timer. If those come down with CRLF, systemd may have trouble with them too. Could you add *.service and *.timer to the list? If you like, *.css, *.js and *.json could be added as well, to keep the homepage files consistent.

@isihussain

Copy link
Copy Markdown
Contributor Author

Rica ederim! *.service ve *.timer systemd birimleriyle birlikte *.css, *.js ve *.json dosyalarını da listeye ekledim. Kontrol edebilirsiniz.

@schematrix

Copy link
Copy Markdown
Owner

Teşekkürler isihussain, tam istediğim gibi olmuş. Artık Windows'ta klonlayan biri de betikleri ve systemd dosyalarını Pi'de sorunsuz çalıştırabilecek. Merge ediyorum.


Thanks isihussain, that's exactly what I had in mind. Now someone cloning on Windows will be able to run the scripts and systemd units on the Pi without trouble. Merging.

@schematrix

Copy link
Copy Markdown
Owner

Teşekkürler isihussain, Türkçe tablo artık düzgün görünüyor. İnternetsiz bir kutuda saatin doğru kalması hem günlükler hem de Güvendeyim panosu gibi özellikler için önemli, bu not çok işe yarayacak. Merge ediyorum.


Thanks isihussain, the Turkish table looks right now. Keeping the right time on an offline box matters for logs and for features like the "I'm safe" board, so this note will be really useful. Merging.

@schematrix
schematrix merged commit 5454cac into schematrix:main Nov 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants