you want to use an external diff program only on a subset of
your files, you might want to use linkgit:gitattributes[5] instead.
+diff.mnemonicprefix::
+ If set, 'git-diff' uses a prefix pair that is different from the
+ standard "a/" and "b/" depending on what is being compared. When
+ this configuration is in effect, reverse diff output also swaps
+ the order of the prefixes:
+'git-diff';;
+ compares the (i)ndex and the (w)ork tree;
+'git-diff HEAD';;
+ compares a (c)ommit and the (w)ork tree;
+'git diff --cached';;
+ compares a (c)ommit and the (i)ndex;
+'git-diff HEAD:file1 file2';;
+ compares an (o)bject and a (w)ork tree entity;
+'git diff --no-index a b';;
+ compares two non-git things (1) and (2).
+
diff.renameLimit::
The number of files to consider when performing the copy/rename
detection; equivalent to the 'git-diff' option '-l'.
</p>\r
</dd>\r
<dt>\r
+diff.mnemonicprefix\r
+</dt>\r
+<dd>\r
+<p>\r
+ If set, <em>git-diff</em> uses a prefix pair that is different from the\r
+ standard "a/" and "b/" depending on what is being compared. When\r
+ this configuration is in effect, reverse diff output also swaps\r
+ the order of the prefixes:\r
+</p>\r
+<div class="vlist"><dl>\r
+<dt>\r
+<em>git-diff</em>\r
+</dt>\r
+<dd>\r
+<p>\r
+ compares the (i)ndex and the (w)ork tree;\r
+</p>\r
+</dd>\r
+<dt>\r
+<em>git-diff HEAD</em>\r
+</dt>\r
+<dd>\r
+<p>\r
+ compares a (c)ommit and the (w)ork tree;\r
+</p>\r
+</dd>\r
+<dt>\r
+<em>git diff --cached</em>\r
+</dt>\r
+<dd>\r
+<p>\r
+ compares a (c)ommit and the (i)ndex;\r
+</p>\r
+</dd>\r
+<dt>\r
+<em>git-diff HEAD:file1 file2</em>\r
+</dt>\r
+<dd>\r
+<p>\r
+ compares an (o)bject and a (w)ork tree entity;\r
+</p>\r
+</dd>\r
+<dt>\r
+<em>git diff --no-index a b</em>\r
+</dt>\r
+<dd>\r
+<p>\r
+ compares two non-git things (1) and (2).\r
+</p>\r
+</dd>\r
+</dl></div>\r
+</dd>\r
+<dt>\r
diff.renameLimit\r
</dt>\r
<dd>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 2008-09-13 06:06:56 UTC\r
+Last updated 2008-09-19 06:26:30 UTC\r
</div>\r
</div>\r
</body>\r
</li>\r
<li>\r
<p>\r
+<em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
<em>%e</em>: encoding\r
</p>\r
</li>\r
</div></div>\r
<div class="para"><p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is\r
involved. Especially, even for a creation or a deletion,\r
-<tt>/dev/null</tt> is <em>not</em> used in place of <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>\r
+<tt>/dev/null</tt> is _not_ used in place of <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>\r
<div class="para"><p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the\r
name of the source file of the rename/copy and the name of\r
the file that rename/copy produces, respectively.</p></div>\r
added, from the point of view of that parent).</p></div>\r
<div class="para"><p>In the above example output, the function signature was changed\r
from both files (hence two <tt>-</tt> removals from both file1 and\r
-file2, plus <tt><tt>+</tt> to mean one line that was added does not appear\r
+file2, plus <tt>++</tt> to mean one line that was added does not appear\r
in either file1 nor file2). Also two other lines are the same\r
-from file1 but do not appear in file2 (hence prefixed with <tt> </tt></tt>).</p></div>\r
+from file1 but do not appear in file2 (hence prefixed with <tt> +</tt>).</p></div>\r
<div class="para"><p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a\r
merge commit with the merge result (i.e. file1..fileN are the\r
parents). When shown by <tt>git diff-files -c</tt>, it compares the\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 2008-09-03 05:19:55 UTC\r
+Last updated 2008-09-19 06:26:30 UTC\r
</div>\r
</div>\r
</body>\r
<dd>\r
<p>\r
The name of the ref (the part after $GIT_DIR/).\r
+ For a non-ambiguous short name of the ref append <tt>:short</tt>.\r
</p>\r
</dd>\r
<dt>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 2008-09-03 05:19:57 UTC\r
+Last updated 2008-09-19 06:26:32 UTC\r
</div>\r
</div>\r
</body>\r
refname::
The name of the ref (the part after $GIT_DIR/).
+ For a non-ambiguous short name of the ref append `:short`.
objecttype::
The type of the object (`blob`, `tree`, `commit`, `tag`).
</li>\r
<li>\r
<p>\r
+<em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
<em>%e</em>: encoding\r
</p>\r
</li>\r
</div></div>\r
<div class="para"><p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is\r
involved. Especially, even for a creation or a deletion,\r
-<tt>/dev/null</tt> is <em>not</em> used in place of <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>\r
+<tt>/dev/null</tt> is _not_ used in place of <tt>a/</tt> or <tt>b/</tt> filenames.</p></div>\r
<div class="para"><p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the\r
name of the source file of the rename/copy and the name of\r
the file that rename/copy produces, respectively.</p></div>\r
added, from the point of view of that parent).</p></div>\r
<div class="para"><p>In the above example output, the function signature was changed\r
from both files (hence two <tt>-</tt> removals from both file1 and\r
-file2, plus <tt><tt>+</tt> to mean one line that was added does not appear\r
+file2, plus <tt>++</tt> to mean one line that was added does not appear\r
in either file1 nor file2). Also two other lines are the same\r
-from file1 but do not appear in file2 (hence prefixed with <tt> </tt></tt>).</p></div>\r
+from file1 but do not appear in file2 (hence prefixed with <tt> +</tt>).</p></div>\r
<div class="para"><p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a\r
merge commit with the merge result (i.e. file1..fileN are the\r
parents). When shown by <tt>git diff-files -c</tt>, it compares the\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 2008-09-04 00:23:36 UTC\r
+Last updated 2008-09-19 06:26:32 UTC\r
</div>\r
</div>\r
</body>\r
</li>\r
<li>\r
<p>\r
+<em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
<em>%e</em>: encoding\r
</p>\r
</li>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 2008-09-03 05:19:58 UTC\r
+Last updated 2008-09-19 06:26:33 UTC\r
</div>\r
</div>\r
</body>\r
</li>\r
<li>\r
<p>\r
+<em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
<em>%e</em>: encoding\r
</p>\r
</li>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 2008-09-04 00:23:36 UTC\r
+Last updated 2008-09-19 06:26:34 UTC\r
</div>\r
</div>\r
</body>\r
</li>\r
<li>\r
<p>\r
+<em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a>\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
<em>%e</em>: encoding\r
</p>\r
</li>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 2008-08-29 08:56:31 UTC\r
+Last updated 2008-09-19 06:26:35 UTC\r
</div>\r
</div>\r
</body>\r
parameters, just like <tt>GIT_EXTERNAL_DIFF</tt> program is called.\r
See <a href="git.html">git(1)</a> for details.</p></div>\r
<h4 id="_defining_a_custom_hunk_header">Defining a custom hunk-header</h4>\r
-<div class="para"><p>Each group of changes (called "hunk") in the textual diff output\r
+<div class="para"><p>Each group of changes (called a "hunk") in the textual diff output\r
is prefixed with a line of the form:</p></div>\r
<div class="literalblock">\r
<div class="content">\r
<pre><tt>@@ -k,l +n,m @@ TEXT</tt></pre>\r
</div></div>\r
-<div class="para"><p>The text is called <em>hunk header</em>, and by default a line that\r
-begins with an alphabet, an underscore or a dollar sign is used,\r
-which matches what GNU <em>diff -p</em> output uses. This default\r
-selection however is not suited for some contents, and you can\r
-use customized pattern to make a selection.</p></div>\r
-<div class="para"><p>First in .gitattributes, you would assign the <tt>diff</tt> attribute\r
+<div class="para"><p>This is called a <em>hunk header</em>. The "TEXT" portion is by default a line\r
+that begins with an alphabet, an underscore or a dollar sign; this\r
+matches what GNU <em>diff -p</em> output uses. This default selection however\r
+is not suited for some contents, and you can use a customized pattern\r
+to make a selection.</p></div>\r
+<div class="para"><p>First, in .gitattributes, you would assign the <tt>diff</tt> attribute\r
for paths.</p></div>\r
<div class="listingblock">\r
<div class="content">\r
<pre><tt>*.tex diff=tex</tt></pre>\r
</div></div>\r
-<div class="para"><p>Then, you would define "diff.tex.funcname" configuration to\r
+<div class="para"><p>Then, you would define a "diff.tex.funcname" configuration to\r
specify a regular expression that matches a line that you would\r
-want to appear as the hunk header, like this:</p></div>\r
+want to appear as the hunk header "TEXT", like this:</p></div>\r
<div class="listingblock">\r
<div class="content">\r
<pre><tt>[diff "tex"]\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 2008-09-13 06:06:59 UTC\r
+Last updated 2008-09-19 06:26:35 UTC\r
</div>\r
</div>\r
</body>\r
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"]
- '%cr': committer date, relative
- '%ct': committer date, UNIX timestamp
- '%ci': committer date, ISO 8601 format
+- '%d': ref names, like the --decorate option of linkgit:git-log[1]
- '%e': encoding
- '%s': subject
- '%b': body