summaryrefslogtreecommitdiffstats
path: root/gitattributes.html
diff options
context:
space:
mode:
authorJunio C Hamano <junio@hera.kernel.org>2008-11-14 08:26:31 +0000
committerJunio C Hamano <junio@hera.kernel.org>2008-11-14 08:26:31 +0000
commit283634923aa8f124696f3e9a77a012b96493c2d7 (patch)
tree3fe6cb2831bcd0b11ae6c10ba410d51f0e0af134 /gitattributes.html
parent9bd39c47653f45f81dbbe7210dbb55d738b3f5e7 (diff)
downloadgit-htmldocs-283634923aa8f124696f3e9a77a012b96493c2d7.tar.gz
Autogenerated HTML docs for v1.6.0.4-724-ga0d3a
Diffstat (limited to 'gitattributes.html')
-rw-r--r--gitattributes.html66
1 files changed, 53 insertions, 13 deletions
diff --git a/gitattributes.html b/gitattributes.html
index 36e10e9d9..b2cb8a577 100644
--- a/gitattributes.html
+++ b/gitattributes.html
@@ -531,10 +531,12 @@ and applicable).</p></div>
with <tt>crlf</tt>, and then <tt>ident</tt> and fed to <tt>filter</tt>.</p></div>
<h3 id="_generating_diff_text">Generating diff text</h3><div style="clear:left"></div>
<h4 id="_tt_diff_tt"><tt>diff</tt></h4>
-<div class="para"><p>The attribute <tt>diff</tt> affects if <em>git-diff</em> generates textual
-patch for the path or just says <tt>Binary files differ</tt>. It also
-can affect what line is shown on the hunk header <tt>@@ -k,l +n,m @@</tt>
-line.</p></div>
+<div class="para"><p>The attribute <tt>diff</tt> affects how <em>git</em> generates diffs for particular
+files. It can tell git whether to generate a textual patch for the path
+or to treat the path as a binary file. It can also affect what line is
+shown on the hunk header <tt>@@ -k,l +n,m @@</tt> line, tell git to use an
+external command to generate the diff, or ask git to convert binary
+files to a text format before generating the diff.</p></div>
<div class="vlist"><dl>
<dt>
Set
@@ -552,7 +554,8 @@ Unset
<dd>
<p>
A path to which the <tt>diff</tt> attribute is unset will
- generate <tt>Binary files differ</tt>.
+ generate <tt>Binary files differ</tt> (or a binary patch, if
+ binary patches are enabled).
</p>
</dd>
<dt>
@@ -571,19 +574,19 @@ String
</dt>
<dd>
<p>
- 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. This name is also used for custom hunk header
- selection.
+ Diff is shown using the specified diff driver. Each driver may
+ specify one or more options, as described in the following
+ section. The options for the diff driver "foo" are defined
+ by the configuration variables in the "diff.foo" section of the
+ git config file.
</p>
</dd>
</dl></div>
-<h4 id="_defining_a_custom_diff_driver">Defining a custom diff driver</h4>
+<h4 id="_defining_an_external_diff_driver">Defining an external diff driver</h4>
<div class="para"><p>The definition of a diff driver is done in <tt>gitconfig</tt>, not
<tt>gitattributes</tt> file, so strictly speaking this manual page is a
wrong place to talk about it. However&#8230;</p></div>
-<div class="para"><p>To define a custom diff driver <tt>jcdiff</tt>, add a section to your
+<div class="para"><p>To define an external diff driver <tt>jcdiff</tt>, add a section to your
<tt>$GIT_DIR/config</tt> file (or <tt>$HOME/.gitconfig</tt> file) like this:</p></div>
<div class="listingblock">
<div class="content">
@@ -678,6 +681,43 @@ patterns are available:</p></div>
</p>
</li>
</ul></div>
+<h4 id="_performing_text_diffs_of_binary_files">Performing text diffs of binary files</h4>
+<div class="para"><p>Sometimes it is desirable to see the diff of a text-converted
+version of some binary files. For example, a word processor
+document can be converted to an ASCII text representation, and
+the diff of the text shown. Even though this conversion loses
+some information, the resulting diff is useful for human
+viewing (but cannot be applied directly).</p></div>
+<div class="para"><p>The <tt>textconv</tt> config option is used to define a program for
+performing such a conversion. The program should take a single
+argument, the name of a file to convert, and produce the
+resulting text on stdout.</p></div>
+<div class="para"><p>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):</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>[diff "jpg"]
+ textconv = exif</tt></pre>
+</div></div>
+<div class="admonitionblock">
+<table><tr>
+<td class="icon">
+<div class="title">Note</div>
+</td>
+<td class="content">The text conversion is generally a one-way conversion;
+in this example, we lose the actual image contents and focus
+just on the text data. This means that diffs generated by
+textconv are _not_ suitable for applying. For this reason,
+only <tt>git diff</tt> and the <tt>git log</tt> family of commands (i.e.,
+log, whatchanged, show) will perform text conversion. <tt>git
+format-patch</tt> will never generate this output. If you want to
+send somebody a text-converted diff of a binary file (e.g.,
+because it quickly conveys the changes you have made), you
+should generate it separately and send it as a comment _in
+addition to_ the usual binary diff that you might send.</td>
+</tr></table>
+</div>
<h3 id="_performing_a_three_way_merge">Performing a three-way merge</h3><div style="clear:left"></div>
<h4 id="_tt_merge_tt"><tt>merge</tt></h4>
<div class="para"><p>The attribute <tt>merge</tt> affects how three versions of a file is
@@ -950,7 +990,7 @@ frotz unspecified</tt></pre>
</div>
<div id="footer">
<div id="footer-text">
-Last updated 2008-11-02 18:16:23 UTC
+Last updated 2008-11-14 08:26:11 UTC
</div>
</div>
</body>