Skip to content

Commit 6a319e3

Browse files
committed
Merge branch 'maint'
* maint: add gitignore entry to description about how to write a builtin gitattributes: Reword "attribute macro" to "macro attribute" gitattributes: Clarify discussion of attribute macros
2 parents 1b57e56 + e9e0643 commit 6a319e3

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

Documentation/gitattributes.txt

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Attributes for all users on a system should be placed in the
7979
`$(prefix)/etc/gitattributes` file.
8080

8181
Sometimes you would need to override an setting of an attribute
82-
for a path to `unspecified` state. This can be done by listing
82+
for a path to `Unspecified` state. This can be done by listing
8383
the name of the attribute prefixed with an exclamation point `!`.
8484

8585

@@ -868,7 +868,7 @@ If this attribute is not set or has an invalid value, the value of the
868868
(See linkgit:git-config[1]).
869869

870870

871-
USING ATTRIBUTE MACROS
871+
USING MACRO ATTRIBUTES
872872
----------------------
873873

874874
You do not want any end-of-line conversions applied to, nor textual diffs
@@ -879,24 +879,27 @@ produced for, any binary file you track. You would need to specify e.g.
879879
------------
880880

881881
but that may become cumbersome, when you have many attributes. Using
882-
attribute macros, you can specify groups of attributes set or unset at
883-
the same time. The system knows a built-in attribute macro, `binary`:
882+
macro attributes, you can define an attribute that, when set, also
883+
sets or unsets a number of other attributes at the same time. The
884+
system knows a built-in macro attribute, `binary`:
884885

885886
------------
886887
*.jpg binary
887888
------------
888889

889-
which is equivalent to the above. Note that the attribute macros can only
890-
be "Set" (see the above example that sets "binary" macro as if it were an
891-
ordinary attribute --- setting it in turn unsets "text" and "diff").
890+
Setting the "binary" attribute also unsets the "text" and "diff"
891+
attributes as above. Note that macro attributes can only be "Set",
892+
though setting one might have the effect of setting or unsetting other
893+
attributes or even returning other attributes to the "Unspecified"
894+
state.
892895

893896

894-
DEFINING ATTRIBUTE MACROS
897+
DEFINING MACRO ATTRIBUTES
895898
-------------------------
896899

897-
Custom attribute macros can be defined only in the `.gitattributes` file
898-
at the toplevel (i.e. not in any subdirectory). The built-in attribute
899-
macro "binary" is equivalent to:
900+
Custom macro attributes can be defined only in the `.gitattributes`
901+
file at the toplevel (i.e. not in any subdirectory). The built-in
902+
macro attribute "binary" is equivalent to:
900903

901904
------------
902905
[attr]binary -diff -text

Documentation/technical/api-builtin.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Additionally, if `foo` is a new command, there are 3 more things to do:
4949

5050
. Add an entry for `git-foo` to `command-list.txt`.
5151

52+
. Add an entry for `/git-foo` to `.gitignore`.
53+
5254

5355
How a built-in is called
5456
------------------------

0 commit comments

Comments
 (0)