Comments (2)
This also relates to this confusing blurb from the readme:
I can understand why this could be a thing that is done... but I don't think this is a wise thing to recommend for all projects. Most projects are a-OK with the defaults that Git gives. Even the Linux kernel, a premier example of a large Git project, uses a very basic .gitattributes file: https://github.com/torvalds/linux/blob/master/.gitattributes 😆
from gitattributes.
Sorry for the delay, I wanted to do a bit of research on the subject.
I think the primary concern would be with leaving the entry unspecified, as gitattributes
would frequently be used to solve the line ending problem in a per-repository level [1]. Leaving an entry unspecified means files might end up with different line endings depending on the OS of the machine that the commit is happening, also mixing them can cause issues. Project owners who want to enforce consistent line endings (which may differ per file type) would prefer specifying attributes.
* text=auto
along with more specific entries can be used to cut-down on entry count - then, text
is auto
instead of unspecified for entries that are not explicit listed. Note that there is a possibility of failure: misdetection, encoding issues, ambiguity (e.g. with mixed_files). Therefore, the explicit entries can avoid potential issues. I am not sure of the rarity of this, but given that gitattributes
files are typically "install-and-forget" and don't change very often, having the additional verbosity for less chance of encountering issues seems worthwhile.
Furthermore, in the entries you referenced, there are also additional properties, like diff=fortran
that would need the corresponding elements to have their own entries.
In this post, you reference: *.txt text=auto
(to clarify: as opposed to *.txt text
). Is that intentional? I am not sure if there is a benefit to the former and we could remove them as redundant, but quick grep shows that we don't have such entries in the current collection (there are some catch-all * text=auto
though).
Related:
- https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings
- https://www.git-scm.com/docs/gitattributes
- https://stackoverflow.com/questions/3206843/how-line-ending-conversions-work-with-git-core-autocrlf-between-different-operat
- https://stackoverflow.com/questions/48789703/gitattributes-using-text-auto-with-filters
from gitattributes.
Related Issues (20)
- Add TinaCMS Template
- Add terraform and hcl files for hashiCorp products
- add markdown in gitattributes HOT 2
- Add WordPress CMS template
- create "gitattributes organization" HOT 9
- Rationale for specifying line endings in `.gitattributes` generally, and specifically for `*.ps1` files. HOT 1
- default config '* text=auto' is placed in multiple templates
- folder ".override/" in gitattributes
- Inconsistent *.pdf attributes HOT 2
- What's the project status? HOT 5
- Consider splitting "Web.gitattributes" into "Jekyll.gitattributes" and "Node.gitattributes" similar to github/gitignore HOT 1
- Use "Global" and "community" folders like github/gitignore HOT 1
- Consider `gh` CLI extension? HOT 3
- Get in touch with @gitattributes? HOT 10
- Consider clarifying if you can have more than 1 `.gitattributes` file, and how specific the file name(s) need to be... HOT 1
- Directly set a percentage for a specific language in a .gitattributes file. HOT 1
- Generator output contains duplicate lines HOT 3
- Unity shadergraph should have eol=LF HOT 1
- What does `diff=astextplain` for `*.epub` accomplish? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitattributes.