OSDN Git Service

Add Git official document to help
[tortoisegit/TortoiseGitJp.git] / doc / source / en / TortoiseGit / git_doc / git-diff-tree.html.xml
diff --git a/doc/source/en/TortoiseGit/git_doc/git-diff-tree.html.xml b/doc/source/en/TortoiseGit/git_doc/git-diff-tree.html.xml
new file mode 100644 (file)
index 0000000..4730979
--- /dev/null
@@ -0,0 +1,1669 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">\r
+\r
+<article lang="en" id="git-diff-tree(1)">\r
+<articleinfo>\r
+    <title>git-diff-tree(1)</title>\r
+        <indexterm>\r
+                <primary>git-diff-tree(1)</primary>\r
+        </indexterm>\r
+</articleinfo>\r
+<simplesect id="_name">\r
+<title>NAME</title>\r
+<simpara>git-diff-tree - Compares the content and mode of blobs found via two tree objects</simpara>\r
+</simplesect>\r
+<simplesect id="_synopsis">\r
+<title>SYNOPSIS</title>\r
+<blockquote>\r
+<literallayout><emphasis>git diff-tree</emphasis> [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]\r
+              [-t] [-r] [-c | --cc] [--root] [&lt;common diff options&gt;]\r
+              &lt;tree-ish&gt; [&lt;tree-ish&gt;] [&lt;path&gt;&#8230;]</literallayout>\r
+</blockquote>\r
+</simplesect>\r
+<simplesect id="_description">\r
+<title>DESCRIPTION</title>\r
+<simpara>Compares the content and mode of the blobs found via two tree objects.</simpara>\r
+<simpara>If there is only one &lt;tree-ish&gt; given, the commit is compared with its parents\r
+(see --stdin below).</simpara>\r
+<simpara>Note that <emphasis>git-diff-tree</emphasis> can use the tree encapsulated in a commit object.</simpara>\r
+</simplesect>\r
+<simplesect id="_options">\r
+<title>OPTIONS</title>\r
+<variablelist>\r
+<varlistentry>\r
+<term>\r
+-p\r
+</term>\r
+<term>\r
+-u\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Generate patch (see section on generating patches).\r
+        \r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-U&lt;n&gt;\r
+</term>\r
+<term>\r
+--unified=&lt;n&gt;\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Generate diffs with &lt;n&gt; lines of context instead of\r
+        the usual three. Implies "-p".\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--raw\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Generate the raw format.\r
+         This is the default.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--patch-with-raw\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Synonym for "-p --raw".\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--patience\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Generate a diff using the "patience diff" algorithm.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--stat[=width[,name-width]]\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Generate a diffstat.  You can override the default\r
+        output width for 80-column terminal by "--stat=width".\r
+        The width of the filename part can be controlled by\r
+        giving another width to it separated by a comma.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--numstat\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Similar to --stat, but shows number of added and\r
+        deleted lines in decimal notation and pathname without\r
+        abbreviation, to make it more machine friendly.  For\r
+        binary files, outputs two <literal>-</literal> instead of saying\r
+        <literal>0 0</literal>.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--shortstat\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Output only the last line of the --stat format containing total\r
+        number of modified files, as well as number of added and deleted\r
+        lines.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--dirstat[=limit]\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Output the distribution of relative amount of changes (number of lines added or\r
+        removed) for each sub-directory. Directories with changes below\r
+        a cut-off percent (3% by default) are not shown. The cut-off percent\r
+        can be set with "--dirstat=limit". Changes in a child directory is not\r
+        counted for the parent directory, unless "--cumulative" is used.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--dirstat-by-file[=limit]\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Same as --dirstat, but counts changed files instead of lines.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--summary\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Output a condensed summary of extended header information\r
+        such as creations, renames and mode changes.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--patch-with-stat\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Synonym for "-p --stat".\r
+        \r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-z\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        NUL-line termination on output.  This affects the --raw\r
+        output field terminator.  Also output from commands such\r
+        as "git-log" will be delimited with NUL between commits.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--name-only\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Show only names of changed files.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--name-status\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Show only names and status of changed files. See the description\r
+        of the <literal>--diff-filter</literal> option on what the status letters mean.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--color\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Show colored diff.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--no-color\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Turn off colored diff, even when the configuration file\r
+        gives the default to color output.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--color-words[=&lt;regex&gt;]\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Show colored word diff, i.e., color words which have changed.\r
+        By default, words are separated by whitespace.\r
+</simpara>\r
+<simpara>When a &lt;regex&gt; is specified, every non-overlapping match of the\r
+&lt;regex&gt; is considered a word.  Anything between these matches is\r
+considered whitespace and ignored(!) for the purposes of finding\r
+differences.  You may want to append <literal>|[^[:space:]]</literal> to your regular\r
+expression to make sure that it matches all non-whitespace characters.\r
+A match that contains a newline is silently truncated(!) at the\r
+newline.</simpara>\r
+<simpara>The regex can also be set via a diff driver or configuration option, see\r
+<xref linkend="gitattributes(1)"/> or <xref linkend="git-config(1)"/>.  Giving it explicitly\r
+overrides any diff driver or configuration setting.  Diff drivers\r
+override configuration settings.</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--no-renames\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Turn off rename detection, even when the configuration\r
+        file gives the default to do so.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--check\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Warn if changes introduce trailing whitespace\r
+        or an indent that uses a space before a tab. Exits with\r
+        non-zero status if problems are found. Not compatible with\r
+        --exit-code.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--full-index\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Instead of the first handful of characters, show the full\r
+        pre- and post-image blob object names on the "index"\r
+        line when generating patch format output.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--binary\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        In addition to --full-index, output "binary diff" that\r
+        can be applied with "git apply".\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--abbrev[=&lt;n&gt;]\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Instead of showing the full 40-byte hexadecimal object\r
+        name in diff-raw format output and diff-tree header\r
+        lines, show only a partial prefix.  This is\r
+        independent of --full-index option above, which controls\r
+        the diff-patch output format.  Non default number of\r
+        digits can be specified with --abbrev=&lt;n&gt;.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-B\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Break complete rewrite changes into pairs of delete and create.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-M\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Detect renames.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-C\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Detect copies as well as renames.  See also <literal>--find-copies-harder</literal>.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--diff-filter=[ACDMRTUXB*]\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Select only files that are Added (<literal>A</literal>), Copied (<literal>C</literal>),\r
+        Deleted (<literal>D</literal>), Modified (<literal>M</literal>), Renamed (<literal>R</literal>), have their\r
+        type (i.e. regular file, symlink, submodule, &#8230;) changed (<literal>T</literal>),\r
+        are Unmerged (<literal>U</literal>), are\r
+        Unknown (<literal>X</literal>), or have had their pairing Broken (<literal>B</literal>).\r
+        Any combination of the filter characters may be used.\r
+        When <literal>*</literal> (All-or-none) is added to the combination, all\r
+        paths are selected if there is any file that matches\r
+        other criteria in the comparison; if there is no file\r
+        that matches other criteria, nothing is selected.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--find-copies-harder\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        For performance reasons, by default, <literal>-C</literal> option finds copies only\r
+        if the original file of the copy was modified in the same\r
+        changeset.  This flag makes the command\r
+        inspect unmodified files as candidates for the source of\r
+        copy.  This is a very expensive operation for large\r
+        projects, so use it with caution.  Giving more than one\r
+        <literal>-C</literal> option has the same effect.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-l&lt;num&gt;\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        -M and -C options require O(n^2) processing time where n\r
+        is the number of potential rename/copy targets.  This\r
+        option prevents rename/copy detection from running if\r
+        the number of rename/copy targets exceeds the specified\r
+        number.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-S&lt;string&gt;\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Look for differences that contain the change in &lt;string&gt;.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--pickaxe-all\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        When -S finds a change, show all the changes in that\r
+        changeset, not just the files that contain the change\r
+        in &lt;string&gt;.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--pickaxe-regex\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Make the &lt;string&gt; not a plain string but an extended POSIX\r
+        regex to match.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-O&lt;orderfile&gt;\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Output the patch in the order specified in the\r
+        &lt;orderfile&gt;, which has one shell glob pattern per line.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-R\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Swap two inputs; that is, show differences from index or\r
+        on-disk file to tree contents.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--relative[=&lt;path&gt;]\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        When run from a subdirectory of the project, it can be\r
+        told to exclude changes outside the directory and show\r
+        pathnames relative to it with this option.  When you are\r
+        not in a subdirectory (e.g. in a bare repository), you\r
+        can name which subdirectory to make the output relative\r
+        to by giving a &lt;path&gt; as an argument.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-a\r
+</term>\r
+<term>\r
+--text\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Treat all files as text.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--ignore-space-at-eol\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Ignore changes in whitespace at EOL.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-b\r
+</term>\r
+<term>\r
+--ignore-space-change\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Ignore changes in amount of whitespace.  This ignores whitespace\r
+        at line end, and considers all other sequences of one or\r
+        more whitespace characters to be equivalent.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-w\r
+</term>\r
+<term>\r
+--ignore-all-space\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Ignore whitespace when comparing lines.  This ignores\r
+        differences even if one line has whitespace where the other\r
+        line has none.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--inter-hunk-context=&lt;lines&gt;\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Show the context between diff hunks, up to the specified number\r
+        of lines, thereby fusing hunks that are close to each other.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--exit-code\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Make the program exit with codes similar to diff(1).\r
+        That is, it exits with 1 if there were differences and\r
+        0 means no differences.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--quiet\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Disable all output of the program. Implies --exit-code.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--ext-diff\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Allow an external diff helper to be executed. If you set an\r
+        external diff driver with <xref linkend="gitattributes(5)"/>, you need\r
+        to use this option with <xref linkend="git-log(1)"/> and friends.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--no-ext-diff\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Disallow external diff drivers.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--ignore-submodules\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Ignore changes to submodules in the diff generation.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--src-prefix=&lt;prefix&gt;\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Show the given source prefix instead of "a/".\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--dst-prefix=&lt;prefix&gt;\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Show the given destination prefix instead of "b/".\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--no-prefix\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Do not show any source or destination prefix.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+</variablelist>\r
+<simpara>For more detailed explanation on these common options, see also\r
+<xref linkend="gitdiffcore(7)"/>.</simpara>\r
+<variablelist>\r
+<varlistentry>\r
+<term>\r
+&lt;tree-ish&gt;\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        The id of a tree object.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+&lt;path&gt;&#8230;\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        If provided, the results are limited to a subset of files\r
+        matching one of these prefix strings.\r
+        i.e., file matches <literal>/^&lt;pattern1&gt;|&lt;pattern2&gt;|&#8230;/</literal>\r
+        Note that this parameter does not provide any wildcard or regexp\r
+        features.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-r\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        recurse into sub-trees\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-t\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        show tree entry itself as well as subtrees.  Implies -r.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--root\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        When <emphasis>--root</emphasis> is specified the initial commit will be shown as a big\r
+        creation event. This is equivalent to a diff against the NULL tree.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--stdin\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        When <emphasis>--stdin</emphasis> is specified, the command does not take\r
+        &lt;tree-ish&gt; arguments from the command line.  Instead, it\r
+        reads lines containing either two &lt;tree&gt;, one &lt;commit&gt;, or a\r
+        list of &lt;commit&gt; from its standard input.  (Use a single space\r
+        as separator.)\r
+</simpara>\r
+<simpara>When two trees are given, it compares the first tree with the second.\r
+When a single commit is given, it compares the commit with its\r
+parents.  The remaining commits, when given, are used as if they are\r
+parents of the first commit.</simpara>\r
+<simpara>When comparing two trees, the ID of both trees (separated by a space\r
+and terminated by a newline) is printed before the difference.  When\r
+comparing commits, the ID of the first (or only) commit, followed by a\r
+newline, is printed.</simpara>\r
+<simpara>The following flags further affect the behavior when comparing\r
+commits (but not trees).</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-m\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        By default, <emphasis>git-diff-tree --stdin</emphasis> does not show\r
+        differences for merge commits.  With this flag, it shows\r
+        differences to that commit from all of its parents. See\r
+        also <emphasis>-c</emphasis>.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-s\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        By default, <emphasis>git-diff-tree --stdin</emphasis> shows differences,\r
+        either in machine-readable form (without <emphasis>-p</emphasis>) or in patch\r
+        form (with <emphasis>-p</emphasis>).  This output can be suppressed.  It is\r
+        only useful with <emphasis>-v</emphasis> flag.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-v\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        This flag causes <emphasis>git-diff-tree --stdin</emphasis> to also show\r
+        the commit message before the differences.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--pretty[=<emphasis>&lt;format&gt;</emphasis>]\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Pretty-print the contents of the commit logs in a given format,\r
+        where <emphasis>&lt;format&gt;</emphasis> can be one of <emphasis>oneline</emphasis>, <emphasis>short</emphasis>, <emphasis>medium</emphasis>,\r
+        <emphasis>full</emphasis>, <emphasis>fuller</emphasis>, <emphasis>email</emphasis>, <emphasis>raw</emphasis> and <emphasis>format:&lt;string&gt;</emphasis>.\r
+        When omitted, the format defaults to <emphasis>medium</emphasis>.\r
+</simpara>\r
+<simpara>Note: you can specify the default pretty format in the repository\r
+configuration (see <xref linkend="git-config(1)"/>).</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--abbrev-commit\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Instead of showing the full 40-byte hexadecimal commit object\r
+        name, show only a partial prefix.  Non default number of\r
+        digits can be specified with "--abbrev=&lt;n&gt;" (which also modifies\r
+        diff output, if it is displayed).\r
+</simpara>\r
+<simpara>This should make "--pretty=oneline" a whole lot more readable for\r
+people using 80-column terminals.</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--encoding[=&lt;encoding&gt;]\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        The commit objects record the encoding used for the log message\r
+        in their encoding header; this option can be used to tell the\r
+        command to re-code the commit log message in the encoding\r
+        preferred by the user.  For non plumbing commands this\r
+        defaults to UTF-8.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--no-commit-id\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        <emphasis>git-diff-tree</emphasis> outputs a line with the commit ID when\r
+        applicable.  This flag suppressed the commit ID output.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+-c\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        This flag changes the way a merge commit is displayed\r
+        (which means it is useful only when the command is given\r
+        one &lt;tree-ish&gt;, or <emphasis>--stdin</emphasis>).  It shows the differences\r
+        from each of the parents to the merge result simultaneously\r
+        instead of showing pairwise diff between a parent and the\r
+        result one at a time (which is what the <emphasis>-m</emphasis> option does).\r
+        Furthermore, it lists only files which were modified\r
+        from all parents.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--cc\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        This flag changes the way a merge commit patch is displayed,\r
+        in a similar way to the <emphasis>-c</emphasis> option. It implies the <emphasis>-c</emphasis>\r
+        and <emphasis>-p</emphasis> options and further compresses the patch output\r
+        by omitting uninteresting hunks whose the contents in the parents\r
+        have only two variants and the merge result picks one of them\r
+        without modification.  When all hunks are uninteresting, the commit\r
+        itself and the commit log message is not shown, just like in any other\r
+        "empty diff" case.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+--always\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        Show the commit itself and the commit log message even\r
+        if the diff itself is empty.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+</variablelist>\r
+</simplesect>\r
+<simplesect id="_pretty_formats">\r
+<title>PRETTY FORMATS</title>\r
+<simpara>If the commit is a merge, and if the pretty-format\r
+is not <emphasis>oneline</emphasis>, <emphasis>email</emphasis> or <emphasis>raw</emphasis>, an additional line is\r
+inserted before the <emphasis>Author:</emphasis> line.  This line begins with\r
+"Merge: " and the sha1s of ancestral commits are printed,\r
+separated by spaces.  Note that the listed commits may not\r
+necessarily be the list of the <emphasis role="strong">direct</emphasis> parent commits if you\r
+have limited your view of history: for example, if you are\r
+only interested in changes related to a certain directory or\r
+file.</simpara>\r
+<simpara>Here are some additional details for each format:</simpara>\r
+<itemizedlist>\r
+<listitem>\r
+<simpara>\r
+<emphasis>oneline</emphasis>\r
+</simpara>\r
+<literallayout class="monospaced">&lt;sha1&gt; &lt;title line&gt;</literallayout>\r
+<simpara>This is designed to be as compact as possible.</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>short</emphasis>\r
+</simpara>\r
+<literallayout class="monospaced">commit &lt;sha1&gt;\r
+Author: &lt;author&gt;</literallayout>\r
+<literallayout class="monospaced">&lt;title line&gt;</literallayout>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>medium</emphasis>\r
+</simpara>\r
+<literallayout class="monospaced">commit &lt;sha1&gt;\r
+Author: &lt;author&gt;\r
+Date:   &lt;author date&gt;</literallayout>\r
+<literallayout class="monospaced">&lt;title line&gt;</literallayout>\r
+<literallayout class="monospaced">&lt;full commit message&gt;</literallayout>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>full</emphasis>\r
+</simpara>\r
+<literallayout class="monospaced">commit &lt;sha1&gt;\r
+Author: &lt;author&gt;\r
+Commit: &lt;committer&gt;</literallayout>\r
+<literallayout class="monospaced">&lt;title line&gt;</literallayout>\r
+<literallayout class="monospaced">&lt;full commit message&gt;</literallayout>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>fuller</emphasis>\r
+</simpara>\r
+<literallayout class="monospaced">commit &lt;sha1&gt;\r
+Author:     &lt;author&gt;\r
+AuthorDate: &lt;author date&gt;\r
+Commit:     &lt;committer&gt;\r
+CommitDate: &lt;committer date&gt;</literallayout>\r
+<literallayout class="monospaced">&lt;title line&gt;</literallayout>\r
+<literallayout class="monospaced">&lt;full commit message&gt;</literallayout>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>email</emphasis>\r
+</simpara>\r
+<literallayout class="monospaced">From &lt;sha1&gt; &lt;date&gt;\r
+From: &lt;author&gt;\r
+Date: &lt;author date&gt;\r
+Subject: [PATCH] &lt;title line&gt;</literallayout>\r
+<literallayout class="monospaced">&lt;full commit message&gt;</literallayout>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>raw</emphasis>\r
+</simpara>\r
+<simpara>The <emphasis>raw</emphasis> format shows the entire commit exactly as\r
+stored in the commit object.  Notably, the SHA1s are\r
+displayed in full, regardless of whether --abbrev or\r
+--no-abbrev are used, and <emphasis>parents</emphasis> information show the\r
+true parent commits, without taking grafts nor history\r
+simplification into account.</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>format:</emphasis>\r
+</simpara>\r
+<simpara>The <emphasis>format:</emphasis> format allows you to specify which information\r
+you want to show. It works a little bit like printf format,\r
+with the notable exception that you get a newline with <emphasis>%n</emphasis>\r
+instead of <emphasis>\n</emphasis>.</simpara>\r
+<simpara>E.g, <emphasis>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</emphasis>\r
+would show something like this:</simpara>\r
+<literallayout>The author of fe6e0ee was Junio C Hamano, 23 hours ago\r
+The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</literallayout>\r
+<simpara>The placeholders are:</simpara>\r
+<itemizedlist>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%H</emphasis>: commit hash\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%h</emphasis>: abbreviated commit hash\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%T</emphasis>: tree hash\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%t</emphasis>: abbreviated tree hash\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%P</emphasis>: parent hashes\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%p</emphasis>: abbreviated parent hashes\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%an</emphasis>: author name\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%aN</emphasis>: author name (respecting .mailmap)\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%ae</emphasis>: author email\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%aE</emphasis>: author email (respecting .mailmap)\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%ad</emphasis>: author date (format respects --date= option)\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%aD</emphasis>: author date, RFC2822 style\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%ar</emphasis>: author date, relative\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%at</emphasis>: author date, UNIX timestamp\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%ai</emphasis>: author date, ISO 8601 format\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%cn</emphasis>: committer name\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%cN</emphasis>: committer name (respecting .mailmap)\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%ce</emphasis>: committer email\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%cE</emphasis>: committer email (respecting .mailmap)\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%cd</emphasis>: committer date\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%cD</emphasis>: committer date, RFC2822 style\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%cr</emphasis>: committer date, relative\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%ct</emphasis>: committer date, UNIX timestamp\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%ci</emphasis>: committer date, ISO 8601 format\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%d</emphasis>: ref names, like the --decorate option of <xref linkend="git-log(1)"/>\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%e</emphasis>: encoding\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%s</emphasis>: subject\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%b</emphasis>: body\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%Cred</emphasis>: switch color to red\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%Cgreen</emphasis>: switch color to green\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%Cblue</emphasis>: switch color to blue\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%Creset</emphasis>: reset color\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%C(&#8230;)</emphasis>: color specification, as described in color.branch.* config option\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%m</emphasis>: left, right or boundary mark\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%n</emphasis>: newline\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>%x00</emphasis>: print a byte from a hex code\r
+</simpara>\r
+</listitem>\r
+</itemizedlist>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+<emphasis>tformat:</emphasis>\r
+</simpara>\r
+<simpara>The <emphasis>tformat:</emphasis> format works exactly like <emphasis>format:</emphasis>, except that it\r
+provides "terminator" semantics instead of "separator" semantics. In\r
+other words, each commit has the message terminator character (usually a\r
+newline) appended, rather than a separator placed between entries.\r
+This means that the final entry of a single-line format will be properly\r
+terminated with a new line, just as the "oneline" format does.\r
+For example:</simpara>\r
+<literallayout>$ git log -2 --pretty=format:%h 4da45bef \\r
+  | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'\r
+4da45be\r
+7134973 -- NO NEWLINE\r
+\r
+$ git log -2 --pretty=tformat:%h 4da45bef \\r
+  | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'\r
+4da45be\r
+7134973</literallayout>\r
+</listitem>\r
+</itemizedlist>\r
+</simplesect>\r
+<simplesect id="_limiting_output">\r
+<title>Limiting Output</title>\r
+<simpara>If you&#8217;re only interested in differences in a subset of files, for\r
+example some architecture-specific files, you might do:</simpara>\r
+<literallayout class="monospaced">git diff-tree -r &lt;tree-ish&gt; &lt;tree-ish&gt; arch/ia64 include/asm-ia64</literallayout>\r
+<simpara>and it will only show you what changed in those two directories.</simpara>\r
+<simpara>Or if you are searching for what changed in just <literal>kernel/sched.c</literal>, just do</simpara>\r
+<literallayout class="monospaced">git diff-tree -r &lt;tree-ish&gt; &lt;tree-ish&gt; kernel/sched.c</literallayout>\r
+<simpara>and it will ignore all differences to other files.</simpara>\r
+<simpara>The pattern is always the prefix, and is matched exactly.  There are no\r
+wildcards.  Even stricter, it has to match a complete path component.\r
+I.e. "foo" does not pick up <literal>foobar.h</literal>.  "foo" does match <literal>foo/bar.h</literal>\r
+so it can be used to name subdirectories.</simpara>\r
+<simpara>An example of normal usage is:</simpara>\r
+<literallayout class="monospaced">torvalds@ppc970:~/git&gt; git diff-tree 5319e4......\r
+*100664-&gt;100664 blob    ac348b.......-&gt;a01513.......      git-fsck-objects.c</literallayout>\r
+<simpara>which tells you that the last commit changed just one file (it&#8217;s from\r
+this one:</simpara>\r
+<literallayout>commit 3c6f7ca19ad4043e9e72fa94106f352897e651a8\r
+tree 5319e4d609cdd282069cc4dce33c1db559539b03\r
+parent b4e628ea30d5ab3606119d2ea5caeab141d38df7\r
+author Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005\r
+committer Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt; Sat Apr 9 12:02:30 2005\r
+\r
+Make "git-fsck-objects" print out all the root commits it finds.\r
+\r
+Once I do the reference tracking, I'll also make it print out all the\r
+HEAD commits it finds, which is even more interesting.</literallayout>\r
+<simpara>in case you care).</simpara>\r
+</simplesect>\r
+<simplesect id="_output_format">\r
+<title>Output format</title>\r
+<simpara>The output format from "git-diff-index", "git-diff-tree",\r
+"git-diff-files" and "git diff --raw" are very similar.</simpara>\r
+<simpara>These commands all compare two sets of things; what is\r
+compared differs:</simpara>\r
+<variablelist>\r
+<varlistentry>\r
+<term>\r
+git-diff-index &lt;tree-ish&gt;\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        compares the &lt;tree-ish&gt; and the files on the filesystem.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+git-diff-index --cached &lt;tree-ish&gt;\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        compares the &lt;tree-ish&gt; and the index.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;]\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        compares the trees named by the two arguments.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+<varlistentry>\r
+<term>\r
+git-diff-files [&lt;pattern&gt;&#8230;]\r
+</term>\r
+<listitem>\r
+<simpara>\r
+        compares the index and the files on the filesystem.\r
+</simpara>\r
+</listitem>\r
+</varlistentry>\r
+</variablelist>\r
+<simpara>An output line is formatted this way:</simpara>\r
+<literallayout>in-place edit  :100644 100644 bcd1234... 0123456... M file0\r
+copy-edit      :100644 100644 abcd123... 1234567... C68 file1 file2\r
+rename-edit    :100644 100644 abcd123... 1234567... R86 file1 file3\r
+create         :000000 100644 0000000... 1234567... A file4\r
+delete         :100644 000000 1234567... 0000000... D file5\r
+unmerged       :000000 000000 0000000... 0000000... U file6</literallayout>\r
+<simpara>That is, from the left to the right:</simpara>\r
+<orderedlist numeration="arabic">\r
+<listitem>\r
+<simpara>\r
+a colon.\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+mode for "src"; 000000 if creation or unmerged.\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+a space.\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+mode for "dst"; 000000 if deletion or unmerged.\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+a space.\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+sha1 for "src"; 0{40} if creation or unmerged.\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+a space.\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree".\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+a space.\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+status, followed by optional "score" number.\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+a tab or a NUL when <emphasis>-z</emphasis> option is used.\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+path for "src"\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+a tab or a NUL when <emphasis>-z</emphasis> option is used; only exists for C or R.\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+path for "dst"; only exists for C or R.\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+an LF or a NUL when <emphasis>-z</emphasis> option is used, to terminate the record.\r
+</simpara>\r
+</listitem>\r
+</orderedlist>\r
+<simpara>Possible status letters are:</simpara>\r
+<itemizedlist>\r
+<listitem>\r
+<simpara>\r
+A: addition of a file\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+C: copy of a file into a new one\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+D: deletion of a file\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+M: modification of the contents or mode of a file\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+R: renaming of a file\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+T: change in the type of the file\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+U: file is unmerged (you must complete the merge before it can\r
+be committed)\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+X: "unknown" change type (most probably a bug, please report it)\r
+</simpara>\r
+</listitem>\r
+</itemizedlist>\r
+<simpara>Status letters C and R are always followed by a score (denoting the\r
+percentage of similarity between the source and target of the move or\r
+copy), and are the only ones to be so.</simpara>\r
+<simpara>&lt;sha1&gt; is shown as all 0&#8217;s if a file is new on the filesystem\r
+and it is out of sync with the index.</simpara>\r
+<simpara>Example:</simpara>\r
+<literallayout>:100644 100644 5be4a4...... 000000...... M file.c</literallayout>\r
+<simpara>When <literal>-z</literal> option is not used, TAB, LF, and backslash characters\r
+in pathnames are represented as <literal>\t</literal>, <literal>\n</literal>, and <literal>\\</literal>,\r
+respectively.</simpara>\r
+</simplesect>\r
+<simplesect id="_diff_format_for_merges">\r
+<title>diff format for merges</title>\r
+<simpara>"git-diff-tree", "git-diff-files" and "git-diff --raw"\r
+can take <emphasis>-c</emphasis> or <emphasis>--cc</emphasis> option\r
+to generate diff output also for merge commits.  The output differs\r
+from the format described above in the following way:</simpara>\r
+<orderedlist numeration="arabic">\r
+<listitem>\r
+<simpara>\r
+there is a colon for each parent\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+there are more "src" modes and "src" sha1\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+status is concatenated status characters for each parent\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+no optional "score" number\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+single path, only for "dst"\r
+</simpara>\r
+</listitem>\r
+</orderedlist>\r
+<simpara>Example:</simpara>\r
+<literallayout>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM      describe.c</literallayout>\r
+<simpara>Note that <emphasis>combined diff</emphasis> lists only files which were modified from\r
+all parents.</simpara>\r
+</simplesect>\r
+<simplesect id="_generating_patches_with_p">\r
+<title>Generating patches with -p</title>\r
+<simpara>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run\r
+with a <emphasis>-p</emphasis> option, "git diff" without the <emphasis>--raw</emphasis> option, or\r
+"git log" with the "-p" option, they\r
+do not produce the output described above; instead they produce a\r
+patch file.  You can customize the creation of such patches via the\r
+GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</simpara>\r
+<simpara>What the -p option produces is slightly different from the traditional\r
+diff format.</simpara>\r
+<orderedlist numeration="arabic">\r
+<listitem>\r
+<simpara>\r
+It is preceded with a "git diff" header, that looks like\r
+     this:\r
+</simpara>\r
+<literallayout class="monospaced">diff --git a/file1 b/file2</literallayout>\r
+<simpara>The <literal>a/</literal> and <literal>b/</literal> filenames are the same unless rename/copy is\r
+involved.  Especially, even for a creation or a deletion,\r
+<literal>/dev/null</literal> is <emphasis>not</emphasis> used in place of <literal>a/</literal> or <literal>b/</literal> filenames.</simpara>\r
+<simpara>When rename/copy is involved, <literal>file1</literal> and <literal>file2</literal> show the\r
+name of the source file of the rename/copy and the name of\r
+the file that rename/copy produces, respectively.</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+It is followed by one or more extended header lines:\r
+</simpara>\r
+<literallayout class="monospaced">old mode &lt;mode&gt;\r
+new mode &lt;mode&gt;\r
+deleted file mode &lt;mode&gt;\r
+new file mode &lt;mode&gt;\r
+copy from &lt;path&gt;\r
+copy to &lt;path&gt;\r
+rename from &lt;path&gt;\r
+rename to &lt;path&gt;\r
+similarity index &lt;number&gt;\r
+dissimilarity index &lt;number&gt;\r
+index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</literallayout>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+TAB, LF, double quote and backslash characters in pathnames\r
+    are represented as <literal>\t</literal>, <literal>\n</literal>, <literal>\"</literal> and <literal>\\</literal>, respectively.\r
+    If there is need for such substitution then the whole\r
+    pathname is put in double quotes.\r
+</simpara>\r
+</listitem>\r
+</orderedlist>\r
+<simpara>The similarity index is the percentage of unchanged lines, and\r
+the dissimilarity index is the percentage of changed lines.  It\r
+is a rounded down integer, followed by a percent sign.  The\r
+similarity index value of 100% is thus reserved for two equal\r
+files, while 100% dissimilarity means that no line from the old\r
+file made it into the new one.</simpara>\r
+</simplesect>\r
+<simplesect id="_combined_diff_format">\r
+<title>combined diff format</title>\r
+<simpara>"git-diff-tree", "git-diff-files" and "git-diff" can take <emphasis>-c</emphasis> or\r
+<emphasis>--cc</emphasis> option to produce <emphasis>combined diff</emphasis>.  For showing a merge commit\r
+with "git log -p", this is the default format.\r
+A <emphasis>combined diff</emphasis> format looks like this:</simpara>\r
+<literallayout>diff --combined describe.c\r
+index fabadb8,cc95eb0..4866510\r
+--- a/describe.c\r
++++ b/describe.c\r
+@@@ -98,20 -98,12 +98,20 @@@\r
+        return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;\r
+  }\r
+\r
+- static void describe(char *arg)\r
+ -static void describe(struct commit *cmit, int last_one)\r
+++static void describe(char *arg, int last_one)\r
+  {\r
+ +      unsigned char sha1[20];\r
+ +      struct commit *cmit;\r
+        struct commit_list *list;\r
+        static int initialized = 0;\r
+        struct commit_name *n;\r
+\r
+ +      if (get_sha1(arg, sha1) &lt; 0)\r
+ +              usage(describe_usage);\r
+ +      cmit = lookup_commit_reference(sha1);\r
+ +      if (!cmit)\r
+ +              usage(describe_usage);\r
+ +\r
+        if (!initialized) {\r
+                initialized = 1;\r
+                for_each_ref(get_name);</literallayout>\r
+<orderedlist numeration="arabic">\r
+<listitem>\r
+<simpara>\r
+It is preceded with a "git diff" header, that looks like\r
+     this (when <emphasis>-c</emphasis> option is used):\r
+</simpara>\r
+<literallayout class="monospaced">diff --combined file</literallayout>\r
+<simpara>or like this (when <emphasis>--cc</emphasis> option is used):</simpara>\r
+<literallayout class="monospaced">diff --cc file</literallayout>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+It is followed by one or more extended header lines\r
+     (this example shows a merge with two parents):\r
+</simpara>\r
+<literallayout class="monospaced">index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;\r
+mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;\r
+new file mode &lt;mode&gt;\r
+deleted file mode &lt;mode&gt;,&lt;mode&gt;</literallayout>\r
+<simpara>The <literal>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</literal> line appears only if at least one of\r
+the &lt;mode&gt; is different from the rest. Extended headers with\r
+information about detected contents movement (renames and\r
+copying detection) are designed to work with diff of two\r
+&lt;tree-ish&gt; and are not used by combined diff format.</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+It is followed by two-line from-file/to-file header\r
+</simpara>\r
+<literallayout class="monospaced">--- a/file\r
++++ b/file</literallayout>\r
+<simpara>Similar to two-line header for traditional <emphasis>unified</emphasis> diff\r
+format, <literal>/dev/null</literal> is used to signal created or deleted\r
+files.</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+Chunk header format is modified to prevent people from\r
+     accidentally feeding it to <literal>patch -p1</literal>. Combined diff format\r
+     was created for review of merge commit changes, and was not\r
+     meant for apply. The change is similar to the change in the\r
+     extended <emphasis>index</emphasis> header:\r
+</simpara>\r
+<literallayout class="monospaced">@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</literallayout>\r
+<simpara>There are (number of parents + 1) <literal>@</literal> characters in the chunk\r
+header for combined diff format.</simpara>\r
+</listitem>\r
+</orderedlist>\r
+<simpara>Unlike the traditional <emphasis>unified</emphasis> diff format, which shows two\r
+files A and B with a single column that has <literal>-</literal> (minus&#8201;&#8212;&#8201;appears in A but removed in B), <literal>+</literal> (plus&#8201;&#8212;&#8201;missing in A but\r
+added to B), or <literal>" "</literal> (space&#8201;&#8212;&#8201;unchanged) prefix, this format\r
+compares two or more files file1, file2,&#8230; with one file X, and\r
+shows how X differs from each of fileN.  One column for each of\r
+fileN is prepended to the output line to note how X&#8217;s line is\r
+different from it.</simpara>\r
+<simpara>A <literal>-</literal> character in the column N means that the line appears in\r
+fileN but it does not appear in the result.  A <literal>+</literal> character\r
+in the column N means that the line appears in the result,\r
+and fileN does not have that line (in other words, the line was\r
+added, from the point of view of that parent).</simpara>\r
+<simpara>In the above example output, the function signature was changed\r
+from both files (hence two <literal>-</literal> removals from both file1 and\r
+file2, plus <literal>++</literal> to mean one line that was added does not appear\r
+in either file1 nor file2).  Also eight other lines are the same\r
+from file1 but do not appear in file2 (hence prefixed with <literal>&#43;</literal>).</simpara>\r
+<simpara>When shown by <literal>git diff-tree -c</literal>, it compares the parents of a\r
+merge commit with the merge result (i.e. file1..fileN are the\r
+parents).  When shown by <literal>git diff-files -c</literal>, it compares the\r
+two unresolved merge parents with the working tree file\r
+(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka\r
+"their version").</simpara>\r
+</simplesect>\r
+<simplesect id="_other_diff_formats">\r
+<title>other diff formats</title>\r
+<simpara>The <literal>--summary</literal> option describes newly added, deleted, renamed and\r
+copied files.  The <literal>--stat</literal> option adds diffstat(1) graph to the\r
+output.  These options can be combined with other options, such as\r
+<literal>-p</literal>, and are meant for human consumption.</simpara>\r
+<simpara>When showing a change that involves a rename or a copy, <literal>--stat</literal> output\r
+formats the pathnames compactly by combining common prefix and suffix of\r
+the pathnames.  For example, a change that moves <literal>arch/i386/Makefile</literal> to\r
+<literal>arch/x86/Makefile</literal> while modifying 4 lines will be shown like this:</simpara>\r
+<literallayout>arch/{i386 =&gt; x86}/Makefile    |   4 +--</literallayout>\r
+<simpara>The <literal>--numstat</literal> option gives the diffstat(1) information but is designed\r
+for easier machine consumption.  An entry in <literal>--numstat</literal> output looks\r
+like this:</simpara>\r
+<literallayout>1       2       README\r
+3       1       arch/{i386 =&gt; x86}/Makefile</literallayout>\r
+<simpara>That is, from left to right:</simpara>\r
+<orderedlist numeration="arabic">\r
+<listitem>\r
+<simpara>\r
+the number of added lines;\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+a tab;\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+the number of deleted lines;\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+a tab;\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+pathname (possibly with rename/copy information);\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+a newline.\r
+</simpara>\r
+</listitem>\r
+</orderedlist>\r
+<simpara>When <literal>-z</literal> output option is in effect, the output is formatted this way:</simpara>\r
+<literallayout>1       2       README NUL\r
+3       1       NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</literallayout>\r
+<simpara>That is:</simpara>\r
+<orderedlist numeration="arabic">\r
+<listitem>\r
+<simpara>\r
+the number of added lines;\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+a tab;\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+the number of deleted lines;\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+a tab;\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+a NUL (only exists if renamed/copied);\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+pathname in preimage;\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+a NUL (only exists if renamed/copied);\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+pathname in postimage (only exists if renamed/copied);\r
+</simpara>\r
+</listitem>\r
+<listitem>\r
+<simpara>\r
+a NUL.\r
+</simpara>\r
+</listitem>\r
+</orderedlist>\r
+<simpara>The extra <literal>NUL</literal> before the preimage path in renamed case is to allow\r
+scripts that read the output to tell if the current record being read is\r
+a single-path record or a rename/copy record without reading ahead.\r
+After reading added and deleted lines, reading up to <literal>NUL</literal> would yield\r
+the pathname, but if that is <literal>NUL</literal>, the record will show two paths.</simpara>\r
+</simplesect>\r
+<simplesect id="_author">\r
+<title>Author</title>\r
+<simpara>Written by Linus Torvalds &lt;<ulink url="mailto:torvalds@osdl.org">torvalds@osdl.org</ulink>&gt;</simpara>\r
+</simplesect>\r
+<simplesect id="_documentation">\r
+<title>Documentation</title>\r
+<simpara>Documentation by David Greaves, Junio C Hamano and the git-list &lt;<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>&gt;.</simpara>\r
+</simplesect>\r
+<simplesect id="_git">\r
+<title>GIT</title>\r
+<simpara>Part of the <xref linkend="git(1)"/> suite</simpara>\r
+</simplesect>\r
+</article>\r