Skip to content

Commit c4c86d2

Browse files
peffgitster
authored andcommitted
doc/gitattributes: clarify location of config text
The gitattributes documentation has a section on the "diff" attribute, with subsections for each of the things you might want to configure in your diff config section (external diff, hunk headers, etc). The first such subsection specifically notes that the definition of the diff driver should go into $GIT_DIR/config, but subsequent sections do not. This location is implied if you are reading the documentation sequentially, but it is not uncommon for a new user to jump to (or be referred to) a specific section. For a new user who does not know git well enough to recognize the config syntax, it is not clear that those directives don't also go into the gitattributes file. This patch just mentions the config file in each subsection, similar to the way it is mentioned in the first. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f7446fc commit c4c86d2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Documentation/gitattributes.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ for paths.
297297

298298
Then, you would define a "diff.tex.xfuncname" configuration to
299299
specify a regular expression that matches a line that you would
300-
want to appear as the hunk header "TEXT", like this:
300+
want to appear as the hunk header "TEXT". Add a section to your
301+
`$GIT_DIR/config` file (or `$HOME/.gitconfig` file) like this:
301302

302303
------------------------
303304
[diff "tex"]
@@ -345,7 +346,8 @@ split words in a line, by specifying an appropriate regular expression
345346
in the "diff.*.wordRegex" configuration variable. For example, in TeX
346347
a backslash followed by a sequence of letters forms a command, but
347348
several such commands can be run together without intervening
348-
whitespace. To separate them, use a regular expression such as
349+
whitespace. To separate them, use a regular expression in your
350+
`$GIT_DIR/config` file (or `$HOME/.gitconfig` file) like this:
349351

350352
------------------------
351353
[diff "tex"]
@@ -373,7 +375,8 @@ resulting text on stdout.
373375

374376
For example, to show the diff of the exif information of a
375377
file instead of the binary information (assuming you have the
376-
exif tool installed):
378+
exif tool installed), add the following section to your
379+
`$GIT_DIR/config` file (or `$HOME/.gitconfig` file):
377380

378381
------------------------
379382
[diff "jpg"]

0 commit comments

Comments
 (0)