Skip to content

Commit

Permalink
Clarified gitattributes documentation regarding custom hunk header.
Browse files Browse the repository at this point in the history
The only part of the hunk header that we can change is the "TEXT"
portion.  Additionally, a few grammatical errors have been corrected.

Signed-off-by: Garry Dolley <gdolley@ucla.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Garry Dolley authored and Junio C Hamano committed Sep 19, 2008
1 parent 61aeeef commit c882c01
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Documentation/gitattributes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -270,27 +270,27 @@ See linkgit:git[1] for details.
Defining a custom hunk-header
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Each group of changes (called "hunk") in the textual diff output
Each group of changes (called a "hunk") in the textual diff output
is prefixed with a line of the form:

@@ -k,l +n,m @@ TEXT

The text is called 'hunk header', and by default a line that
begins with an alphabet, an underscore or a dollar sign is used,
which matches what GNU 'diff -p' output uses. This default
selection however is not suited for some contents, and you can
use customized pattern to make a selection.
This is called a 'hunk header'. The "TEXT" portion is by default a line
that begins with an alphabet, an underscore or a dollar sign; this
matches what GNU 'diff -p' output uses. This default selection however
is not suited for some contents, and you can use a customized pattern
to make a selection.

First in .gitattributes, you would assign the `diff` attribute
First, in .gitattributes, you would assign the `diff` attribute
for paths.

------------------------
*.tex diff=tex
------------------------

Then, you would define "diff.tex.funcname" configuration to
Then, you would define a "diff.tex.funcname" configuration to
specify a regular expression that matches a line that you would
want to appear as the hunk header, like this:
want to appear as the hunk header "TEXT", like this:

------------------------
[diff "tex"]
Expand Down

0 comments on commit c882c01

Please sign in to comment.