Fall back to $EMAIL for missing GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL
[gitweb.git] / Documentation / gitattributes.txt
index ece58abee2a46c54dfe52670eb43d8c3211a575c..857d55a409b80f0beaa8b98e1e04f922798241e3 100644 (file)
@@ -7,7 +7,7 @@ gitattributes - defining attributes per path
 
 SYNOPSIS
 --------
-.gitattributes
+$GIT_DIR/info/attributes, gitattributes
 
 
 DESCRIPTION
@@ -49,10 +49,12 @@ Set to a value::
 Unspecified::
 
        No glob pattern matches the path, and nothing says if
-       the path has or does not have the attribute.
+       the path has or does not have the attribute, the
+       attribute for the path is said to be Unspecified.
 
 When more than one glob pattern matches the path, a later line
-overrides an earlier line.
+overrides an earlier line.  This overriding is done per
+attribute.
 
 When deciding what attributes are assigned to a path, git
 consults `$GIT_DIR/info/attributes` file (which has the highest
@@ -151,8 +153,34 @@ Unspecified::
        text, it is treated as text.  Otherwise it would
        generate `Binary files differ`.
 
-Any other value set to `diff` attribute is ignored and git acts
-as if the attribute is left unspecified.
+String::
+
+       Diff is shown using the specified custom diff driver.
+       The driver program is given its input using the same
+       calling convention as used for GIT_EXTERNAL_DIFF
+       program.
+
+
+Defining a custom diff driver
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The definition of a diff driver is done in `gitconfig`, not
+`gitattributes` file, so strictly speaking this manual page is a
+wrong place to talk about it.  However...
+
+To define a custom diff driver `jcdiff`, add a section to your
+`$GIT_DIR/config` file (or `$HOME/.gitconfig` file) like this:
+
+----------------------------------------------------------------
+[diff "jcdiff"]
+       command = j-c-diff
+----------------------------------------------------------------
+
+When git needs to show you a diff for the path with `diff`
+attribute set to `jcdiff`, it calls the command you specified
+with the above configuration, i.e. `j-c-diff`, with 7
+parameters, just like `GIT_EXTERNAL_DIFF` program is called.
+See gitlink:git[7] for details.
 
 
 Performing a three-way merge
@@ -183,13 +211,13 @@ Unspecified::
        different merge driver to be used for paths to which the
        `merge` attribute is unspecified.
 
-Any other string value::
+String::
 
        3-way merge is performed using the specified custom
        merge driver.  The built-in 3-way merge driver can be
        explicitly specified by asking for "text" driver; the
        built-in "take the current branch" driver can be
-       requested by "binary".
+       requested with "binary".
 
 
 Defining a custom merge driver