-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitattributes
More file actions
58 lines (56 loc) · 3.36 KB
/
Copy path.gitattributes
File metadata and controls
58 lines (56 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# The text and line-ending policy (#99).
#
# A fixture exists to prove an exact sequence of bytes. Where the checkout
# pipeline is free to translate line endings, the byte a fixture was written to
# prove is deleted on the way into the tree or on the way out of it, and the test
# resting on it still passes. That is a guard that cannot fail, which is worse
# than no guard, because somebody is relying on it.
#
# It is written before the first fixture on purpose. Once sources and fixtures
# have landed under no policy, adding one rewrites them, and a rewrite that
# changes a fixture byte cannot be told apart from a fixture that was wrong.
#
# WHAT THIS FILE COVERS IS THE TREE AS IT STANDS, AND THIS PARAGRAPH SAID THAT
# EVERY TRACKED PATH WAS TEXT AND NONE WAS A FIXTURE, THAT THE FIXTURE RULE #99
# ALSO ASKS FOR WAS ABSENT HERE, AND THAT #99 STAYED OPEN ON IT. All three were
# true when they were written and none of them is now. The rule is at the foot of
# this file, `tests/fixtures/` holds the fixtures it is for, and #99 closed as
# completed on 2026-08-25. What made all three false is one change - it added the
# rule, added the first fixture and closed the issue, three lines under a
# paragraph saying that none of that had happened - and it stood from that day
# until 2026-09-17, because nothing here reads a comment in this file and nothing
# reads whether an issue a document names is still open. #372 is where it was
# found.
#
# What the paragraph was right about survives it: a path rule written for a
# directory nobody has created yet is a rule nothing holds, so a rule here arrives
# with the paths it is for, and where a fixture lives is the layout in #13.
# `tests/recorded/` is where that still applies. The directory holds no recording,
# the `-text` rule a recording needs is not here, and `tests/recorded/README.md`
# is where that is argued and where the rule lands with the first recording.
# Every path is text, and it is checked out with a line feed whatever a clone's
# own translation setting says. `text=auto` alone would leave the working tree to
# `core.autocrlf`, so two clones of one commit would still differ; `eol=lf` is
# what makes the byte the same on every machine.
#
# Written as one rule over every path rather than as a list of extensions,
# because a list is a thing a new kind of file is added without, and the file
# added without it is the one whose bytes nobody checked.
* text=auto eol=lf
# The fixture directory, where the rule above is exactly wrong.
#
# `tests/fixtures/` holds bytes a test exists to prove. `text=auto eol=lf` above
# would rewrite a carriage return out of one on the way into the index, and the
# test resting on that byte would go on passing against a file that no longer has
# it. That is the guard that cannot fail this whole file is against, so the rule
# for these paths is the opposite of the rule for everything else: nothing under
# them is examined and nothing is translated, in either direction.
#
# `-text` rather than `binary`, which is a macro for `-text -diff`. A fixture here
# is readable and a reader wants to see what changed in one, so the diff is kept.
#
# The pattern names the directory and everything under it, so a fixture added in a
# subdirectory tomorrow is covered without this file being edited. A rule that has
# to be extended per fixture is a rule the fixture that needs it most is added
# without.
tests/fixtures/** -text