Skip to content

Commit 03efc24

Browse files
thompsonmjDatseris
andauthored
Add .gitattributes at project initialization (#254)
* Add gitattributes file to be created by default * Create .gitattributes in same manner as .gitignore * Update CHANGELOG.md * Revert update that did not affect exported API * Update version from 2.0.2 to 2.1.0 For adding .gitattributes default setup. * Update Project.toml version Co-authored-by: George Datseris <datseris.george@gmail.com>
1 parent b931e66 commit 03efc24

File tree

2 files changed

+229
-0
lines changed

2 files changed

+229
-0
lines changed

src/defaults/gitattributes.txt

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
# This global .gitattributes file is adhered to via command:
2+
# git config --global core.attributesfile ~/git-global/.gitattributes_global
3+
#
4+
# Use this file on every device where git development is done.
5+
6+
7+
###
8+
### Auto detect text files and perform LF normalization
9+
###
10+
# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/
11+
* text=auto
12+
13+
###
14+
### The above will handle all files NOT found below.
15+
### From https://github.com/alexkaratarakis/gitattributes
16+
###
17+
18+
### gitattributes/C++.gitattributes d3b93d4 on Jun 20, 2018
19+
#sources
20+
*.c text diff=cpp
21+
*.cc text diff=cpp
22+
*.cxx text diff=cpp
23+
*.cpp text diff=cpp
24+
*.c++ text diff=cpp
25+
*.hpp text diff=cpp
26+
*.h text diff=cpp
27+
*.h++ text diff=cpp
28+
*.hh text diff=cpp
29+
30+
# Compiled Object files
31+
*.slo binary
32+
*.lo binary
33+
*.o binary
34+
*.obj binary
35+
36+
# Precompiled Headers
37+
*.gch binary
38+
*.pch binary
39+
40+
# Compiled Dynamic libraries
41+
*.so binary
42+
*.dylib binary
43+
*.dll binary
44+
45+
# Compiled Static libraries
46+
*.lai binary
47+
*.la binary
48+
*.a binary
49+
*.lib binary
50+
51+
# Executables
52+
*.exe binary
53+
*.out binary
54+
*.app binary
55+
56+
# Other
57+
##############
58+
*.exe binary
59+
*.num binary
60+
*.xls binary
61+
*.xlsx binary
62+
*.XLS binary
63+
*.XLSX binary
64+
bin/ binary
65+
66+
### gitattributes/Common.gitattributes 9b38185 on Jun 9, 2018
67+
# Common settings that generally should always be used with your language specific settings
68+
69+
# Auto detect text files and perform LF normalization
70+
# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/
71+
* text=auto
72+
73+
#
74+
# The above will handle all files NOT found below
75+
#
76+
77+
# Documents
78+
*.doc diff=astextplain
79+
*.DOC diff=astextplain
80+
*.docx diff=astextplain
81+
*.DOCX diff=astextplain
82+
*.dot diff=astextplain
83+
*.DOT diff=astextplain
84+
*.pdf diff=astextplain
85+
*.PDF diff=astextplain
86+
*.rtf diff=astextplain
87+
*.RTF diff=astextplain
88+
*.md text diff=markdown
89+
*.adoc text
90+
*.textile text
91+
*.tex text diff=tex
92+
*.mustache text
93+
*.csv text
94+
*.tab text
95+
*.tsv text
96+
*.sql text
97+
98+
# Graphics
99+
*.png binary
100+
*.jpg binary
101+
*.jpeg binary
102+
*.gif binary
103+
*.tif binary
104+
*.tiff binary
105+
*.ico binary
106+
# SVG treated as an asset (binary) by default. If you want to treat it as text,
107+
# comment-out the following line and uncomment the line after.
108+
*.svg binary
109+
#*.svg text
110+
*.eps binary
111+
112+
### gitattributes/Java.gitattributes c08b42f on Mar 29, 2017
113+
# Handle line endings automatically for files detected as text
114+
# and leave all files detected as binary untouched.
115+
* text=auto
116+
117+
#
118+
# The above will handle all files NOT found below
119+
#
120+
# These files are text and should be normalized (Convert crlf => lf)
121+
*.css text
122+
*.df text
123+
*.htm text
124+
*.html text
125+
*.java text
126+
*.js text
127+
*.json text
128+
*.jsp text
129+
*.jspf text
130+
*.jspx text
131+
*.properties text
132+
*.sh text
133+
*.tld text
134+
*.txt text
135+
*.tag text
136+
*.tagx text
137+
*.xml text
138+
*.yml text
139+
*.toml text
140+
141+
# These files are binary and should be left untouched
142+
# (binary is a macro for -text -diff)
143+
*.class binary
144+
*.dll binary
145+
*.ear binary
146+
*.gif binary
147+
*.ico binary
148+
*.jar binary
149+
*.jpg binary
150+
*.jpeg binary
151+
*.png binary
152+
*.so binary
153+
*.war binary
154+
155+
### gitattributes/Matlab.gitattributes d2539f6 on Dec 3, 2015
156+
# Basic .gitattributes for a MATLAB repo.
157+
# This template includes Simulink and MuPAD extensions, in addition
158+
# to the MATLAB extensions.
159+
160+
# Source files
161+
# ============
162+
*.m text
163+
*.mu text
164+
165+
# Caution: *.m also matches Mathematica packages.
166+
167+
# Binary files
168+
# ============
169+
*.p binary
170+
*.mex* binary
171+
*.fig binary
172+
*.mat binary
173+
*.mdl binary
174+
*.slx binary
175+
*.mdlp binary
176+
*.slxp binary
177+
*.sldd binary
178+
*.mltbx binary
179+
*.mlappinstall binary
180+
*.mlpkginstall binary
181+
*.mn binary
182+
183+
### gitattributes/Python.gitattributes cbd3af4 on Jun 20, 2018
184+
# Basic .gitattributes for a python repo.
185+
186+
# Source files
187+
# ============
188+
*.pxd text diff=python
189+
*.py text diff=python
190+
*.py3 text diff=python
191+
*.pyw text diff=python
192+
*.pyx text diff=python
193+
194+
# Binary files
195+
# ============
196+
*.db binary
197+
*.p binary
198+
*.pkl binary
199+
*.pyc binary
200+
*.pyd binary
201+
*.pyo binary
202+
203+
# Note: .db, .p, and .pkl files are associated
204+
# with the python modules ``pickle``, ``dbm.*``,
205+
# ``shelve``, ``marshal``, ``anydbm``, & ``bsddb``
206+
# (among others).
207+
208+
### gitattributes/R.gitattributes 80aacc1 on Aug 22, 2015
209+
# Basic .gitattributes for a R repo.
210+
211+
# Source files
212+
# ============
213+
*.Rdata text
214+
*.rdb binary
215+
*.rds binary
216+
*.Rd text
217+
*.Rdx binary
218+
*.Rmd text
219+
*.R text
220+
221+

src/project_setup.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,14 @@ function initialize_project(path, name = default_name_from_path(path);
315315
write(joinpath(path, "scripts", "intro.jl"), makeintro(name))
316316

317317
files = vcat(".gitignore", joinpath("scripts", "intro.jl"), joinpath("test", "runtests.jl"))
318+
319+
cp(joinpath(@__DIR__, "defaults", "gitattributes.txt"), joinpath(path, ".gitattributes"))
320+
chmod(joinpath(path, ".gitattributes"),0o644)
321+
322+
write(joinpath(path, "scripts", "intro.jl"), makeintro(name))
323+
324+
files = vcat(".gitattributes", joinpath("scripts", "intro.jl"), joinpath("test", "runtests.jl"))
325+
318326
if readme
319327
write(joinpath(path, "README.md"), DEFAULT_README(name, authors))
320328
push!(files, "README.md")

0 commit comments

Comments
 (0)