Skip to content

Commit

Permalink
doc/gitattributes: clarify location of config text
Browse files Browse the repository at this point in the history
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Apr 18, 2009
1 parent f7446fc commit c4c86d2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Documentation/gitattributes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ for paths.

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

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

------------------------
[diff "tex"]
Expand Down Expand Up @@ -373,7 +375,8 @@ resulting text on stdout.

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

------------------------
[diff "jpg"]
Expand Down

0 comments on commit c4c86d2

Please sign in to comment.